Firewall Genius

Firewall geniuses .. does this script appear to be acceptable in a small LAN configuration?
I’ve only been working on it for a month (yes, I am slow, while you are smart). My eyeballs
have crusted over from looking at the wiki. I need simple, effective, but not overkill in my environment.

Bottom line, will this suffice in a small office with one WAN and 8 PC’s?

Flags: X - disabled, I - invalid, D - dynamic
0 D ;;; special dummy rule to show fasttrack counters
chain=forward
1 ;;; Accept Established / Related Input
chain=input connection-state=established,related
2 ;;; Allow Management Input - 192.168.88.0/24
chain=input src-address=192.168.88.0/24
3 ;;; allow l2tp
chain=input action=accept protocol=udp dst-port=1701
4 ;;; allow pptp
chain=input action=accept protocol=tcp dst-port=1723
5 ;;; allow sstp
chain=input action=accept protocol=tcp dst-port=443
6 ;;; Drop Input
chain=input action=drop log-prefix=“Input Drop”
7 ;;; FastTrack Established / Related Forward
chain=forward action=fasttrack-connection connection-state=established,related
8 ;;; Accept Established / Related Forward
chain=forward connection-state=established,related
9 ;;; Allow forward traffic LAN >> WAN
chain=forward src-address=192.168.88.0/24 out-interface=ether1-gateway
10 ;;; Drop Bogon Forward >> Ether1
chain=forward action=drop src-address-list=Bogon in-interface=ether1-gateway log=yes
log-prefix=“Bogon Forward Drop”
11 ;;; Drop Forward
chain=forward action=drop
12 chain=input action=drop protocol=tcp in-interface=ether1-gateway dst-port=53 log=no log-prefix=“”
13 chain=input action=drop protocol=udp in-interface=ether1-gateway dst-port=53 log=no log-prefix=“”

Rules 10, 12,13 are useless since traffic can be dropped by “drop” rules 6 and 11

Send export instead print.

I thank you, and I have disabled them. Please see attached image. Will this script prevent inbound DNS requests?
Or do I need to make an adjustment?
dns.PNG

Here it is.

\

sep/13/2016 10:17:29 by RouterOS 6.36.3

/ip firewall address-list
add address=192.168.88.0/24 list=support
add address=192.168.0.0/16 list=Bogon
add address=10.0.0.0/8 list=Bogon
add address=172.16.0.0/12 list=Bogon
add address=127.0.0.0/8 list=Bogon
add address=0.0.0.0/8 list=Bogon
add address=169.254.0.0/16 list=Bogon
/ip firewall filter
add chain=input comment=“Accept Established / Related Input” connection-state=established,related
add chain=input comment=“Allow Management Input - 192.168.88.0/24” src-address=192.168.88.0/24
add action=accept chain=input comment=“allow l2tp” dst-port=1701 protocol=udp
add action=accept chain=input comment=“allow pptp” dst-port=1723 protocol=tcp
add action=accept chain=input comment=“allow sstp” dst-port=443 protocol=tcp
add action=drop chain=input comment=“Drop Input” log-prefix=“Input Drop”
add action=fasttrack-connection chain=forward comment=“FastTrack Established / Related Forward”
connection-state=established,related
add chain=forward comment=“Accept Established / Related Forward” connection-state=established,related
add chain=forward comment=“Allow forward traffic LAN >> WAN” out-interface=ether1-gateway src-address=
192.168.88.0/24
add action=drop chain=forward comment=“Drop Bogon Forward >> Ether1” disabled=yes in-interface=ether1-gateway
log=yes log-prefix=“Bogon Forward Drop” src-address-list=Bogon
add action=drop chain=forward comment=“Drop Forward”
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether1-gateway protocol=tcp
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether1-gateway protocol=udp
/ip firewall nat
add action=masquerade chain=srcnat comment=“default configuration” out-interface=ether1-gateway
add action=masquerade chain=srcnat comment=“masq. vpn traffic” src-address=192.168.89.0/24
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set sctp disabled=yes

/ip firewall filter
add chain=input comment=“Accept Established / Related Input” connection-state=established,related
add chain=input comment=“Allow Management Input - 192.168.88.0/24” src-address=192.168.88.0/24
add action=accept chain=input comment=“allow l2tp” dst-port=1701 protocol=udp
add action=accept chain=input comment=“allow pptp” dst-port=1723 protocol=tcp
add action=accept chain=input comment=“allow sstp” dst-port=443 protocol=tcp
add action=accept chain=input comment=“allow sstp,pptp” dst-port=443,1723 protocol=tcp
add action=drop chain=input comment=“Drop Input” log-prefix=“Input Drop”
add action=fasttrack-connection chain=forward comment=“FastTrack Established / Related Forward”
connection-state=established,related
add chain=forward comment=“Accept Established / Related Forward” connection-state=established,related
add chain=forward comment=“Allow forward traffic LAN >> WAN” out-interface=ether1-gateway src-address=
192.168.88.0/24
add action=drop chain=forward comment=“Drop Bogon Forward >> Ether1” disabled=yes in-interface=ether1-gateway
log=yes log-prefix=“Bogon Forward Drop” src-address-list=Bogon
add action=drop chain=forward comment=“Drop Forward”
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether1-gateway protocol=tcp
add action=drop chain=input disabled=yes dst-port=53 in-interface=ether1-gateway protocol=udp

