|
我想限制某用户只能上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是外网卡地址) |
|