adding ip:s with different gateway

Bill Moran wmoran at
Thu Apr 6 14:03:44 UTC 2006

"Perttu Laine" <plaine at> wrote:

> I have currently ip:s from block ...125.192/26 on my freebsd server.
> with gateway ...125.193.
> added via rc.conf:
> defaultrouter="...125.193"
> ifconfig_rl0="inet ...125.194  netmask"
> ifconfig_rl0_alias0="inet ...125.195  netmask"
> ifconfig_rl0_alias1="inet ...125.196  netmask"
> ifconfig_rl0_alias2="inet ...125.197  netmask"
> and so on.
> Now I got new block from isp: ...122.192/26 with gw ...122.193.
> So question is how to add ip's from this block to same server? With ipconfig
> etc. tools and with rc.conf?

It's not possible to have 2 default gateways.  That's not a FreeBSD thing,
it's a violation of the routing system.

If you want failover between two different gateways, you'll need to set
up BGP of some other routing control system to automatically adjust routes
as needed.  An explanation of BGP or any similar routing protocol is
beyond the scope of an email explanation - if that's what you need, I
suggest you look to or similar for research materials.

Bill Moran
Potential Technologies

More information about the freebsd-questions mailing list