Using FreeBSD as a router

Josh Paetzel josh at tcbug.org
Wed Aug 22 07:03:17 PDT 2007


Steffen Schumacher wrote:
> On 22.08.2007 12:30:54 +0100, Tom Judge wrote:
> > Steffen Schumacher wrote:
> > 
> > Firstly this address is not a valid host address it is a network address. 
> > as shown by the routing entry below.  Secondly your default gateway must be 
> > on your local network segment to work however 195.249.0/16 is behind the 
> > router 131.164.191.1.
> > 
> > 195.249.0/16       131.164.191.1      UG1         1       12  vlan7
> > 
> > Perhaps your default gateway should be 131.164.191.1 ??
> >
> 
> Yes - ultimately that should be my gateway, but I want FreeBSD to realize
> this by looking at the 195.249.0/16 route.
> The thing is that 195.249.0/16 will also be seen from 131.164.191.2 but with
> a lower localpref, making 131.164.191.1 the best choice. This way if .1 dies,
> 195.249.0/16 should be routed towards .2, and ultimately my default should go
> at .2 also.
> This is the goal - to make the default move to .2 if .1 is dead, and back when
> 1. comes back up again.
> 
> I don't think it matters if I use 195.249.0.0 or 195.249.1.1, since the router
> receiving the packets will do their own routing lookup. Whats important is only
> getting the next-hop mac/if for the default route, and that should be available
> from the 195.249.0/16 route.
> 
> /Steffen 

"You keep using that word. I do not think it means what you think it
means."

In FreeBSD the default route is a directly connected host that it can
send packets to that it doesn't have a specific route to.  It's not
going to 'figure out' a default route from a network address.

There are a lot of hacks people use to get around this, some of the
are of the 'ping this ip periodically and if it goes away swap the
default route' nature.

You could also investigate running CARP/HSRP/VRRP/GLBP  on these two gateways 
so they can sit on the same IP, thus obliviating the need to change
the default route at all.

I've never actually tried getting FBSD to grap it's own routing
information from a routing protocol but it's possible you could go
down that route as well...

-- 
Thanks,

Josh Paetzel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-isp/attachments/20070822/56534ece/attachment.pgp


More information about the freebsd-isp mailing list