# Policy based routing & GW on same subnet



## makz (Dec 21, 2016)

Hello,

I've a problem with a pfSense 2.3.2P1, unfortunately, I've already asked to pfSense forum and mailing list but nobody can explain me why it's not working, all responses I got is "it's not working". But we really need this setup, it's a common setup in enterprise and with a Linux it's easy to configure this kind of setup.

So I ask here because I can't tell if it's a pfSense or FreeBSD issue.

I have multiple gateway, two of them are in the same subnet / interface (my default 192.168.0.5 and my second one 192.168.0.1)

I create a rule matching on source and route the traffic to my second gateway. (the rule match properly)
But the traffic is always routed to my default gateway.

If I set another gateway which is on a different subnet, the traffic is properly routed to the other gateway.

I've tried on different subnet, different interfaces, it looks like BSD routes the traffic to the latest added gateway when there are multiple gateway on a same subnet.

Is it a BSD or pfSense issue ?

I hope someone will be able to help me 

Thank you.

Have a good day !


----------



## tingo (Dec 21, 2016)

the output of `netstat -r` might enlighten you (and others).


----------

