LinuxSir.cn,穿越时空的Linuxsir!

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

iptables限制用户上网,请高手帮忙!!

[复制链接]
发表于 2003-6-9 00:10:57 | 显示全部楼层 |阅读模式
我想限制某用户只能上www.163.com和www.yahoo.com.cn, ... 用以下策略:
iptables -F
iptables -t nat -F
iptables -P FORWARD DROP
iptables -t nat -A POSTROUTING -s 192.168.8.0/24 -SNAT --to 202.102.11.1
iptables -A FORWARD -s 192.168.8.160 -d www.163.com -j ACCEPT
iptables -A FORWARD -s 192.168.8.160 -d www.yahoo.com.cn -j ACCEPT
其中(192.168.8.0/24是内网网段,192.168.8.160是要限制上网的电脑的ip地址,202.102.11.1是外网卡地址)
发表于 2003-6-9 14:57:44 | 显示全部楼层
如果你要做限制,推荐使用SQUID,不然IPTABLES的设置会比较麻烦。
参考一下这里:
http://network.ccidnet.com/pub/d ... p;pageNO=1#b1555424
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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