这个东西必须学会,真他妈的搞死我了
2013.5.15
1. 环境:
ubuntu pc一台,两个网卡:
eth0:
ip 10.3.1.100
gateway 10.3.1.12
dns 10.3.1.2
eth1:
ip 192.168.1.3
设置windows pc:
ip 192.168.1.4
gateway 192.168.1.3
dns 10.3.1.2
这样,windows就可以上外网了
2013.5.15
2013.5.15
1. 环境:
ubuntu pc一台,两个网卡:
eth0:
ip 10.3.1.100
gateway 10.3.1.12
dns 10.3.1.2
eth1:
ip 192.168.1.3
windows pc一台,
ip 192.168.1.4
2. ubuntu pc的eth0可以访问外网,eth1与windows pc相连。
可以设置ubuntu pc:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 10.3.1.100
设置windows pc:
ip 192.168.1.4
gateway 192.168.1.3
dns 10.3.1.2
这样,windows就可以上外网了
2013.5.15