Requesting comments on Multi-routing table usage

Ian Smith smithi at
Sat Jul 19 03:39:51 UTC 2008

On Thu, 17 Jul 2008, Julian Elischer wrote:
 > Julian Elischer wrote:
 > > Ian Smith wrote:
 > >> On Thu, 17 Jul 2008, Julian Elischer wrote:
 > >>  > The current code in -current will add a new interface to all
 > >>  > FIBs.
 > >> Yes in addition to 'setfib N command' it would be likely useful to have
 > >> a more global 'setfibto' type command, so you could run whole scripts or
 > >> shells in a known fib context, to which scripts etc could be oblivious?
 > > 
 > > that's already possible with setfib..
 > > setfib N sh script is going to do that..

Yeah, guess I was thinking more of setting fixed FIB context 'from now
on' which I think your ifconfig solution below probably best addresses.

 > > The issue I have is with the routes that are added to routing tables
 > > when an interface is added.. It's a specific instance that is tricky
 > > because it's a side effect rather than a directly requested action.
 > > 
 > > what some people have asked to do is have multiple tunnels to the same 
 > > place but have different routing tables specify different tunnels to get 
 > > to that place..
 > > 
 > > e.g.
 > > 
 > > gre0
 > > gre1
 > > gre2
 > > 
 > > where in fib 0 the route to is via gre0
 > > and in fib1 it is via gre1
 > > and in fib2 it is via gre2
 > > then you can use setfib in ipfw and pf to use different tunnels to get
 > > selected traffic to
 > > 
 > > This is what is being asked for, but you can only add the
 > > interfaces like that if ifconfig only effects differnet FIBS for each
 > > interface.
 > hmmm that makes me think that maybe an ifconfig command to associate
 > a FIB with an interface might do the trick...
 > if it's not associated with a FIB it get to all of them, but if
 > you have previously associated it wit a FIB, then only that FIB is
 > affected.
 > That may just be a good enough answer.

Do you have some suggested syntax for the ifconfig command?

I may well just be blowing smoke here, and only lightly browsed this
stuff earlier (with interest) but I wonder whether a choice between all
FIBs and just one is too, well, binary for all possible situations, and
whether some situations might wish to refer to some set of FIBs?

And if so, rather than any complicated set manipulation, this could be
accomplished - if needed - by having a '-option' syntax as is common to
ifconfig arguments, to remove a particular FIB(s) from the ALL set?

Just till someone equipped with proper net-fu turns up to comment :)

cheers, Ian

More information about the freebsd-net mailing list