Hi,
I set my self a goal to fix my crappy firewall rules with the following goals
- All allowed packets must be explicitly accepted
- All disallowed packets must be explicitly dropped
- All other packets must be dropped and logged
At the end of this journey, nothing known should reach the last rule on the firewall (chain=input action=drop log=yes). This log will (in distant future) be sent to a central logging service with alerts attached to it.
Here are my firewall rules:
[admin@RB01] /ip firewall filter> print
Flags: X - disabled, I - invalid, D - dynamic
0 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough
1 ;;; SYN Flood protect
chain=forward action=jump jump-target=SYN-Protect tcp-flags=syn connection-state=new protocol=tcp
2 chain=SYN-Protect action=accept tcp-flags=syn connection-state=new protocol=tcp limit=400,5
3 chain=SYN-Protect action=drop tcp-flags=syn connection-state=new protocol=tcp
4 ;;; accept established,related,untracked
chain=input action=accept connection-state=established,related,untracked
5 ;;; drop invalid
chain=input action=drop connection-state=invalid
6 ;;; accept ICMP
chain=input action=accept protocol=icmp
7 ;;; accept to local loopback (for CAPsMAN)
chain=input action=accept dst-address=127.0.0.1
8 ;;; fasttrack
chain=forward action=fasttrack-connection connection-state=established,related
9 ;;; accept established,related, untracked
chain=forward action=accept connection-state=established,related,untracked
10 ;;; drop invalid
chain=forward action=drop connection-state=invalid
11 ;;; Allow portforward
chain=forward action=accept connection-state=new connection-nat-state=dstnat in-interface=ether1_UPLINK
12 ;;; Allow access to Winbox from management network
chain=input action=accept src-address=172.29.10.0/24 dst-address=172.29.10.1 in-interface=MANAGEMENT_VLAN log=no log-prefix=""
13 ;;; RouterOS deighbor deiscovery featre
chain=forward action=accept protocol=udp src-address=172.29.10.0/24 in-interface=MANAGEMENT_VLAN
14 ;;; Allow management network access to the whole network
chain=forward action=accept src-address=172.29.10.0/24 in-interface=MANAGEMENT_VLAN out-interface=all-vlan log=no log-prefix=""
15 ;;; Allow access to DNS server (UDP)
chain=forward action=accept protocol=udp dst-address=172.29.10.100 in-interface=all-vlan out-interface=MANAGEMENT_VLAN dst-port=53
16 ;;; Allow access to DNS server (TCP)
chain=forward action=accept protocol=tcp dst-address=172.29.10.100 in-interface=all-vlan out-interface=MANAGEMENT_VLAN dst-port=53
17 ;;; Allow CODEBREAKER devices access to proxy server
chain=forward action=accept protocol=tcp dst-address=172.28.30.103 in-interface=CODEBREAKER_DEVICES_VLAN out-interface=CODEBREAKER_VM_VLAN dst-port=80,443
18 ;;; Allow Home Devices access to the SMB share on OMV
chain=forward action=accept protocol=tcp dst-address=172.29.10.107 in-interface=HOME_DEVICES_VLAN out-interface=MANAGEMENT_VLAN dst-port=445
19 ;;; Drop all inter-VLAN packets
chain=forward action=drop in-interface=all-vlan out-interface=all-vlan log=no log-prefix=""
20 ;;; Drop Winbox on WAN
chain=input action=drop protocol=tcp in-interface=ether1_UPLINK dst-port=8291
21 ;;; drop all from WAN not DSTNATed
chain=forward action=drop connection-state=new connection-nat-state=!dstnat in-interface=ether1_UPLINK
22 ;;; Drop everything else
chain=input action=drop log=yes log-prefix="DROP_ALL_"
I’ve added syn flood protection to my firewall from mikrotik wiki. But in my drop all rule log I get a lot to TCP SYC packages. I understand what SYN packets do in a TCP handshake, but I don’t understand what are these. Are they part of an SYN Flood attack? These packets should be dropped? Accepted? If so, how?
12:41:15 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:50027->192.168.1.2:64501, len 52
12:41:29 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 194.26.29.130:8080->192.168.1.2:33392, len 44
12:41:36 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 37.194.213.234:51553->192.168.1.2:445, len 44
12:42:02 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 51.83.206.126:58862->192.168.1.2:3389, len 52
12:42:05 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.164.185.107:35592->192.168.1.2:49698, len 60
12:42:05 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 51.83.206.126:58862->192.168.1.2:3389, len 52
12:42:06 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.164.185.107:35592->192.168.1.2:49698, len 60
12:42:08 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.164.185.107:35592->192.168.1.2:49698, len 60
12:42:11 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 51.83.206.126:58862->192.168.1.2:3389, len 48
12:42:12 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 95.178.157.169:35106->192.168.1.2:23, len 44
12:42:12 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.164.185.107:35592->192.168.1.2:49698, len 60
12:42:13 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 80.61.214.49:6259->192.168.1.2:64501, len 52
12:42:16 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 80.61.214.49:6259->192.168.1.2:64501, len 52
12:42:20 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.164.185.107:35592->192.168.1.2:49698, len 60
12:42:22 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 80.61.214.49:6259->192.168.1.2:64501, len 52
12:42:57 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.248.174.193:46203->192.168.1.2:9200, len 44
12:43:18 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 175.113.235.76:16432->192.168.1.2:8080, len 44
12:43:20 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 200.98.136.210:40401->192.168.1.2:1433, len 44
12:44:47 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto UDP, 77.247.108.243:5113->192.168.1.2:3060, len 443
12:45:13 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto UDP, 45.143.220.171:5716->192.168.1.2:5060, len 419
12:45:42 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 94.102.53.10:51195->192.168.1.2:18551, len 44
12:45:47 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.184.79.33:60000->192.168.1.2:3402, len 44
12:46:00 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 51.91.254.98:53735->192.168.1.2:23, len 44
12:46:06 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 172.5.192.246:8660->192.168.1.2:64501, len 52
12:46:09 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 172.5.192.246:8660->192.168.1.2:64501, len 52
12:46:17 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 111.250.137.232:11459->192.168.1.2:23, len 44
12:46:18 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 139.162.99.58:55568->192.168.1.2:808, len 44
12:46:20 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:56838->192.168.1.2:49698, len 60
12:46:23 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:56838->192.168.1.2:49698, len 60
12:46:29 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:56838->192.168.1.2:49698, len 60
12:46:36 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 172.87.221.218:40068->192.168.1.2:1433, len 44
12:46:41 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:41729->192.168.1.2:49698, len 60
12:46:44 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:41729->192.168.1.2:49698, len 60
12:46:48 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 113.12.84.131:52863->192.168.1.2:445, len 44
12:46:50 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 89.201.216.245:41729->192.168.1.2:49698, len 60
12:46:56 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 95.178.159.219:21481->192.168.1.2:23, len 44
12:47:32 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:47:33 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:47:36 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:47:40 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:47:48 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 194.26.29.130:8080->192.168.1.2:4002, len 44
12:47:48 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:47:59 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto UDP, 185.156.175.89:38429->192.168.1.2:64501, len 48
12:48:03 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.156.175.89:38927->192.168.1.2:64501, len 60
12:48:04 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.156.175.89:38927->192.168.1.2:64501, len 60
12:48:05 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.45.194.209:51277->192.168.1.2:64501, len 52
12:48:06 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.156.175.89:38927->192.168.1.2:64501, len 60
12:48:10 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 185.156.175.89:38927->192.168.1.2:64501, len 60
12:48:49 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:31682->192.168.1.2:22, len 60
12:48:50 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:31682->192.168.1.2:22, len 60
12:48:52 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:31682->192.168.1.2:22, len 60
12:48:55 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:38517->192.168.1.2:22, len 60
12:48:56 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:38517->192.168.1.2:22, len 60
12:48:58 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:38517->192.168.1.2:22, len 60
12:49:01 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:45588->192.168.1.2:22, len 60
12:49:02 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:45588->192.168.1.2:22, len 60
12:49:04 firewall,info DROP_ALL_ input: in:ether1_UPLINK out:(unknown 0), src-mac 64:6e:ea:31:9c:b9, proto TCP (SYN), 61.177.172.128:45588->192.168.1.2:22, len 60
Here the rest of the config, if needed:
# feb/10/2020 12:46:03 by RouterOS 6.46.3
# software id = GYLW-MC9Q
#
# model = RB4011iGS+
# serial number = AAAF0A95696C
/caps-man datapath
add local-forwarding=yes name=HOME_DEVICES_DATAPATH vlan-id=2720 vlan-mode=use-tag
/interface bridge
add name=BR1 protocol-mode=none vlan-filtering=yes
/interface ethernet
set [ find default-name=ether1 ] name=ether1_UPLINK
set [ find default-name=ether6 ] disabled=yes
set [ find default-name=ether7 ] disabled=yes
set [ find default-name=ether8 ] disabled=yes
set [ find default-name=ether9 ] disabled=yes
set [ find default-name=ether10 ] name=ether10_cAP poe-out=off
/interface vlan
add interface=BR1 name=CODEBREAKER_DEVICES_VLAN vlan-id=2820
add interface=BR1 name=CODEBREAKER_VM_VLAN vlan-id=2830
add interface=BR1 name=HOME_DEVICES_VLAN vlan-id=2720
add interface=BR1 name=HOME_VM_VLAN vlan-id=2730
add interface=BR1 name=MANAGEMENT_VLAN vlan-id=10
/caps-man security
add authentication-types=wpa-psk,wpa2-psk name=HOME_DEVICES_SECURITY
/caps-man configuration
add country=croatia datapath=HOME_DEVICES_DATAPATH name=HOME_DEVICES_CONFIGURATION security=HOME_DEVICES_SECURITY ssid=CODE
/interface ethernet switch port
set 0 default-vlan-id=0
set 1 default-vlan-id=0
set 2 default-vlan-id=0
set 3 default-vlan-id=0
set 4 default-vlan-id=0
set 5 default-vlan-id=0
set 6 default-vlan-id=0
set 7 default-vlan-id=0
set 8 default-vlan-id=0
set 9 default-vlan-id=0
set 10 default-vlan-id=0
set 11 default-vlan-id=0
/interface list
add name=MANAGEMENT
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=MANAGEMENT_POOL ranges=172.29.10.200-172.29.10.254
add name=CODEBREAKER_DEVICES_POOL ranges=172.28.20.100-172.28.20.254
add name=HOME_DEVICES_POOL ranges=172.27.20.100-172.27.20.254
/ip dhcp-server
add address-pool=MANAGEMENT_POOL disabled=no interface=MANAGEMENT_VLAN name=MANAGEMENT_DHCP
add address-pool=CODEBREAKER_DEVICES_POOL disabled=no interface=CODEBREAKER_DEVICES_VLAN name=CODEBREAKER_DEVICES_DHCP
add address-pool=HOME_DEVICES_POOL disabled=no interface=HOME_DEVICES_VLAN name=HOME_DEVICES_DHCP
/system logging action
add disk-file-count=1 disk-file-name=/flash/info.log disk-lines-per-file=50000 name=info target=disk
/caps-man manager
set enabled=yes
/caps-man provisioning
add action=create-dynamic-enabled master-configuration=HOME_DEVICES_CONFIGURATION
/interface bridge port
add bridge=BR1 interface=ether2
add bridge=BR1 interface=ether3 pvid=10
add bridge=BR1 interface=sfp-sfpplus1
add bridge=BR1 interface=ether10_cAP
/ip neighbor discovery-settings
set discover-interface-list=MANAGEMENT
/ip settings
set tcp-syncookies=yes
/interface bridge vlan
add bridge=BR1 tagged=BR1,ether2,ether10_cAP vlan-ids=10,2830,2820,2730,2720
/interface list member
add interface=MANAGEMENT_VLAN list=MANAGEMENT
/ip address
add address=192.168.1.2/24 interface=ether1_UPLINK network=192.168.1.0
add address=172.29.10.1/24 interface=MANAGEMENT_VLAN network=172.29.10.0
add address=172.28.30.1/24 interface=CODEBREAKER_VM_VLAN network=172.28.30.0
add address=172.28.20.1/24 interface=CODEBREAKER_DEVICES_VLAN network=172.28.20.0
add address=172.27.20.1/24 interface=HOME_DEVICES_VLAN network=172.27.20.0
add address=172.27.30.1/24 interface=HOME_VM_VLAN network=172.27.30.0
/ip cloud
set ddns-enabled=yes ddns-update-interval=1m
/ip dhcp-server network
add address=172.27.20.0/24 dns-server=172.29.10.100,1.1.1.1 gateway=172.27.20.1
add address=172.28.20.0/24 dns-server=172.29.10.100,1.1.1.1 gateway=172.28.20.1
add address=172.29.10.0/24 dns-server=172.29.10.100,1.1.1.1 gateway=172.29.10.1
/ip dns
set servers=1.1.1.1
/ip firewall filter
add action=jump chain=forward comment="SYN Flood protect" connection-state=new jump-target=SYN-Protect protocol=tcp tcp-flags=syn
add action=accept chain=SYN-Protect connection-state=new limit=400,5 protocol=tcp tcp-flags=syn
add action=drop chain=SYN-Protect connection-state=new protocol=tcp tcp-flags=syn
add action=accept chain=input comment="accept established,related,untracked" connection-state=established,related,untracked
add action=drop chain=input comment="drop invalid" connection-state=invalid
add action=accept chain=input comment="accept ICMP" protocol=icmp
add action=accept chain=input comment="accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=fasttrack-connection chain=forward comment=fasttrack connection-state=established,related
add action=accept chain=forward comment="accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="drop invalid" connection-state=invalid
add action=accept chain=forward comment="Allow portforward" connection-nat-state=dstnat connection-state=new in-interface=ether1_UPLINK
add action=accept chain=input comment="Allow access to Winbox from management network" dst-address=172.29.10.1 in-interface=MANAGEMENT_VLAN src-address=172.29.10.0/24
add action=accept chain=forward comment="RouterOS deighbor deiscovery featre" in-interface=MANAGEMENT_VLAN protocol=udp src-address=172.29.10.0/24
add action=accept chain=forward comment="Allow management network access to the whole network" in-interface=MANAGEMENT_VLAN out-interface=all-vlan src-address=172.29.10.0/24
add action=accept chain=forward comment="Allow access to DNS server (UDP)" dst-address=172.29.10.100 dst-port=53 in-interface=all-vlan out-interface=MANAGEMENT_VLAN protocol=udp
add action=accept chain=forward comment="Allow access to DNS server (TCP)" dst-address=172.29.10.100 dst-port=53 in-interface=all-vlan out-interface=MANAGEMENT_VLAN protocol=tcp
add action=accept chain=forward comment="Allow CODEBREAKER devices access to proxy server" dst-address=172.28.30.103 dst-port=80,443 in-interface=CODEBREAKER_DEVICES_VLAN out-interface=CODEBREAKER_VM_VLAN protocol=tcp
add action=accept chain=forward comment="Allow Home Devices access to the SMB share on OMV" dst-address=172.29.10.107 dst-port=445 in-interface=HOME_DEVICES_VLAN out-interface=MANAGEMENT_VLAN protocol=tcp
add action=drop chain=forward comment="Drop all inter-VLAN packets " in-interface=all-vlan out-interface=all-vlan
add action=drop chain=input comment="Drop Winbox on WAN" dst-port=8291 in-interface=ether1_UPLINK protocol=tcp
add action=drop chain=forward comment="drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=ether1_UPLINK
add action=drop chain=input comment="Drop everything else " log=yes log-prefix=DROP_ALL_
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1_UPLINK
add action=dst-nat chain=dstnat dst-port=443 in-interface=ether1_UPLINK protocol=tcp to-addresses=172.29.10.109 to-ports=443
add action=dst-nat chain=dstnat dst-port=80 in-interface=ether1_UPLINK protocol=tcp to-addresses=172.29.10.109 to-ports=80
add action=dst-nat chain=dstnat dst-port=18180 in-interface=ether1_UPLINK protocol=tcp to-addresses=172.29.10.101 to-ports=18180
/ip route
add check-gateway=ping distance=1 gateway=192.168.1.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set ssh address=172.29.10.0/24
set api disabled=yes
set winbox address=172.29.10.0/24
set api-ssl disabled=yes
/ip ssh
set strong-crypto=yes
/system clock
set time-zone-name=Europe/Zagreb
/system identity
set name=RB01
/system logging
add topics=firewall
/tool bandwidth-server
set enabled=no
/tool mac-server
set allowed-interface-list=MANAGEMENT
/tool mac-server mac-winbox
set allowed-interface-list=MANAGEMENT
/tool mac-server ping
set enabled=no