Community discussions

MikroTik App
 
ejkeebler
just joined
Topic Author
Posts: 4
Joined: Sat Jan 15, 2022 7:53 pm

Hairpin NAT

Sat Jan 15, 2022 7:59 pm

I was hoping someone could explain a little bit more how hairpin nat'ing applies to my situation. I have a server that runs docker, one of those containers runs a few game servers. I deleted my Hairpin NAT and the game servers would not handshake with steam anymore. I dont see why this is happening, but I put it back and everything is working again. I dont see what is on the same networks that is causing a communication that needs to go through the router. So, I figure I have to put the docker server on it's on subnet. Can it just not be on the same subnet as the router? Do I have to put other things on a different subnet in order to get rid of my hairpin nat?
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Hairpin NAT

Sat Jan 15, 2022 8:47 pm

Why would you want to get rid of it? It's simple, useful, harmless, there's no problem to have it. It definitely doesn't affect communication with internet, it's used only when client in LAN connects to seemingly outside server, but the port is forwarded back to server in same LAN. That's if you do it correctly, which is what only you so far can see, since you didn't post your config.
 
ejkeebler
just joined
Topic Author
Posts: 4
Joined: Sat Jan 15, 2022 7:53 pm

Re: Hairpin NAT

Sat Jan 15, 2022 9:48 pm

I've just read a lot of people commenting that the solutions is probably better to have it on its own network. Like I said it works fine, I just want to make sure i'm doing things the right way before they get overly complicated.

Thanks for the notes.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19372
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Hairpin NAT

Sat Jan 15, 2022 10:32 pm

Moving to a different subnet avoids hairpin NAT and is probably best for segmenting your server, security wise.............
viewtopic.php?t=179343
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Hairpin NAT

Sat Jan 15, 2022 10:40 pm

If you don't need separate subnet for anything else, then no, it's not better, it can only complicate some things. You'll have traffic still passing through router, which is the only downside of hairpin NAT. And how much less complicated you can make it, when hairpin NAT needs only single srcnat rule.

Who is online

Users browsing this forum: adwlodaro and 100 guests