Help to configure Public IP with port forwarding

Hi,

I have a Public IP configured to an Mikrotik Router that has a port forwading to a server. The config is like described below. Everything works fine except that inside LAN network I can not connect to the public IP. I can make ping but can not connect to port 22, 80 or 443.

I don’t have DHCP Client; only DHCP server that gives the network to the server, both are in the same network (192.168.88.1/24).

IP Address and IP Routes are well configured. Maybe a have a bad config on NAT.

NAT Config described:

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=dst-nat chain=dstnat dst-port=80 in-interface=ether1 protocol=tcp
to-addresses=192.168.88.100 to-ports=80
add action=dst-nat chain=dstnat dst-port=443 in-interface=ether1 protocol=tcp
to-addresses=192.168.88.100 to-ports=443
add action=dst-nat chain=dstnat dst-port=8000 in-interface=ether1 protocol=
tcp to-addresses=192.168.88.100 to-ports=8000
add action=dst-nat chain=dstnat dst-port=22 in-interface=ether1 protocol=tcp
src-address-list=CountryIPBlocks to-addresses=192.168.88.100 to-ports=22

Any help will be appreciated.

If you mean that you’re connecting to public address from LAN, then you can’t have dstnat rules with in-interface=ether1, because connections from LAN will have different incoming interface. Use dst-address= instead. And you also need to read https://wiki.mikrotik.com/wiki/Hairpin_NAT.

Thanks for your help,

It works like a charm!