Hello everyone
So I made firewall rules that work so I asked someone to make a little comment and give any advice on how to better optimize the rules.
wlan1 - outIF / natif - 10.55.x.x/24
wlan0 - localIF - 10.42.1.x/24
10.42.1.14 via nat
ssh, dns, www, irc (and others from rule below) ports must be available through wlan0 and wlan1
So I made firewall rules that work so I asked someone to make a little comment and give any advice on how to better optimize the rules.
wlan1 - outIF / natif - 10.55.x.x/24
wlan0 - localIF - 10.42.1.x/24
10.42.1.14 via nat
ssh, dns, www, irc (and others from rule below) ports must be available through wlan0 and wlan1
Code:
fwcmd="ipfw -q"
natif=wlan1
inif=wlan0
$fwcmd -f flush
$fwcmd add 50 divert natd ip4 from any to me via $natif
$fwcmd add 55 check-state
$fwcmd add 100 pass all from any to any via lo0
$fwcmd add 110 deny all from any to 127.0.0.0/8
$fwcmd add 120 deny ip from 127.0.0.0/8 to any
$fwcmd add 130 deny all from any to ::1
$fwcmd add 140 deny all from ::1 to any
# DAD
$fwcmd add 150 pass ipv6-icmp from :: to ff02::/16
# RS, RA, NS, NA, redirect...
$fwcmd add 160 pass ipv6-icmp from fe80::/10 to fe80::/10
$fwcmd add 170 pass ipv6-icmp from fe80::/10 to ff02::/16
# Allow ICMPv6 destination unreach
$fwcmd add 180 pass ipv6-icmp from any to any icmp6types 1
# Allow NS/NA/toobig (don't filter it out)
$fwcmd add 190 pass ipv6-icmp from any to any icmp6types 2,135,136
$fwcmd add 195 deny all from any to any frag
$fwcmd add 200 pass tcp from any to me 22,80,411,5222,6667,6697,7000,9091
$fwcmd add 210 pass udp from any to me 53 in
$fwcmd add 211 pass tcp from any to me 53 in
$fwcmd add 220 pass icmp from any to me in
$fwcmd add 230 pass all from me to any out keep-state
$fwcmd add 4100 deny all from any to any
$fwcmd add 04000 skipto 61000 ip from 10.42.1.14 to any in via $inif keep-state
$fwcmd add 04001 skipto 61001 ip from 10.42.1.11 to any in via $inif keep-state
$fwcmd add 61000 divert natd ip4 from 10.42.1.14 to any out via $natif
$fwcmd add 61001 divert natd ip4 from 10.42.1.11 to any out via $natif
$fwcmd add 65000 pass all from any to any