Quote:
Originally posted by cranium2004
i am having a LAN which is connected to main proxy server ip 10.0.0.xxx through switch. In that LAN if i isolate a PC with single network with single PC with ip 192.168.1.192 and attach it to another computer which have 2 LAN cards in that LAN,eth0 is 10.0.0.199 and eth1 is 192.168.1.1 then can i access internet through that computer with ip 192.168.1.192?
|
You should add the following rules to PC1's iptables:
-t nat -A POSTROUTING -s 192.168.1.192 -o eth0 -j SNAT --to-source 10.0.0.199
-t filter -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-t fileter -A FORWARD -i eth1 -o eth0 -j ACCEPT
don't forget to run
echo 1 > /proc/sys/net/ipv4/ip_forward
I hope I didn't forget anything...
Hope this helps.