Using multiple routing tables and rc.conf

Robert Blacquiere freebsd-net at blacquiere.nl
Tue May 26 12:46:01 UTC 2009


Hi,

I'me testing a network setup using multiple routing tables. I want to
use this to setup different gateways. Some basic design is this:

The system has two different uplinks (fast and slow for backup). 
And somewhere on the internet a colo with a full internet address range. 
I have setup the system with 2 giftunnels and use ospf over these for
the internet range. This seems to be working. 

I want this to be configured with settings in rc.conf but failed to find
the magic to do things like: 

setfib 0 ifconfig gif0 create 172.16.0.1 172.16.0.2 netmask
255.255.255.255 tunnel $extern_fast $colo

I know setfib is not needed for the default routing table.

setfib 1 ifconfig gif1 create 172.16.0.3 172.16.0.4 netmask
255.255.255.255 tunnel $extern_slow $colo


and the routes:

route add default $gateway_fast

setfib 1 route add default $gateway_slow


and use a third routing table for the ospf routing and pf to route
traffic using the ospf announced routes.


How would this be fitted in the rc.conf? 

for normal giftunnels i would use some thing like:

gif_interfaces="gif0 gif1"
gifconfig_gif0="$extern_fast $colo"
ifconfig_gif0="inet 172.16.0.1 172.16.0.2 netmask 255.255.255.255"
gifconfig_gif1="$extern_slow $colo"
ifconfig_gif1="inet 172.16.0.3 172.16.0.4 netmask 255.255.255.255"

But this won't include the setfib. For jails there is a setfib command
using jail_<jname>_fib. I would like some thing like that also for 
routes, interfaces and deamons to start. 

I know i could set these things in a rc.local but would rather use
rc.conf for configuration. Did any of you guys done something like this? 

Regards

Robert



More information about the freebsd-net mailing list