Community discussions

MikroTik App
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

hairpin nat when router is NATed

Wed Jan 26, 2022 12:46 pm

I use ZTE LTE modem for WAN. Unfortunately it's bridge mode is buggy (or MT is buggy) and freezes frequently, so the modem is in router mode and my MT firewall "sees" 192.168.254.x/24 IP as it's external IP.

I need to implement hairpin nat, but on the MT. Rule like this does the job:
pseudocode
chain: dst-nat src-address: <my lan range> dst-address: <my REAL wan IP> action: dst-nat to-addr: <my MT lan IP> ports and so on
Problem is my WAN IP is not fixed and I can't figure out how to have address list containing my up-to-date wan ip. Suggestions how to have hairpin on NATed router?
 
Sob
Forum Guru
Forum Guru
Posts: 9119
Joined: Mon Apr 20, 2009 9:11 pm

Re: hairpin nat when router is NATed  [SOLVED]

Wed Jan 26, 2022 1:43 pm

You need DDNS (you can use built-in IP->Cloud), then add hostname to address list:
/ip firewall address-list
add list=my-wan-ip address=<your DDNS hostname>
Router will automatically resolve it based on TTL. And then in NAT rule use dst-address-list=my-wan-ip.
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

Re: hairpin nat when router is NATed

Wed Jan 26, 2022 2:09 pm

wow, wasn't aware I can put DNS names in address list. re-resolving is based on the DNS record TTL, right?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19107
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: hairpin nat when router is NATed

Wed Jan 26, 2022 2:49 pm

Yup!
Happy reading.......
viewtopic.php?t=179343
 
gdanov
Member Candidate
Member Candidate
Topic Author
Posts: 150
Joined: Thu Jan 17, 2019 1:10 pm

Re: hairpin nat when router is NATed

Wed Jan 26, 2022 2:54 pm

thanks! technically I don't have src-nat problem and don't need hairpin nat :) but anyhow...
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19107
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: hairpin nat when router is NATed

Wed Jan 26, 2022 4:01 pm

Whatever is working stick with it!!
( Just for sob: Of course if its not configured my way, ........... there can only be one! )

Who is online

Users browsing this forum: CGGXANNX, mantouboji and 55 guests