拥有两个网卡, eth0, eth1, eth0连接外网, eth1连接内网
开启转发功能
编辑 /etc/sysctl.conf
net.ipv4.ip_forward=1
配置iptebles
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT