Please understand that I’ve been at this for days (as I get the time) trying to make this work. I have a simple architecture that was converted from a basic consumer friendly router to the mikrotik for home use; everything worked on the previous device. I got everything working well on the mikrotik except the hairpin nat and that has eluded me to the point where I’m basically trying things at random to see if anything will accidentally work.
I went through, probably, every youtube video there was, read threads on many forums including this one, and nothing I’ve found made it work. I got the destnat working on the first try and can access the web server from outside, but the masquerade just doesn’t work for me. Totally at my wits end here.
The configuration as it is right now that doesn’t work. There have been so many changes that I haven’t been able to keep track of them all.
[admin@MikroTik] /ip firewall> export
# oct/04/2021 17:20:49 by RouterOS 6.47.9
# software id = QXIJ-366T
#
# model = RBD53iG-5HacD2HnD
# serial number = E72C0EBE5293
/ip firewall filter
add action=accept chain=input comment=\
"defconf: accept established,related,untracked" connection-state=\
established,related,untracked
add action=drop chain=input comment="defconf: drop invalid" connection-state=\
invalid
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment=\
"defconf: accept to local loopback (for CAPsMAN)" dst-address=127.0.0.1
add action=drop chain=input comment="defconf: drop all not coming from LAN" \
in-interface-list=!LAN
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 \
log=yes log-prefix="I just dropped this"
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=dst-nat chain=dstnat comment="NAT for web server" dst-address=\
aaa.aaa.aaa.aaa dst-address-type=local dst-port=80 log=yes log-prefix=\
"NAT for web server" protocol=tcp to-addresses=192.168.0.sss to-ports=80
add action=masquerade chain=srcnat comment="Hairpin for web server" \
dst-address=iii.iii.iii.iii dst-address-type=local log=yes log-prefix=\
"Hairpin for web server" protocol=tcp src-address=192.168.0.0/24
[admin@MikroTik] /ip firewall
Where the aaa… is the vlan address given to me by the isp. I think I’m on a subnet that teknet set up for this area (rural with a network of radios on our roofs). The iii… is my internet address; I have a static address. The little sss is my pi webserver.
HELP ! I’m starting to look at the mikrotik like it might become a frizbee and go sailing out into the desert behind my house.