Hello All,<br><br>I am trying to setup a linux box as a forwarding router based of src IP. The problem is that it does forward the pkts to the intended server specified in the ip rule, but it also forwards it to the original dst (dst specified in the pkt).
<br><br><br>Here is the setup:<br><br>[<a href="http://10.1.0.166">10.1.0.166</a>]
[<a href="http://192.168.1.225">192.168.1.225</a>]<br> |
|<br> | [A]
[B] |<br> |-------[<a href="http://10.1.0.63/172.16.1.63">10.1.0.63/172.16.1.63</a>] ----------- [<a href="http://172.16.1.64/192.168.1.65">172.16.1.64/192.168.1.65</a>] ---------|
<br> | linux box only has linux-router in question | <br> | net.ipv4.ip_forward=1 | <br> | |
<br>[<a href="http://10.1.0.167">10.1.0.167</a>] [<a href="http://192.168.1.100">192.168.1.100</a>]<br><br><br>A - is just a linux box doing forwarding for the 2 networks
10.1.x.x - > 172.16.1.x.<br>B - is the linux router which I want to setup as forwarding.<br><br>The pkts come from <a href="http://10.1.0.166">10.1.0.166</a> and .167 -> to <a href="http://192.168.1.100">192.168.1.100
</a><br>I want to setup rules on [B] to forward all pkts with src addr. <a href="http://10.1.0.166">10.1.0.166</a> to <a href="http://192.168.1.225">192.168.1.225</a>.<br>And, all pkts from <a href="http://10.1.0.167">10.1.0.167
</a> to <a href="http://192.168.1.100">192.168.1.100</a> should still go to <a href="http://192.168.1.100">192.168.1.100</a>.<br><br>Here are the rules I setup.<br><br>[root@forwarder ~]# ip rule sh<br>0: from all lookup local
<br>32765: from <a href="http://10.1.0.166">10.1.0.166</a> lookup 225<br>32766: from all lookup main<br>32767: from all lookup default<br><br>[root@forwarder ~]# ip ro sh tab 225<br><a href="http://192.168.1.0/24">192.168.1.0/24
</a> via <a href="http://192.168.1.225">192.168.1.225</a> dev eth1<br><br>The pkts still go to both .225 and .100. I checked on another machine connected to the same switch as <a href="http://192.168.1.100">192.168.1.100</a>
and <a href="http://192.168.1.225">192.168.1.225</a> and its not receiving the pkts. So, it doesnt seem like the switch is screwing up and broadcasting the packets everywhere.<br><br>I would appreciate any kind of help or pointers.
<br><br>Thanks for your time.<br><br>-- pranav<br><br>------------------------------<br><a href="http://pd.dnsalias.org">http://pd.dnsalias.org</a>