Posts Tagged ‘iptables’

用iptables实现NAT方式上网

Posted in Linux on 1月 10th, 2010 by 飘(piao2010) – 3 Comments

在学校用了两年多的代理上网(Linux+OpenVPN+Squid),由于代理服务器(个人猜测应该是位于校园网DMZ)和寝室属于不同网络,一直没办法实现NAT方式上网。下午尝试着在VPN接入服务器的基础上进行NAT测试,但是失败了,如果在正常的网络环境中应该是比较容易实现的。以下部分开始转载:(根据自己的理解添加了中文注释)

This tutorial shows how to set up network-address-translation (NAT) on a Linux system with iptables rules so that the system can act as a gateway and provide internet access to multiple hosts on a local network using a single public IP address. This is achieved by rewriting the source and/or destination addresses of IP packets as they pass through the NAT system.
read more »