2 ISP routing FreeBSD 9.1

I've been looking around for a day + but I can't or don't have the full understanding to get this to work:

I have a FreeBSD 9.1 running mpd5.

em0 - 192.168.10.28
em1 - 10.40.0.2
default route = 192.168.10.1
setfib 1 route add default 10.40.0.1

I want to be able to
  1. Whatever packets comes in through em0 goes out em0 and same for em1
  2. Everything from 10.40.0.0/24 or em4 goes through em1 (10.40.0.2) gateway 10.40.0.1

There is mpd5 running for 2 interfaces em3 and em4.
em3 is running mpd5 NATted to various 10.x.x.x IPs using 192.168.1.28.
em4 is running mpd5 not natted and NATting is done upstream by a pfSense firewall.

setfib 1 netstat -rn shows correct gateway of 10.40.0.1.
setfib 1 traceroute <public ip> is ok.

How do I set it so that whatever is from the 10.40.0.0/24 network or em4 goes through em1? Is there a clear cut and simple way I can do this, a working sample configuration? I tried a few methods from searching (PF) and unable to get it to work. If there is a clear example it would be very good.

If this has been answered somewhere please do highlight to me. I haven't found a clear cut example yet. Thanks.
 
Back
Top