[afnog] Two IP Addresses on the same Interface
Patrick J Okui
pokui at psg.com
Thu Jul 12 10:35:18 UTC 2007
On 12 Jul, 2007, at 12:28 PM, Vincent Ngundi wrote:
> Thanks Phi, Randy, Steve, Noah and GJ.
>
> I have the following configuration in /etc/rc.conf
>
> <snip>
>
> ifconfig_fxp0="inet A.B.C.41 netmask 255.255.255.240"
> ifconfig_fxp0_alias0="inet E.F.G.1 netmask 255.255.255.240"
> ifconfig_fxp0_alias1="inet E.F.G.2 netmask 255.255.255.255"
> [...]
> defaultrouter="A.B.C.33"
>
> How do I define the gateway for the prefix E.F.G?
If you type netstat -rn you'll find that you have a route for E.F.G/
28 via fxp0 already. If you want to add other routes then use the
"route(8)" command. e.g to route traffic for the rest of E.F.G/24 via
E.F.G.254 " route add -net E.F.G/24 E.F.G.254" would do. To make
such extra routes persistent then add something like ...
static_routes="efg"
route_efg="-net E.F.G/24 E.F.G.254"
to your rc.conf. Read the rc.conf and route(8) man pages for more
info on that.
--
patrick
More information about the afnog
mailing list