I respect and fear my MikroTik 2011UiAS-2HnD router – it just works and keeps on working, but whenever I touch something (apart from updating FW) I break it.
So here I am after several years when I needed to make big changes to the firewall/NAT and I’m completely utterly stuck.
The set up is as follows:
- connected via WiFi to the router
- a few laptops (Hermes @ .80, Ducky @ .81, a few others I haven’t given static IPs yet), typically only 1-2 are on at the same time
- a desktop (Nuit @ .71) (I think Kibla does not exist anymore)
- a printer (Epson @ .101)
- a handful of smartphones, eReaders etc.
- home servers connected via Ethernet to the router
- Juno @ .110 – legacy, currently running the webserver with Pelican blog and Nextcloud
- Kalipso @ .111 – legacy, currently running Borg backup server and IRC bouncer
- Monolith @ .112 – new, running YunoHost, planned to replace both legacy servers
Several years ago, when I bought Juno and Kalipso, I set up IP firewall rules 0-13 (see below) and it worked.
Now I added Monolith into the network, added the IP firewall rules 14-29 and set up reverse proxy from Monolith to Juno, but Monolith is not accessible via any of the ports. I am testing this using YunoHost’s Diagnosis tool (and simply trying to reach the server via browser or ssh).
If I keep things as they are, only Juno and Kalipso are accessible. Monolith’s YunoHost Diagnosis says ports 80 and 443 are the only ones working (true, but they point to Juno, so not really).
If I disable rules 3-6 (i.e. http(s) to Juno), Monolith’s YunoHost Diagnosis says no ports are working.
The day before yesterday I disabled rules 1,3-6 and suddenly things worked as intended – all of Monolith’s needed ports were working and the reverse proxy as well.
But then yesterday late morning it suddenly stopped working – I swear I did not touch anything! – and I had to re-enable 3-6 in order to at least have the legacy webserver accessible again.
I’m frustrated and confused … some help would be very appreciated.
This is my current config:
# dec/10/2023 21:16:14 by RouterOS 6.49.10
# software id = **ELIDED**
#
# model = 2011UiAS-2HnD
# serial number = **ELIDED**
/interface bridge
add admin-mac=**ELIDED** auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether1 ] speed=100Mbps
set [ find default-name=ether2 ] name=ether2-master speed=100Mbps
set [ find default-name=ether3 ] speed=100Mbps
set [ find default-name=ether4 ] speed=100Mbps
set [ find default-name=ether5 ] speed=100Mbps
set [ find default-name=ether6 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether6-master
set [ find default-name=ether7 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether8 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether9 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether10 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
/interface wireless
set [ find default-name=wlan1 ] amsdu-limit=2048 band=2ghz-g/n channel-width=20/40mhz-Ce country=slovenia disabled=no distance=indoors frequency=2432 installation=\
indoor mode=ap-bridge ssid=<redacted> station-roaming=enabled wireless-protocol=802.11
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
add exclude=dynamic name=discover
add name=mactel
add name=mac-winbox
/interface wireless security-profiles
set [ find default=yes ] authentication-types=wpa2-psk mode=dynamic-keys supplicant-identity=MikroTik wpa-pre-shared-key=<redacted> wpa2-pre-shared-key=<redacted>
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=aes-128-cbc
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/snmp community
set [ find default=yes ] addresses=0.0.0.0/0
/user group
set full policy=local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,password,web,sniff,sensitive,api,romon,dude,tikapp
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add bridge=bridge comment=defconf interface=ether6-master
add bridge=bridge comment=defconf hw=no interface=sfp1
add bridge=bridge comment=defconf interface=wlan1
add bridge=bridge interface=ether3
add bridge=bridge interface=ether4
add bridge=bridge interface=ether5
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=sfp1 list=discover
add interface=ether2-master list=discover
add interface=ether3 list=discover
add interface=ether4 list=discover
add interface=ether5 list=discover
add interface=ether6-master list=discover
add interface=ether7 list=discover
add interface=ether8 list=discover
add interface=ether9 list=discover
add interface=ether10 list=discover
add interface=wlan1 list=discover
add interface=bridge list=discover
add interface=bridge list=mactel
add interface=bridge list=mac-winbox
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
add address=93.103.13.254/16 interface=ether1 network=93.103.0.0
/ip arp
add address=192.168.88.101 comment="Printer: EPSON L3050" interface=bridge mac-address=38:9D:92:EB:FA:0A
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server lease
add address=192.168.88.80 mac-address=6C:88:14:BC:60:A0 server=defconf
add address=192.168.88.110 mac-address=02:51:07:41:52:61 server=defconf
add address=192.168.88.71 client-id=1:0:28:f8:aa:62:b6 mac-address=00:28:F8:AA:62:B6
add address=192.168.88.111 mac-address=02:CC:06:41:F3:07 server=defconf
add address=192.168.88.70 mac-address=00:21:6A:5B:9C:46 server=defconf
add address=192.168.88.81 mac-address=F4:8C:50:79:58:EC server=defconf
add address=192.168.88.101 client-id=1:38:9d:92:eb:fa:a comment="EPSON L3050 [Printer]" mac-address=38:9D:92:EB:FA:0A server=defconf
add address=192.168.88.100 mac-address=00:22:61:3D:C1:E4 server=defconf
add address=192.168.88.60 client-id=1:cc:9f:7a:24:41:ca comment="Telefon papi" mac-address=CC:9F:7A:24:41:CA server=defconf
add address=192.168.88.61 comment="Telefon mami" mac-address=B0:A2:E7:2B:78:22 server=defconf
add address=192.168.88.63 client-id=1:2c:59:8a:70:63:e0 comment="Telefon Jost ta star" mac-address=2C:59:8A:70:63:E0 server=defconf
add address=192.168.88.62 client-id=1:d4:38:9c:a8:6c:cf comment="Telefon Matija" mac-address=D4:38:9C:A8:6C:CF server=defconf
add address=192.168.88.64 client-id=1:44:55:c4:7d:55:73 comment="Telefon Jost" mac-address=44:55:C4:7D:55:73 server=defconf
add address=192.168.88.112 client-id=ff:0:1a:79:ae:0:1:0:1:2c:f4:fc:8c:9c:6b:0:1a:79:ae mac-address=9C:6B:00:1A:79:AE server=defconf
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes servers=84.255.209.79,84.255.210.79
/ip dns static
add address=192.168.88.1 name=router.lan
add address=192.168.88.1 name=router
add address=192.168.88.1 name=io
add address=192.168.88.110 name=juno
add address=192.168.88.111 name=kalipso
add address=192.168.88.80 name=hermes
add address=192.168.88.71 name=nuit
add address=192.168.88.81 name=ducky
add address=192.168.88.70 name=kibla
/ip firewall filter
add action=accept chain=forward comment="defconf: accept in ipsec policy" ipsec-policy=in,ipsec
add action=accept chain=forward comment="defconf: accept out ipsec policy" ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related, untracked" connection-state=established,related,untracked
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf: drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface-list=WAN
add action=accept chain=input protocol=icmp
add action=accept chain=input connection-state=established
add action=accept chain=input connection-state=related
add action=drop chain=input in-interface-list=!LAN
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=WAN
add action=masquerade chain=srcnat disabled=yes out-interface=ether1
add action=dst-nat chain=dstnat comment="0 A.D. za Nuit" dst-port=20595 protocol=udp to-addresses=192.168.88.71 to-ports=20595
add action=dst-nat chain=dstnat comment="HTTP za Juno" dst-address=93.103.13.254 dst-port=80 protocol=tcp to-addresses=192.168.88.110 to-ports=80
add action=src-nat chain=srcnat comment="HTTP za Juno" dst-address=192.168.88.110 dst-port=80 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="HTTPS za Juno" dst-address=93.103.13.254 dst-port=443 protocol=tcp to-addresses=192.168.88.110 to-ports=443
add action=src-nat chain=srcnat comment="HTTPS za Juno" dst-address=192.168.88.110 dst-port=443 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="ZNC za Kalipso" dst-address=93.103.13.254 dst-port=6767 protocol=tcp to-addresses=192.168.88.111 to-ports=6767
add action=src-nat chain=srcnat comment="ZNC za Kalipso" dst-address=192.168.88.111 dst-port=6767 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="SSH za Kalipso" dst-address=93.103.13.254 dst-port=22111 protocol=tcp to-addresses=192.168.88.111 to-ports=22
add action=src-nat chain=srcnat comment="SSH za Kalipso" dst-address=192.168.88.111 dst-port=22 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="SSH za Juno" dst-address=93.103.13.254 dst-port=22110 protocol=tcp to-addresses=192.168.88.110 to-ports=22
add action=src-nat chain=srcnat comment="SSH za Juno" dst-address=192.168.88.110 dst-port=22 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat dst-port=16000 protocol=udp to-addresses=192.168.88.71 to-ports=16000
add action=dst-nat chain=dstnat comment="HTTP za Monolith" disabled=yes dst-address=93.103.13.254 dst-port=80 protocol=tcp to-addresses=192.168.88.112 to-ports=80
add action=src-nat chain=srcnat comment="HTTP za Monolith" disabled=yes dst-address=192.168.88.112 dst-port=80 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="HTTPS za Monolith" disabled=yes dst-address=93.103.13.254 dst-port=443 protocol=tcp to-addresses=192.168.88.112 to-ports=443
add action=src-nat chain=srcnat comment="HTTPS za Monolith" disabled=yes dst-address=192.168.88.112 dst-port=443 protocol=tcp to-addresses=192.168.88.1
add action=src-nat chain=srcnat comment="SSH za Monolith" dst-address=192.168.88.112 dst-port=22 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="SSH za Monolith" dst-address=93.103.13.254 dst-port=22 protocol=tcp to-addresses=192.168.88.112 to-ports=22
add action=src-nat chain=srcnat comment="SMTP za Monolith" dst-address=192.168.88.112 dst-port=25 protocol=tcp to-addresses=192.168.88.1 to-ports=0-65535
add action=dst-nat chain=dstnat comment="SMTP za Monolith" dst-address=93.103.13.254 dst-port=25 protocol=tcp to-addresses=192.168.88.112 to-ports=25
add action=src-nat chain=srcnat comment="SMTP (varen) za Monolith" dst-address=192.168.88.112 dst-port=587 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="SMTP (varen) za Monolith" dst-address=93.103.13.254 dst-port=587 protocol=tcp to-addresses=192.168.88.112 to-ports=587
add action=src-nat chain=srcnat comment="IMAP za Monolith" dst-address=192.168.88.112 dst-port=993 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="IMAP za Monolith" dst-address=93.103.13.254 dst-port=993 protocol=tcp to-addresses=192.168.88.112 to-ports=993
add action=src-nat chain=srcnat comment="XMPP (client) za Monolith" dst-address=192.168.88.112 dst-port=5222 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="XMPP (client) za Monolith" dst-address=93.103.13.254 dst-port=5222 protocol=tcp to-addresses=192.168.88.112 to-ports=5222
add action=src-nat chain=srcnat comment="XMPP (server) za Monolith" dst-address=192.168.88.112 dst-port=5269 protocol=tcp to-addresses=192.168.88.1
add action=dst-nat chain=dstnat comment="XMPP (server) za Monolith" dst-address=93.103.13.254 dst-port=5269 protocol=tcp to-addresses=192.168.88.112 to-ports=5269
/ip route
add distance=1 gateway=93.103.0.1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www disabled=yes
set www-ssl certificate=<redacted> disabled=no
set api disabled=yes
set winbox disabled=yes
set api-ssl certificate=<redacted>
/ip ssh
set forwarding-enabled=remote host-key-size=4096 strong-crypto=yes
/system clock
set time-zone-name=Europe/Ljubljana
/system identity
set name=io
/system ntp client
set enabled=yes server-dns-names=pool.ntp.org
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN
Or just the /ip/firewall part:
Flags: X - disabled, I - invalid, D - dynamic
0 ;;; defconf: masquerade
chain=srcnat action=masquerade out-interface-list=WAN ipsec-policy=out,none
1 chain=srcnat action=masquerade out-interface=ether1
2 ;;; 0 A.D. za Nuit
chain=dstnat action=dst-nat to-addresses=192.168.88.71 to-ports=20595 protocol=udp dst-port=20595 log=no log-prefix=""
3 ;;; HTTP za Juno
chain=dstnat action=dst-nat to-addresses=192.168.88.110 to-ports=80 protocol=tcp dst-address=93.103.13.254 dst-port=80
4 ;;; HTTP za Juno
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.110 dst-port=80 log=no log-prefix=""
5 ;;; HTTPS za Juno
chain=dstnat action=dst-nat to-addresses=192.168.88.110 to-ports=443 protocol=tcp dst-address=93.103.13.254 dst-port=443
6 ;;; HTTPS za Juno
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.110 dst-port=443
7 ;;; ZNC za Kalipso
chain=dstnat action=dst-nat to-addresses=192.168.88.111 to-ports=6767 protocol=tcp dst-address=93.103.13.254 dst-port=6767
8 ;;; ZNC za Kalipso
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.111 dst-port=6767
9 ;;; SSH za Kalipso
chain=dstnat action=dst-nat to-addresses=192.168.88.111 to-ports=22 protocol=tcp dst-address=93.103.13.254 dst-port=22111
10 ;;; SSH za Kalipso
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.111 dst-port=22
11 ;;; SSH za Juno
chain=dstnat action=dst-nat to-addresses=192.168.88.110 to-ports=22 protocol=tcp dst-address=93.103.13.254 dst-port=22110
12 ;;; SSH za Juno
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.110 dst-port=22
13 chain=dstnat action=dst-nat to-addresses=192.168.88.71 to-ports=16000 protocol=udp dst-port=16000 log=no log-prefix=""
14 ;;; HTTP za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=80 protocol=tcp dst-address=93.103.13.254 dst-port=80 log=no log-prefix=""
15 ;;; HTTP za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=80 log=no log-prefix=""
16 ;;; HTTPS za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=443 protocol=tcp dst-address=93.103.13.254 dst-port=443 log=no log-prefix=""
17 ;;; HTTPS za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=443 log=no log-prefix=""
18 ;;; SSH za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=22 log=no log-prefix=""
19 ;;; SSH za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=22 protocol=tcp dst-address=93.103.13.254 dst-port=22 log=no log-prefix=""
20 ;;; SMTP za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 to-ports=0-65535 protocol=tcp dst-address=192.168.88.112 dst-port=25 log=no log-prefix=""
21 ;;; SMTP za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=25 protocol=tcp dst-address=93.103.13.254 dst-port=25 log=no log-prefix=""
22 ;;; SMTP (varen) za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=587 log=no log-prefix=""
23 ;;; SMTP (varen) za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=587 protocol=tcp dst-address=93.103.13.254 dst-port=587 log=no log-prefix=""
24 ;;; IMAP za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=993 log=no log-prefix=""
25 ;;; IMAP za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=993 protocol=tcp dst-address=93.103.13.254 dst-port=993 log=no log-prefix=""
26 ;;; XMPP (client) za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=5222 log=no log-prefix=""
27 ;;; XMPP (client) za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=5222 protocol=tcp dst-address=93.103.13.254 dst-port=5222 log=no log-prefix=""
28 ;;; XMPP (server) za Monolith
chain=srcnat action=src-nat to-addresses=192.168.88.1 protocol=tcp dst-address=192.168.88.112 dst-port=5269 log=no log-prefix=""
29 ;;; XMPP (server) za Monolith
chain=dstnat action=dst-nat to-addresses=192.168.88.112 to-ports=5269 protocol=tcp dst-address=93.103.13.254 dst-port=5269 log=no log-prefix=""