ipfw gateway rerouting

Michael Sierchio kudzu at tenebras.com
Mon Aug 19 13:15:22 UTC 2013

# my kernel has
# options         ROUTETABLES=16


setfib 0 route add default $GATEWAY_0
setfib 1 route add default $GATEWAY_1

ipfw table 1 add $NET_0 0
ipfw table 1 add $NET_1 0
ipfw table 1 add $NET_2 1
ipfw table 1 add $NET_3 0

ipfw add 00500 setfib tablearg ip from any to any in lookup src-ip 1

rule 500 will cause traffic from NET_2 to go out a different gateway (if
it's not destined for a local net - presumably other rules will handle
those cases)

# man setfib
# man ipfw (see the section on the setfib action)

On Sun, Aug 18, 2013 at 3:15 PM, Jos Chrispijn <kernel at webrz.net> wrote:

> Can someone please hint me to to good explanatory site that explains how
> to reroute a network server to different/non standard network gateway(s)
> with ipfw?
> thanks,
> Jos Chrispijn
> ______________________________**_________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/**mailman/listinfo/freebsd-**questions<http://lists.freebsd.org/mailman/listinfo/freebsd-questions>
> To unsubscribe, send any mail to "freebsd-questions-**
> unsubscribe at freebsd.org <freebsd-questions-unsubscribe at freebsd.org>"

More information about the freebsd-questions mailing list