remove
add
remove as useless

I suggest to use other port than 443 for sstp - for example 444 - and keep 443 for ssl web management instead port 80.
Anyway, better to use l2tp instead sstp, as the sstp is tcp and l2tp is udp, thus much faster.

I’d leave out the fast track unless you really need it.

Here is the result of most of your recommendations, except sstp port change which I will do.
Kindly review for any mistakes I may have made in hierarchy of rules.

/ip firewall address-list
add address=192.168.88.0/24 list=support
add address=192.168.0.0/16 list=Bogon
add address=10.0.0.0/8 list=Bogon
add address=172.16.0.0/12 list=Bogon
add address=127.0.0.0/8 list=Bogon
add address=0.0.0.0/8 list=Bogon
add address=169.254.0.0/16 list=Bogon
/ip firewall filter
add chain=input comment=“Accept Established / Related Input” connection-state=established,related
add chain=input comment=“Allow Management Input - 192.168.88.0/24” src-address=192.168.88.0/24
add action=accept chain=input comment=“allow l2tp” dst-port=1701 protocol=udp
add action=accept chain=input comment=“allow sstp,pptp” dst-port=443,1723 protocol=tcp
add action=drop chain=input comment=“Drop Input” log-prefix=“Input Drop”
add action=fasttrack-connection chain=forward comment=“FastTrack Established / Related Forward”
connection-state=established,related
add chain=forward comment=“Accept Established / Related Forward” connection-state=established,related
add chain=forward comment=“Allow forward traffic LAN >> WAN” out-interface=ether1-gateway src-address=
192.168.88.0/24
add action=drop chain=forward comment=“Drop Forward”
/ip firewall nat
add action=masquerade chain=srcnat comment=“default configuration” out-interface=ether1-gateway
add action=masquerade chain=srcnat comment=“masq. vpn traffic” src-address=192.168.89.0/24
/ip firewall service-port
set ftp disabled=yes
set tftp disabled=yes
set irc disabled=yes
set h323 disabled=yes
set sip disabled=yes
set pptp disabled=yes
set sctp disabled=yes


Thank you in advance,
Jim

Howdy all, I have been sharpening my skills on the firewall filter rules, and would like your opinion of the following rules. I have a situation whereby Windows 10 firewalls are standing in the way of very expensive software for 3D scanning and we need to disable it for it to function properly. Is there a way to block out the world, and run without local Windows firewalls with filter rules you see below? Thanks in advance. - Jim


/ip pool
remove vpn
add name=vpn ranges=192.168.89.2-192.168.89.254
/ip address
remove numbers=0
add address=192.168.88.1/24 comment=LAN interface=LAN
network=192.168.88.0
/ip firewall filter
remove numbers=0
add action=accept chain=input comment=“allow l2tp” dst-port=1701 protocol=tcp
add chain=forward comment=“Allow forward traffic VPN >> WAN” out-interface=
WAN src-address=192.168.89.0/24
add action=drop chain=input comment=Block_Attacks_SSH dst-port=12022
in-interface=WAN protocol=tcp src-address-list=ssh_blacklist
add action=add-src-to-address-list address-list=ssh_blacklist
address-list-timeout=25w5d chain=input connection-state=new dst-port=
12022 in-interface=WAN protocol=tcp src-address-list=ssh_stage3
add action=add-src-to-address-list address-list=ssh_stage3
address-list-timeout=20s chain=input connection-state=new dst-port=12022
in-interface=WAN protocol=tcp src-address-list=ssh_stage2
add action=add-src-to-address-list address-list=ssh_stage2
address-list-timeout=20s chain=input connection-state=new dst-port=12022
in-interface=WAN protocol=tcp src-address-list=ssh_stage1
add action=add-src-to-address-list address-list=ssh_stage1
address-list-timeout=20s chain=input connection-state=new dst-port=12022
in-interface=WAN protocol=tcp
add action=drop chain=input comment=“External blocking web proxy” disabled=no dst-port=8080 in-interface=WAN protocol=tcp
add action=drop chain=input comment=“External blocking DNS cache” disabled=no dst-port=53 in-interface=WAN protocol=udp
/ip firewall nat
remove numbers=1
add action=masquerade chain=srcnat comment=“masq. vpn traffic” src-address=
192.168.89.0/24