Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Apr 2008 00:44:18 -0700
From:      Julian Elischer <julian@elischer.org>
To:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   multiple routing tables review patch ready for simple testing.
Message-ID:  <4816D1D2.7010603@elischer.org>

next in thread | raw e-mail | index | archive | help
The patch can be found at
  http://www.freebsd.org/~julian/mrt.diff
 (or http://www.freebsd.org/~julian/mrt6.diff for RELENG_6)
 
or source can be taken from perforce at:
 //depot/user/julian/routing/src

a kernel needs to be created with the option ROUTETABLES=N

e.g.
 +options                ROUTETABLES=2           # max 16. 1 is back 
compatible.

leaving this out will result in just a single routing table as per normal.

the max is 16 but I have an artificial (even lower) at 8 but that may
be gone by the time people try it :-)

I ws informed early in this project that kernel routing tables should
now be refered to as FIBs (forwarding Information base?).

the new command "setfib" sets teh default fib for a process and all its
decendents

The ipfw command has been enhanced with fib and setfib commands

netstat has been tweaked to cope with >1 table if used with setfib..

ipfw and setfib have man pages to look at.

e.g.
root@trafmon2:setfib -2 netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
127.0.0.1          127.0.0.1          UH          0        0    lo0
172.28.0.0/24      link#3             UC          0        0   fxp0
172.28.0.1         00:c0:9f:41:cd:3c  UHLW        1        0   fxp0   1189
172.28.10.0/24     link#2             UC          0        0   bge1

root@trafmon2:setfib -0 netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            172.28.0.1         UGS         0       20   fxp0
10.1.1.209         172.28.0.1         UGHS        0        0   fxp0
127.0.0.1          127.0.0.1          UH          0       20    lo0
172.28.0.0/24      link#3             UC          0        0   fxp0
172.28.0.1         00:c0:9f:41:cd:3c  UHLW        3        0   fxp0   1188
172.28.10.0/24     link#2             UC          0        0   bge1
root@trafmon2:

Currently it is IPV4 ONLY (other protocols will ignore the existance of 
other tables)
there are two new sysctls.

net.my_fibnum: 0
net.fibs: 3

Give it a test drive if you have any reason to want to do policy based 
routing or
have multiple ISPs for different workloads etc.

I'd like to get it out to a wider audience.

all comments welcome.

please read the file
 http://perforce.freebsd.org/fileViewer.cgi?FSPC=//depot/user/julian/routing/plan.txt&REV=5

for notes before using it.

Julian






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4816D1D2.7010603>