Routes for interface

Helge Oldach helge.oldach at atosorigin.com
Tue Apr 25 06:19:02 UTC 2006


Ludovit Koren:
>is there any possibility to set the routing statically on a multi-homed
>host so, that the packet is sent back via the same interface, as it has
>came from?

ipfw(4) is your friend, for example on a box with addresses
192.168.20.31 and 172.16.164.54 with respective gateways 192.168.21.254
and 172.16.164.1:

00100   31716   3368679 allow ip from 192.168.20.31 to 192.168.20.0/23
00200  671653  64044345 fwd 192.168.21.254 ip from 192.168.20.31 to any
00300   59889   3353166 allow ip from 172.16.164.54 to 172.16.164.0/22
00400     317     28628 fwd 172.16.164.1 ip from 172.16.164.54 to any
00500 7075682 948430737 allow ip from any to any
65535       0         0 deny ip from any to any

Helge


More information about the freebsd-net mailing list