Доброго времени суток !
Помогите начинающему администратору.
Возникла проблема при конфигурировании ipfw.
Для конфигурирования, как заготовку взял rc.firewall.
Когда пишу правила типа:
[Oo][Pp][Ee][Nn]|[Cc][Ll][Ii][Ee][Nn][Tt])
case ${natd_enable} in
[Yy][Ee][Ss])
if [ -n "${natd_interface}" ]; then
${fwcmd} add 60 divert natd all from any to any via ${natd_interface}
fi
;;
esac
esac
case ${firewall_type} in
[Oo][Pp][Ee][Nn])
setup_loopback
${fwcmd} add 00010 fwd 127.0.0.1,3128 tcp from 192.168.1.0/24 to any 80,3128 in via rl1
${fwcmd} add 00020 pass tcp from 192.168.1.0/24 to me 3128 in via rl1
any
${fwcmd} add 65000 allow all from any to any
;;
Все работает, пользователи работают в Интернет через сквид, все довольны и счастливы.
При правилах типа:
[Ss][Ii][Mm][Pp][Ll][Ee])
# set these to your outside interface network and netmask and ip
oif="rl0"
onet="xxx.xxx.xxx.0"
omask="255.255.255.252"
oip="xxx.xxx.xxx.54"
# set these to your inside interface network and netmask and ip
iif="rl1"
inet="192.168.1.0"
imask="255.255.255.0"
iip="192.168.1.2"
#setup_loopback
${fwcmd} add allow all from any to any via lo0
# deny icmp atack
${fwcmd} add deny icmp from any to any in icmptupe 5,9,13,14,15,16,17
# Stop spoofing
${fwcmd} add deny all from ${inet}:${imask} to any in via ${oif}
${fwcmd} add deny all from ${onet}:${omask} to any in via ${iif}
# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from any to 10.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 172.16.0.0/12 via ${oif}
${fwcmd} add deny all from any to 192.168.0.0/16 via ${oif}
# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from any to 0.0.0.0/8 via ${oif}
${fwcmd} add deny all from any to 169.254.0.0/16 via ${oif}
${fwcmd} add deny all from any to 192.0.2.0/24 via ${oif}
${fwcmd} add deny all from any to 224.0.0.0/4 via ${oif}
${fwcmd} add deny all from any to 240.0.0.0/4 via ${oif}
${fwcmd} add allow tcp from me to any http,https
${fwcmd} add allow tcp from any http,https to me
${fwcmd} add allow icmp from any to any
${fwcmd} add allow udp from any to me domain
${fwcmd} add allow ip from me to any
# open smtp
${fwcmd} add allow tcp from any to ${inet}:${imask} smtp
${fwcmd} add allow tcp from any smtp to ${inet}:${imask}
# open pop3
${fwcmd} add allow tcp from any to ${inet}:${imask} 110
${fwcmd} add allow tcp from any 110 to ${inet}:${imask}
# forward to SQUID
${fwcmd} add fwd 127.0.0.1,3128 tcp from ${inet}:${imask} to any 80 in via ${iif}
# NATD
${fwcmd} add divert natd all from any to any via ${oif}
# Stop RFC1918 nets on the outside interface
${fwcmd} add deny all from 10.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 172.16.0.0/12 to any via ${oif}
${fwcmd} add deny all from 192.168.0.0/16 to any via ${oif}
# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
# on the outside interface
${fwcmd} add deny all from 0.0.0.0/8 to any via ${oif}
${fwcmd} add deny all from 169.254.0.0/16 to any via ${oif}
${fwcmd} add deny all from 192.0.2.0/24 to any via ${oif}
${fwcmd} add deny all from 224.0.0.0/4 to any via ${oif}
${fwcmd} add deny all from 240.0.0.0/4 to any via ${oif}
Подскажите подалуйста, что не так в этом конфиге.
Правило 65535 deny all from any to any.