分类: 网络与安全
2006-11-19 00:35:08
#!/bin/sh wan="192.168.0.101" lan="192.168.1.0/24" proxyip="192.168.0.254" caskyip="192.168.0.1" ks="keep state" fsk="flags S keep state" cat > /etc/ipf.rules << EOF pass in quick on lo0 all pass out quick on lo0 all pass in log quick on lnc0 proto icmp from $caskyip to $wan icmp-type 8 $ks pass in log quick on lnc0 proto tcp from $caskyip to $wan port = 22 $fsk pass out log quick on lnc0 proto icmp from $wan to any icmp-type 8 $ks pass out log quick on lnc0 proto tcp from $proxyip to any port = 53 $fsk pass out log quick on lnc0 proto udp from $proxyip to any port = 53 $ks pass out log quick on lnc0 proto tcp from $proxyip to any port = 80 $fsk pass out log quick on lnc0 proto tcp from $wan to $caskyip port = 21 $fsk pass out log quick on lnc0 proto tcp from $wan to $caskyip port = 25 $fsk pass out log quick on lnc0 proto tcp from $wan to $caskyip port = 110 $fsk black out log quick on lnc0 all black in log quick on lnc0 all EOF |