Очередная редакция правил,
Есть паравопросов по составлению:
1) правило №19:
# ip-session limit
#add 19 allow ip from any to any setup limit src-addr 10
скорее всего не правильно, как работает настройка ограничений по ИП сесиям?
2)правила №№30-31 -- не могу заставить работать привязку по МАК
3)что означает переменная me? Правильно ли я её использую?
4)Когда надо задовать НАТ, меняет ли пакет (а точнее то как видит его фаервол) свой ИП после прохождения НАТа?Вот мой список правил (версия 0 alpha):
rc.firewall.myconf
#=====Firewall Configuration
#var
inthost="192.168.1.1"
macint="00:8E:48:38:AA:3D"
intnet="192.168.1.0/29"
outhost="10.15.4.8"
admcomp="192.168.1.5"
macadm="00:B0:18:99:7A:11"
outinterface="rl0"
intinterface="rl1"
#Rules Begin
#antihack
#No Fragmentation
add 10 deny ip from any to any frag
#Deny ISMP hack
add 11 deny icmp from any to any in icmptype 5,9,13,14,15,16,17
#Deny interip mask hack
add 12 reject ip from ${intnet} to any in via ${outinterface}
# Deny X-scaning
add 13 reject tcp from any to any tcpflags fin, syn, rst, psh, ack, urg
# Deny N-scaning
add 14 reject tcp from any to any tcpflags !'fin', !'syn', !'rst', !'psh', !'ack', !'urg'
# Deny FIN-scaning
add 15 reject tcp from any to any not established tcpflags fin
# Prevent from spoofing
add 16 deny ip from any to any not verrevpath in
add 17 deny ip from ${intnet} to any in via ${outinterface}
add 18 deny ip from ${outhost} to any via ${intinterface}
# ip-session limit
#add 19 allow ip from any to any setup limit src-addr 10
#Deny loop back external acces
add 20 deny all from any to 127.0.0.0/8
add 21 deny all from 127.0.0.0/8 to any
add 22 deny all from any to 127.0.0.0/8
add 23 deny all from 127.0.0.0/8 to any
#Deny Windows flood
add 24 deny ip from ${intnet} to ${intnet} 135,137-139,445 in via ${intinterface}
add 25 deny ip from any to ${outhost} 135,137-139,445 in via ${outinterface}
#SSH
add 30 allow tcp from ${admcomp} to ${inthost} 22 in via ${intinterface} mac ${macadm} ${macint}
add 31 allow tcp from ${inthost} 22 to ${admcomp} out via ${intinterface} mac ${macint} ${macadm}
add 32 deny tcp from any to ${inthost},${outhost} 22
#dynamic on
add 40 check-state
#ICMP
add 50 deny icmp from any to any via ${outinterface}
#HTTP/HTTPS/FTP
add 60 allow tcp from me to not ${intnet} 20,21,80,8080,443 keep-state via ${outinterface}
add 61 allow tcp from not ${intnet} 20,21,80,8080,443 to me via ${outinterface}
add 62 allow upd from me to not ${intnet} 20,21 keep-state via ${outinterface}
add 63 allow upd from not ${intnet} 20,21 to me via ${outinterface}
#NAT
add 70 nat ip from ${intnet} to not ${intnet} out via ${outinterface}
#inter comps
add 1000 allow ip from ${admcomp} to not ${intnet} via ${intinterface}
add 1001 allow ip from 192.168.1.3 to not ${intnet} via ${intinterface}
#Deny any all
add 10000 deny all from any to any via ${outinterface}
add 10001 deny all from any to any via ${intinterface}
#Rules END
Пока не разобрался c TTL, какего менять используя IPFW?