Building a NAT router?

Nicholas Yau kpyau at ec-partners.com
Wed Sep 24 10:14:00 UTC 2003


Hey,

	What you need to do is write a script and run the script
in rc.local for startup

Let me give you some example, i think this will help you.

A proper configuration will look like below :

2 Network cards.

[192.168.1.1-eth0]<=connect to hub or crosslink to other pc=>PC
[                ]
[                ]
[                ]
[xx.xx.xx.xx-eth1]<=crosslink to DSL Modem=>[0000]


save this script in a file,
then run in rc.local

this command run where the remote pc and server are in same
subnet mask
if different subnet mask, you need to masquerade two different network
==================================================================

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -P POSTROUTING DROP
iptables -t nat -A POSTROUTING -s 192.168.1.0/24    -d 0.0.0.0/0 MASQUERADE
===================================================================





More information about the test mailing list