您的位置:首页 > 其它

最丑的DEBIAN双网卡共享上网设置

2005-07-28 23:27 459 查看
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

5./etc/init.d/inetd restart 或者重新启动计算机。

双网卡就可以用了。呵呵。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: