Owen的酒楼

--酒楼上渡过的人生--
生命太短,人生太长,但愿别喝醉了。

导航

Debian 下双网卡共享上网设置 ZT

Posted on 2007-12-17 14:07  Hicome  阅读(1450)  评论(2编辑  收藏  举报

1.  首先在/etc/network/interfaces里加入下面的内容;这里eth0与外网连,eth1与内网连。

 

auto lo eth0 eth1
iface lo inet loopback
iface eth0 inet dhcp
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
 

2.  echo "1" > /proc/sys/net/ipv4/ip_forward
或修改/etc/sysctl.conf,加上
net.ipv4.ip_forward = 1

3.  iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

4.  /etc/init.d/inetd restart 或者重新启动计算机。
双网卡就可以用了