|
发表于 2005-1-27 11:05:19
|
显示全部楼层
iptables部分:
在/etc/init.d目录下建立了firewall文件,然后在/etc/init.d/boot.local中加入内容如下:
#!/bin/sh
echo "Enabling IP Forwarding..."
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "Starting iptables rules..."
#Refresh all chains
/usr/sbin/iptables -F -t filter
/usr/sbin/iptables -F -t nat
#############Define packets from Internet server to Intranet#######################
iptables -A FORWARD -p tcp -s 0/0 --sport ftp-data -d 198.168.0.1/24 -i eth0 -j ACCEPT
iptables -A FORWARD -p udp -d 198.168.0.1/24 -i eth0 -j ACCEPT
#############Define packets from Intranet to Internet###############
iptables -A FORWARD -s 198.168.0.1/24 -i eth0 -j ACCEPT
#################################Define Proxy rule##################################
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.0.1/24 -o ppp0 -j MASQUERADE
保存退出。 |
|