LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 919|回复: 1

如何共享长城宽带上网?

[复制链接]
发表于 2004-1-11 13:55:28 | 显示全部楼层 |阅读模式
长城宽带是用DHCP自动分配IP的。
如果是用windows的话,共享网卡就可以了。
现在想在局域网内用静态IP,然后共享长城宽带上网。
我用那个iptable脚本好象没用。
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE

请指教.
发表于 2004-1-11 14:48:39 | 显示全部楼层
set correct default gateway on the windows client (the internal IP address of the Linux NAT machine)

Internet --- (ext.IP) Linux NAT (int.IP) --- clients

to test, from the windows client:
ping client-self-ip  -> should be ok
ping int.IP  -> should be ok, otherwise, IP addresses are wrong or network is broken
ping ext.IP  -> should be ok, otherwise IP forwarding is wrong
ping www.google.com -> should be ok
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表