Community discussions

MikroTik App
 
vadave
just joined
Topic Author
Posts: 1
Joined: Mon Dec 05, 2022 11:11 pm

Cannot setup Hairpin NAT

Mon Dec 05, 2022 11:16 pm

Hello All,

I have a "RouterBOARD 962UiGS-5HacT2HnT",
it has been setup with default config,
i have a WAN IP of ${WAN_IP}
I have a web server on ip 192.168.88.21 (Ether5)
and i am trying to access the webserver from local ip 192.168.88.4 (Ether3)
but its not working, below is my router config, please help.

# dec/06/2022 02:33:55 by RouterOS 7.5
# model = RouterBOARD 962UiGS-5HacT2HnT
/interface bridge
add admin-mac=B8:69:F4:3C:61:C7 auto-mac=no comment=defconf name=bridge
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 use-peer-dns=yes
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/ip pool
add name=dhcp ranges=192.168.88.100-192.168.88.254
/ip dhcp-server
add address-pool=dhcp interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
add bridge=bridge comment=defconf interface=sfp1

/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=pppoe-out1 list=WAN
/ip address
add address=192.168.88.1/24 comment=defconf interface=bridge network=192.168.88.0
/ip dhcp-client
add comment=defconf disabled=yes interface=ether1
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf dns-server=192.168.88.1 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 comment=defconf name=router.lan
/ip firewall filter
add action=log chain=forward dst-address=192.168.88.21 log=yes log-prefix="88.4 -> 88.21" src-address=\
192.168.88.4
add action=log chain=forward dst-address=103.141.217.192 log=yes log-prefix="88.4 -> public ip" \
src-address=192.168.88.4
add action=log chain=forward dst-address=192.168.88.4 log=yes log-prefix="88.21 -> 88.4" src-address=\
192.168.88.21
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 disabled=yes hw-offload=yes
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
/ip firewall nat
add action=src-nat chain=srcnat comment="defconf: masquerade" ipsec-policy=out,none out-interface-list=\
WAN to-addresses=${WAN_IP}
add action=dst-nat chain=dstnat dst-port=443 in-interface-list=WAN log=yes log-prefix="dst-nat to 21:443" \
protocol=tcp to-addresses=192.168.88.21 to-ports=443
add action=dst-nat chain=dstnat dst-port=80 in-interface-list=WAN log=yes log-prefix="dst-nat to 21:80" \
protocol=tcp to-addresses=192.168.88.21 to-ports=80
add action=masquerade chain=srcnat comment=hairpin dst-address=192.168.88.0/24 log=yes log-prefix=hairpin \
src-address=192.168.88.0/24


Appreciate you help,
Dave

Who is online

Users browsing this forum: GoogleOther [Bot] and 29 guests