[patch] permit fib to be set on interface

Harald Schmalzbauer h.schmalzbauer at omnilan.de
Wed Dec 19 16:22:34 UTC 2012


 schrieb Alexander V. Chernikov am 08.05.2011 15:09 (localtime):
> At the moment the only possible way to set packet fib from userland is
> ipfw(8) setfib rule. Since no 'setfib tablearg' exists ruleset grows
> with every fib.
> Additionally, there is no way to set packet fib before netgraph
> processing: L2 ipfw hook is called after ng_ether_input()
>
> Those reasons (not mentioning kern/134931) makes it hard to use multiple
> routing tables.
>
> The following path:
> * adds SIOCGIFIB/SIOCSIFIB ioctl(2) calls to get/set per-interface fib
> * adds IFF_CUSTOMFIB interface flags
> * adds ifi_fib field to if_data structure
> * adds 'fib' keyword for ifconfig(8)
>
> Example:
> 16:42 [0] zfscurr0# ifconfig vlan2 create inet 10.11.12.13/30 fib 15
> vlan 2 vlandev em0
> 16:42 [0] zfscurr0# ifconfig vlan2
> vlan2: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,CUSTOMFIB>
> metric 0 mtu 1500 fib 15
>         options=3<RXCSUM,TXCSUM>
>         ether 08:00:27:c5:29:d4
>         inet 10.11.12.13 netmask 0xfffffffc broadcast 10.11.12.15
>         inet6 fe80::a00:27ff:fec5:29d4%vlan2 prefixlen 64 scopeid 0x4
>         nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
>         media: Ethernet autoselect (1000baseT <full-duplex>)
>         status: active
>         vlan: 2 parent interface: em0
>
>
> Interface fib is applied on inbound only (for forwarded packets fib
> decision should be done on inbound, for locally-originated packets there
> is setfib(1))

Could you please help me understanding the design?
If I have a multihomed machine, with fib0 defaultrouter via nic0 and
fib1 defaultrouter via nic1, and nic1 has fib1 assigned.
What should happen if I connect to any service, by default assigned to
fib0, but passing nic1?
The incoming packet will be tagged with "FIB1", right?
But does that affect the answer-path of services not assigned to fib1?
If not, why would I want incoming packates tagged?

Thanks,

-Harry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20121219/373a7445/attachment.sig>


More information about the freebsd-current mailing list