Hey,
I am having a problem with my network interfaces routing and I hoped you may help me to solve this problem. (also this forum seems the most appropriate so I hope its the right one)
0) I am running Fedora 8 my kernel version is: 2.6.23.1-42.fc8
1) I have 2 network interfaces: one
(eth0) is bound to 192.168.0.1 and the other
(eth0:1) to 192.168.0.2
*) eth0:0 is newly created
2) on 192.168.0.10 I have a PHP page which would show you the ip you are connecting with ($_SERVER['REMOTE_ADDR'])
I can use ssh dynamic port forwarding connecting to the machine like this:
Code:
ssh -N -D 1234 root@192.168.0.1
and when I use that connection and query the page on
192.168.0.10 I do get the
192.168.0.1 as expected
however when I try to dynamic port forwarding on the second interface like this:
Code:
ssh -N -D 1234 root@192.168.0.2
the connection is made but when I query the page on
192.168.0.10 I get the same result:
192.168.0.1
where have I gone wrong?
Note: by googling it I found that you can also use iptables to re-write the source IP address so it will result in the same effect.
so I tried it, but with no effect:
Code:
iptables -t nat -I POSTROUTING -p tcp --dport 80 -s 192.168.0.1 -j SNAT --to 192.168.0.2
Thanks in advance