标签:
1.设置Linux内核支持ip数据包的转发
echo "1" > /proc/sys/net/ipv4/ip_forward
or
vi /etc/sysctl.conf net.ipv4.ip_forward=1
2.配置双IP
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.6.xx
netmask 255.255.255.0
gateway 192.168.6.1
dns-nameservers 8.8.8.8
auto eth0:0
iface eth0:0 inet static
address 10.2.0.1
netmask 255.255.255.0
3.添加IP伪装规则
iptables -t nat -A POSTOUTING -S 192.168.1.0/24 -O eth1 -j MASQUERADE
标签:
原文地址:http://www.cnblogs.com/zhangeamon/p/5662512.html