- 论坛徽章:
- 0
|
squid问题
SQUID配置后在客户机IE上设置代理可以上网。加了iptables后就无法上网了!
我在rc.d下面建了一个FIREWALL文件,并在rc.local设置让它开机运行
#!/bin/sh
echo "Enable IP Forwarding..."
echo "1">;/proc/sys/net/ipv4/ip_forward
echo "Starting iptables rules..."
/sbin/modprobe iptable_filter
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
#Refresh all chains
/sbin/iptables -F -t nat
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to 172.16.1.1
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
其中,eth1是内部网卡,eth0是外部网卡 |
|