Redundant gateway with OSPF

Colin Petrie colin at
Fri Nov 3 14:08:23 UTC 2006

Hi all,

Can anyone give me some advice on an issue I'm having?

I have 2 FreeBSD 6.1-RELEASE routers connected to an OSPF area, and want 
them to provide a redundant gateway to a subnet. Here is a badly drawn 

|   OSPF area     |
    |          |
/----\      /----\
| r1 |      | r2 |
\----/      \----/
    |          |
|    switch     |
    |  |   |   |

I am investigating various techniques for providing a redundant gateway 
for the hosts on the switch. Initially I started looking at FreeVRRPd 
from the ports collection, but came across an issue.

Assuming I wanted the 2 routers to be and, and want to provide as the network 
default gateway.

However because the routers can see each other via OSPF and are 
redistributing connected interfaces, when I add to r1, 
i then cannot add to r2 because r2 now has a route to installed in its routing table, with a gateway of r1.

What I want is for both routers to be on the /24 with different IPs, and 
for only the one which VRRP has decided has the gateway address to be 
advertising the route to the rest of the network.

I would also be interested in getting rid of the requirement for both 
routers to use IPs on the subnet, ideally only the one which is 
currently the gateway should be using any IPs at all, but the only way i 
can see of doing this is with the carpdev functionality in OpenBSD.

I don't think I can tell OSPF not to distribute the /24 because I do 
want it distributed, but only by the router which is currently the 
master. Would this need to be done using the 'masterscript' and 
'backupscript' options in freevrrpd?

For info, i am using quagga 0.99.5 for the ospf stuff.

Can anyone suggest a way of doing this? I've looked at freevrrpd and 
carp so far but if there's something that can avoid installing a route 
into the kernel for the /24 until the router in question is actually the 
master in the pair, i would appreciate being pointed in the right direction.

Hoping someone can point me in the right direction :)


Colin P

More information about the freebsd-net mailing list