Here is an export of a working firewall
/ip firewall address-list
add address=192.168.88.0/24 disabled=no list=LocalNet
/ip firewall connection tracking
set enabled=yes generic-timeout=10m icmp-timeout=10s tcp-close-timeout=10s \
tcp-close-wait-timeout=10s tcp-established-timeout=1d tcp-fin-wait-timeout=\
10s tcp-last-ack-timeout=10s tcp-syn-received-timeout=5s \
tcp-syn-sent-timeout=5s tcp-syncookie=no tcp-time-wait-timeout=10s \
udp-stream-timeout=3m udp-timeout=10s
/ip firewall filter
add action=drop chain=input comment="Drop Invalid Input Connections" \
connection-state=invalid disabled=no
add action=drop chain=forward comment="Drop Invalid Forward/Through Router" \
connection-state=invalid disabled=no
add action=accept chain=input comment=\
"Local Administration of Router/New Input" disabled=no src-address-list=\
LocalNet
add action=accept chain=input comment="Establish New Connections At Router" \
connection-state=established disabled=no
add action=accept chain=input comment="Reply to Pings" disabled=no protocol=\
icmp
add action=accept chain=input comment=Winbox disabled=no dst-port=8291 \
protocol=tcp
add action=accept chain=input comment="VPN Port" disabled=no dst-port=1723 \
protocol=tcp
add action=accept chain=input comment="VPN Prot" disabled=no protocol=gre
add action=drop chain=input comment=\
"Drop Input AS it should have been allowed by now" disabled=no
add action=accept chain=forward comment="Allow LAN to Make New Connections" \
connection-state=new disabled=no src-address-list=LocalNet
add action=accept chain=forward comment="Allow Establish Connections" \
connection-state=established disabled=no
add action=accept chain=forward comment="Allow related Connections" \
connection-state=related disabled=no
add action=drop chain=forward comment=\
"Drop Anything else passing through the router" disabled=no out-interface=\
ether1-gateway
/ip firewall nat
add action=masquerade chain=srcnat comment="default configuration" disabled=no \
out-interface=ether1-gateway src-address-list=LocalNet
add action=dst-nat chain=dstnat comment=Ubnt1 disabled=no dst-port=5225 \
in-interface=ether1-gateway protocol=tcp to-addresses=192.168.88.21 \
to-ports=80
add action=dst-nat chain=dstnat comment=Ubnt2 disabled=no dst-port=5226 \
in-interface=ether1-gateway protocol=tcp to-addresses=192.168.88.22 \
to-ports=80
This firewall seems to work fine for everything I am doing.
I read RouterOS by example and my last firewall Filter rule is different. In my firewall it has an interface of my WAN Port. In the book there is no interface specified.
If I take the last line and change it to no interface…
add action=drop chain=forward comment=\
"Drop Anything else passing through the router" disabled=no
Then all my port forwards break.
Ideas?
Is there something wrong in my firewall?