I have 2 computers.
One is connecting to the internet through gate 192.168.1.1.
It is also supposed to forward connection to and from the second computer.
I wanted all interfaces to have IP starting with 192.168.1.
Ideally like this:
PC0 PC1 PC2
gate eth0 eth1 eth0
192.168.1.1 192.168.1.31 192.168.1.32 192.168.1.33
I used the following commands to do this.
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.33 -j SNAT --to 192.168.1.31
unfortunately it doesn't work.
I know that when I change:
192.168.1.32 in to 192.168.0.32
and
192.168.1.33 in to 192.168.0.33
routing is just fine
Is there any way to have all IP starting with 192.168.1. ??? (the gateway accepts only this kind of IP)
Otherwise I have to change IP of the second computer when I connect to the gateway directly or when I run WindowXP on the PC1 which is using bridging for sharing connection.
Andrzej