Community discussions

MikroTik App

Search found 4328 matches: hairpin

Searched query: hairpin

  • 1
  • 2
  • 3
  • 4
  • 5
  • 15
by RBrogen
Sat Apr 20, 2024 1:45 am
Forum: General
Topic: NAT Issue - SOLVED
Replies: 2
Views: 107

NAT Issue - SOLVED

... extra to allow a user to type in a url that has to go out of the fireall and back in to work. I believe it has to do with a NAT Loopback or Hairpin NAT. I have tried and am currently trying different approaches with that but it doesn't seem to want to work. Can someone please point me in ...
by Sob
Wed Apr 17, 2024 3:12 am
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

It's not blocked by your firewall, since you don't have any. Srcnat on WAN doesn't have any conditions, so that's not breaking it. Mangle rules won't touch it, so no problem there either. It seems to me that if VPN client 192.168.89.x tries to route internet traffic via this router, it should work. ...
by chindo
Tue Apr 16, 2024 7:54 pm
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Good news! If you have server in LAN1 (one subnet) and clients in LAN2 (another subnet), then the problem that's solved by hairpin NAT doesn't occur. So you don't need hairpin NAT. Your problem (aside from non-existent firewall filter section, but that's another story) is the mangle ...
by chindo
Tue Apr 16, 2024 7:44 pm
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Good news! If you have server in LAN1 (one subnet) and clients in LAN2 (another subnet), then the problem that's solved by hairpin NAT doesn't occur. So you don't need hairpin NAT. Your problem (aside from non-existent firewall filter section, but that's another story) is the mangle ...
by chindo
Tue Apr 16, 2024 7:41 pm
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Well when you have to have a consistent config, and plan. You are stuck between assigning subnets to ports, and having vlans. Suggest if you are considering doing vlans, drop subnets to ports. If not, then drop vlans. Let me know which way you go as I dont want to waste time. Hi there, Sorry I shou...
by IgoRR
Tue Apr 16, 2024 11:18 am
Forum: Beginner Basics
Topic: S2S problem
Replies: 4
Views: 717

Re: S2S problem

... dst-address=192.168.11.0/24 out-interface=REMOTE-3_L2TP src-address=192.168.1.0/24 add action=masquerade chain=srcnat comment="HAIRPIN NAT GENERAL LAN" dst-address=192.168.1.0/24 out-interface=LAN-bridge src-address=192.168.1.0/24 /ip route add disabled=no dst-address=172.16.16.0/24 ...
by kleshki
Mon Apr 15, 2024 10:58 pm
Forum: General
Topic: IKEv2 VPN with DNS in another internal VLAN
Replies: 1
Views: 201

IKEv2 VPN with DNS in another internal VLAN

... dhcp-options=clientid disabled=no interface=LAN /ip firewall address-list add address=*WHITE_IP* list=RealIP add address=10.100.0.0/16 list="Hairpin NAT" add address=10.10.0.0/16 list="Hairpin NAT" add address=192.168.188.0/24 list="Hairpin NAT" /ip firewall filter ...
by mktbm
Mon Apr 15, 2024 10:06 pm
Forum: Beginner Basics
Topic: Firewall NAT for DNS traffic not working [SOLVED]
Replies: 3
Views: 297

Re: Firewall NAT for DNS traffic not working [SOLVED]

Thank you for the help, adding the following rule solved the issue I was having.

/ip firewall nat
add action=masquerade chain=srcnat comment="hairpin NAT" dst-address=10.0.0.0/24 src-address=10.0.0.0/24
by anav
Mon Apr 15, 2024 8:07 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

Post your complete config minus the usual, please, the snippets you show are not useful without context of the rest of the config.
I also have my doubts as to complete success...........
by ilgmars
Mon Apr 15, 2024 7:47 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

All good points, thank you. Some of the configs got mangled when sanitizing :) So I got this fixed by monkeying around. Not sure about the exact mechanics for it, but the local network masquerade started to work after I added these 2 rules, address list entry and a route: > ip firewall/mangle/ print...
by anav
Sun Apr 14, 2024 11:56 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

... add action=drop chain=forward comment="Drop all else" /ip firewall nat add action=masquerade chain=srcnat comment=hairpin dst-address=192.168.88.0/24 src-address=192.168.88.0/24 add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface-list=WAN ...
by anav
Sun Apr 14, 2024 11:04 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

... or particular application. This occurs at layer2 and is oblivious to firewall rules etc......... just works. Server-LANIP : Port# 2. Next is the hairpin nat problem, you want users to access the Server by DYNDNS URL that identifies the public IP of the router. It could be a paid or free one available ...
by ilgmars
Sun Apr 14, 2024 7:35 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

... the network sorted than host a DNS server. b. if needing to access them by DYDNS URL (representing the WANIP of the local router ) then will need hairpin nat associated rules but would be much easier to create a separate subnet for servers.......... or users........ Yes, that is what I was thinking ...
by anav
Sun Apr 14, 2024 5:16 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

... a. why not access them by direct LANIP. b. if needing to access them by DYDNS URL (representing the WANIP of the local router ) then will need hairpin nat associated rules but would be much easier to create a separate subnet for servers.......... or users........ There is no circumstance here ...
by ilgmars
Sun Apr 14, 2024 4:39 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

Hi,
Thank you for your reply. Adding the details.

I think that this is the first schematic I have ever made :D
Hope that it is not too basic.
chrsetup-basic.jpg
I am selectively getting them to use the CHR Public address by adding routing rules.
by anav
Sun Apr 14, 2024 4:14 pm
Forum: Beginner Basics
Topic: Firewall NAT for DNS traffic not working [SOLVED]
Replies: 3
Views: 297

Re: Firewall NAT for DNS traffic not working [SOLVED]

... Try these changes first.................... If still not working please detail what doesn't work. Then next add this hairpin nat rule. /ip firewall nat add chain=srcnat action=masquerade src-address=10.0.0.0/24 dst-address=10.0.0.0/24
by anav
Sun Apr 14, 2024 1:47 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Re: Hairpin NAT over 2 WireGuard connected routers [SOLVED]

First will need both the CHR config and your home config /export file=anynameyouwish ( minus router serial number, any public WANIP information, keys etc.). Second are you getting your external users (that need access to the server on your home LAN) to use the public IP of the CHR. dyndnsURL:port# w...
by vingjfg
Sun Apr 14, 2024 1:40 pm
Forum: Beginner Basics
Topic: Firewall NAT for DNS traffic not working [SOLVED]
Replies: 3
Views: 297

Re: Firewall NAT for DNS traffic not working [SOLVED]

... 10.0.0.10 to the client, which expected a reply from 10.0.0.1. The client drops that datagram. If you *really* want to work that way, look into hairpin NAT.
by ilgmars
Sun Apr 14, 2024 12:10 pm
Forum: General
Topic: Hairpin NAT over 2 WireGuard connected routers [SOLVED]
Replies: 8
Views: 430

Hairpin NAT over 2 WireGuard connected routers [SOLVED]

... is being used as an internet gateway for some of the machines that sit on 192.168.88.0/24. Everything seems to be working as expected apart from hairpin-nat, when trying to reach locally hosted resources over public IP (Tried only via the CHR). The way the connection is set up for those machines ...
by AlexX9
Sun Apr 14, 2024 7:41 am
Forum: Beginner Basics
Topic: Low performance on RB5009 with machine behind NAT
Replies: 14
Views: 925

Re: Low performance on RB5009 with machine behind NAT

... the server is connected to is part of the default LAN bridge, if that's what you mean. I'm using defconf and have only enabled IPv6, added Hairpin NAT and some port forwards. If what you're asking is why I don't scan from within the same network then that's because I have firewalls upstream, ...
by anav
Sat Apr 13, 2024 3:22 am
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Nice to see you Sob!!
by Sob
Sat Apr 13, 2024 1:57 am
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Good news! If you have server in LAN1 (one subnet) and clients in LAN2 (another subnet), then the problem that's solved by hairpin NAT doesn't occur. So you don't need hairpin NAT. Your problem (aside from non-existent firewall filter section, but that's another story) is the mangle ...
by ringrring
Fri Apr 12, 2024 9:57 pm
Forum: Beginner Basics
Topic: port forwarding problem [SOLVED]
Replies: 21
Views: 1552

Re: port forwarding problem [SOLVED]

Thanks very much, yes I can see them using the IP addresses. I think I will continue to use that as hairpin is beyond my understanding and will be on the increasing pile of things to pick up later.
by anav
Fri Apr 12, 2024 8:21 pm
Forum: Beginner Basics
Topic: port forwarding problem [SOLVED]
Replies: 21
Views: 1552

Re: port forwarding problem [SOLVED]

... will not work without modifications. Easiest is to move users or server to different vlan. If you elect not to do that then you need to address a hairpin nat scenario. HAIRPIN NAT 1. Regardless of type of WAN connection, a single Source NAT rule is required. /ip firewall nat add chain=srcnat action=masquerade ...
by anav
Fri Apr 12, 2024 12:00 am
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Re: Hairpin NAT with 2 WAN static IP's and 2 LAN's

Well when you have to have a consistent config, and plan.
You are stuck between assigning subnets to ports, and having vlans.
Suggest if you are considering doing vlans, drop subnets to ports.
If not, then drop vlans.

Let me know which way you go as I dont want to waste time.
by chindo
Thu Apr 11, 2024 9:24 pm
Forum: General
Topic: Hairpin NAT with 2 WAN static IP's and 2 LAN's
Replies: 7
Views: 619

Hairpin NAT with 2 WAN static IP's and 2 LAN's

I know there are lots of posts about hairpin NAT but none of them seem to apply to my setup, so here goes. WAN1 - Ether1 Static Public IP 1.1.1.1 WAN2 - Ether2 Static Public IP 2.2.2.2 LAN1 - Ether6 10.0.15.0/24 LAN2 - Ether7 10.0.25.0/24 LAN3 ...
by llamajaja
Tue Apr 09, 2024 6:55 pm
Forum: General
Topic: Address list for dst nat
Replies: 10
Views: 434

Re: Address list for dst nat

... is that the port does not appear on scans, and instead of port visible and closed, it is simply not visible. An additional problem occurs for the hairpin nat case. Here you want to direct users ON THE SAME SUBNET as the Server, to the server via the WANIP, aka typically an easier to remember dyndns ...
by anovojr
Fri Apr 05, 2024 11:22 pm
Forum: Beginner Basics
Topic: Minecraft Server, SSH, etc... protocol issue with RouterOS v7
Replies: 2
Views: 823

Re: Minecraft Server, SSH, etc... protocol issue with RouterOS v7

Well, yeah the issue might be with the ISP, have you check it? For the SSH and RDP issues within your network, it seems like a case of hairpin NAT not being configured or working as intended. This is where traffic from your internal network to your public IP isn't being routed back correctly. ...
by mkx
Fri Apr 05, 2024 12:12 pm
Forum: General
Topic: Firewall/Routing Question
Replies: 19
Views: 776

Re: Firewall/Routing Question

No, hairpin NAT is not the problem here, communication between client on site B and server on Site A has to pass router (actually both of them) in both directions (if it doesn't, then one needs hairpin NAT). The problem here ...
by anav
Fri Apr 05, 2024 3:59 am
Forum: General
Topic: Firewall/Routing Question
Replies: 19
Views: 776

Re: Firewall/Routing Question

Hi Chechito not sure hairpin or what applies here, I get muddled trying to work my way through it.
by Josephny
Thu Apr 04, 2024 5:43 pm
Forum: General
Topic: Firewall/Routing Question
Replies: 19
Views: 776

Re: Firewall/Routing Question

... traffic for A.dyndns.org to be routed via the Wireguard interface? Then one has to deal with that traffic at arrival at Device A................ Hairpin NAT??? /ip dns static add regexp=["a.dyndns.org]" address=wireguardIP/32 No idea.
by llamajaja
Thu Apr 04, 2024 4:43 pm
Forum: General
Topic: Firewall/Routing Question
Replies: 19
Views: 776

Re: Firewall/Routing Question

... words any traffic queries for that URL should go through wireguard. Then one has to deal with that traffic at arrival at Device A................ Hairpin NAT??? /ip dns static add regexp=["a.dyndns.org]" address=wireguardIP/32 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
by CGGXANNX
Thu Apr 04, 2024 6:55 am
Forum: General
Topic: CCR2004-1G-12S+2XS: IPv4 routing performance less than IPv6?
Replies: 4
Views: 380

Re: CCR2004-1G-12S+2XS: IPv4 routing performance less than IPv6?

... of the other host. If that's the case it will be worsened by the fact that the router will even perform NAT on the packets due to the " hairpin NAT for bridge-10 " rule that you have in the firewall configuration. Side note: all the dst-nat rules for port forwarding to 10.10.10.251 ...
by burnduck
Wed Apr 03, 2024 1:31 pm
Forum: General
Topic: CCR2004-1G-12S+2XS: IPv4 routing performance less than IPv6?
Replies: 4
Views: 380

Re: CCR2004-1G-12S+2XS: IPv4 routing performance less than IPv6?

... log-prefix=rule20 /ip firewall nat add action=masquerade chain=srcnat out-interface=sfp28-1 add action=masquerade chain=srcnat comment="hairpin NAT for bridge-10" \ disabled=yes dst-address=10.10.10.0/23 src-address=10.10.10.0/23 add action=masquerade chain=srcnat comment="hairpin ...
by slaz
Mon Apr 01, 2024 6:47 pm
Forum: General
Topic: Wireguard connection broken
Replies: 3
Views: 257

Re: Wireguard connection broken

What is listening on IP address 192.168.200.1 and what on 192.168.200.11?: Line 458: add action=dst-nat chain=dstnat comment="Wireguard hairpin nat" !connection-bytes !connection-limit !connection-mark !connection-rate !connection-type !content disabled=no !dscp !dst-address dst-address-list=WANs ...
by erlinden
Mon Apr 01, 2024 6:44 pm
Forum: General
Topic: Wireguard connection broken
Replies: 3
Views: 257

Re: Wireguard connection broken

What is listening on IP address 192.168.200.1 and what on 192.168.200.11?: Line 458: add action=dst-nat chain=dstnat comment="Wireguard hairpin nat" !connection-bytes !connection-limit !connection-mark !connection-rate !connection-type !content disabled=no !dscp !dst-address dst-address-list=WANs ...
by slaz
Mon Apr 01, 2024 6:32 pm
Forum: General
Topic: Wireguard connection broken
Replies: 3
Views: 257

Wireguard connection broken

... action=drop chain=input in-interface-list=!LAN /ip firewall mangle add action=mark-connection chain=prerouting comment="Mark connections for hairpin NAT" dst-address-list=WANs new-connection-mark="Hairpin NAT" passthrough=yes src-address-list=LANs add action=mark-routing chain=prerouting ...
by tesme33
Fri Mar 29, 2024 9:16 am
Forum: Beginner Basics
Topic: 7.14.2 HAIRPIN working anywhere ?
Replies: 2
Views: 350

Re: 7.14.2 HAIRPIN working anywhere ?

Hi
thanks for the idea. Will try it. But for now i needed to switch back to my old router.
by CGGXANNX
Fri Mar 29, 2024 7:46 am
Forum: General
Topic: HowTo configure WireGuard in same subnet?
Replies: 3
Views: 477

Re: HowTo configure WireGuard in same subnet?

... subnet but then add a srcnat rule to the firewall, to masquerade connection from 172.17.20.0/24 into 10.0.0.0/16 (similar to what is done for Hairpin NAT). That way, when client from 172.17.20.0/24 access 10.0.0.0/16, the source address of the packet sent will be changed to the 10.0.0.1 address ...
by anav
Thu Mar 28, 2024 7:17 pm
Forum: Beginner Basics
Topic: 7.14.2 HAIRPIN working anywhere ?
Replies: 2
Views: 350

Re: 7.14.2 HAIRPIN working anywhere ?

... add action=drop chain=forward comment="drop all else" (2) Not sure if order is critical but best to do this.... ( fixed your hairpin rule as well) /ip firewall address-list add name=MYNETNAME list=M yWAN comment="dyndns from my IP Cloud settings" /ip firewall nat ...
by tesme33
Thu Mar 28, 2024 6:21 pm
Forum: Beginner Basics
Topic: 7.14.2 HAIRPIN working anywhere ?
Replies: 2
Views: 350

7.14.2 HAIRPIN working anywhere ?

... 7.14.2 onto my mikrotik router and i want to use it for internet access. As i have my mailserver at home i have some NAT what i also want to hairpin. i used the quickset on the WEB IF to make the initial config including the NAT i needed. And then i wanted to add HAIRPIN. I watched this video ...
by xstrid3rx
Tue Mar 26, 2024 9:48 pm
Forum: Wireless Networking
Topic: 7.14 breaks wifi
Replies: 8
Views: 782

7.14 breaks wifi

... comment="defconf: masquerade" \ ipsec-policy=out,none out-interface-list=WAN add action=masquerade chain=srcnat comment="HAIRPIN NAT" dst-address=\ 192.168.50.0/24 log-prefix=NAT src-address=192.168.50.0/24 add action=dst-nat chain=dstnat dst-port=6668 protocol=tcp ...
by anav
Mon Mar 25, 2024 3:22 pm
Forum: Beginner Basics
Topic: Hairpin NAT noob question
Replies: 3
Views: 382

Re: Hairpin NAT noob question

... (4) Now onto the port forwarding firewall rule is fine Format for hairpin is not quite correct. Typically its ( and no out interface nor protocol ) add action=masquerade chain=srcnat comment="Hairpin NAT" ...
by svenvg93
Mon Mar 25, 2024 3:04 pm
Forum: Beginner Basics
Topic: Hairpin NAT noob question
Replies: 3
Views: 382

Re: Hairpin NAT noob question

... add action=drop chain=input comment="Drop all else" /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" disabled=yes dst-address=172.16.10.3 out-interface-list=WAN protocol=tcp src-address=172.16.10.0/24 add action=masquerade chain=srcnat ...
by anav
Mon Mar 25, 2024 2:55 pm
Forum: Beginner Basics
Topic: Hairpin NAT noob question
Replies: 3
Views: 382

Re: Hairpin NAT noob question

Sorry your missing the complete config so unable to comment with certainty/
/export file=anynameyouwish ( minus router serial number, any public WANIP info, )
by svenvg93
Mon Mar 25, 2024 2:51 pm
Forum: Beginner Basics
Topic: Hairpin NAT noob question
Replies: 3
Views: 382

Hairpin NAT noob question

Hi All, Im trying to setup Hairpin NAT. So my lan clients can reach the server via the public domain name. I created a DNAT rules that works from the outside. But the hairpin nat rule that i made based on: https://help.mikrotik.com/docs/display/ROS/NAT#NAT-HairpinNAT ...
by Josephny
Sat Mar 23, 2024 10:23 pm
Forum: General
Topic: Where's my bottleneck?
Replies: 29
Views: 1601

Re: Where's my bottleneck?

... add action=drop chain=forward log=yes /ip firewall mangle add action=mark-connection chain=prerouting comment=\ "Mark connection for hairpin" disabled=yes dst-address-list=dynamic-WANIP \ log=yes new-connection-mark="Hairpin NAT" passthrough=yes src-address=\ 192.168.2.0/24 ...
by BinaryTB
Tue Mar 19, 2024 7:05 am
Forum: General
Topic: UPnP won't work after literal hours of trying - help pls!
Replies: 12
Views: 728

UPnP won't work after literal hours of trying - help pls!

... dynamic 0 ;;; defconf: masquerade chain=srcnat action=masquerade out-interface-list=WAN log=no log-prefix="" ipsec-policy=out,none 1 ;;; Hairpin NAT chain=srcnat action=masquerade src-address=192.168.1.0/24 dst-address=192.168.1.0/24 out-interface-list=LAN log=no log-prefix="" ...
by cosinguyen93
Sat Mar 16, 2024 7:16 pm
Forum: General
Topic: Port forwarding on multiple Mikrotik Routers with the same network mask
Replies: 4
Views: 603

Port forwarding on multiple Mikrotik Routers with the same network mask

... nat add action=masquerade chain=srcnat comment="Internet" out-interface=all-ppp add action=masquerade chain=srcnat comment="Hairpin" dst-address-list=lanAddresses src-address-list=lanAddresses add action=masquerade chain=srcnat out-interface=bridgeLAN <<< here It worked. ...
by MakroTok
Fri Mar 15, 2024 2:02 am
Forum: General
Topic: Hairpin NAT: Is there a simple solution?
Replies: 29
Views: 17113

Re: Hairpin NAT: Is there a simple solution?

For dynamic WANIPs the dst nat rule usually has something like in-interface-list=WAN, which we replace with dst-address-list=external_wan where externel_wan is a firewall address list entry with an address=DDNSname If you have public address directly on router, you can skip DDNS and use this as DHC...
by mkx
Wed Mar 13, 2024 3:33 pm
Forum: Beginner Basics
Topic: Redirect to external Public IP [SOLVED]
Replies: 19
Views: 2463

Re: Redirect to external Public IP [SOLVED]

The "red" traffic will likely only pass bi-directionally if you'll implement hairpin NAT for that "public to public" NAT. Without it, webserver 2 will try to reply to client (accessing abcabc.com:9999) directly, but client will reject this as it ...
by anav
Tue Mar 12, 2024 11:44 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

Hairpin via dns.................. Not a clue what it does though, assuming 192.168.88.68 is the IP of the server..... 3. DNS METHOD - AVOID NAT – REDIRECT LAN REQUEST VIA DNS Create the following rule! /ip dns static add address=192.168.88.68 ...
by mkx
Tue Mar 12, 2024 7:46 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

Well, in such a convoluted setup you'll have to think it out yourself. I'm not willing to guess the size of your problem and all the interactions.

But the fact is that NAT isn't exactly piece'a'cake in certain conditions.
by wcsnet
Tue Mar 12, 2024 6:52 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

the config files for applications get pushed globally both internal and external systems use them so one set of ports just makes for easier management
by mkx
Tue Mar 12, 2024 4:31 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

If servers need to communicate with each other, then ... I don't see why you couldn't configure them to communicate directly (over real ports)?
by wcsnet
Tue Mar 12, 2024 3:29 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

Okay that works, however what do I do with servers on the same subnet :shock:
by mkx
Tue Mar 12, 2024 12:58 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

... the best solution is to move server(s) into dedicated IP subnet. The dst-nat would then work the same way for both internet and LAN clients (no hairpin NAT necessary). BTW, DNS records have nothing to do with the way NAT is executed, NAT simply works on individual connections (and those are ...
by wcsnet
Tue Mar 12, 2024 10:47 am
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

Currently I have my local dns a records pointing to the router?
by wcsnet
Tue Mar 12, 2024 10:42 am
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

thanks @mkx

Sounds simple enough I how ever see one concern.
Some of my internal services run on different source ports and I would still require a dot-net to do the port translation

Example service runs on port 1050 and the clients use 5050
by HalfWolf
Tue Mar 12, 2024 8:58 am
Forum: Beginner Basics
Topic: RB4011 network setup for an apartment w/ dedicated server
Replies: 6
Views: 2237

Re: RB4011 network setup for an apartment w/ dedicated server

... - FT/CTF turned on implies that QoS/Bandwidth Limiting are ignored and I want to have the full bandwidth available for QoS/BW Limit working Hairpin/NAT Loopback - currently the only way I can connect from my PC to the server is to have a LAN IP entry for the domain the server is using in ...
by mkx
Mon Mar 11, 2024 7:38 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Re: Hairpin NAT using Local DNS

If you want to see actual source IP addresses, then you must not use hairpin NAT ... i.e. use split DNS where A record for public internet points at your router's WAN IP address (and plain dst-nat is enough to have connection working). And A record for "same ...
by wcsnet
Mon Mar 11, 2024 6:43 pm
Forum: General
Topic: Hairpin NAT using Local DNS
Replies: 9
Views: 587

Hairpin NAT using Local DNS

... some web services I run the source ip address is extremely important. These web services run both internal and external to the network. When using hairpin nat (src-nat -> masquerade ) I obviously lose the ability to see the source ip address. Is there I way I can use the static dns entries on the ...
by lanslot
Mon Mar 11, 2024 3:20 pm
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

I raised the issue in both places. Thank you both!
by lanslot
Mon Mar 11, 2024 3:17 pm
Forum: General
Topic: Feature requests
Replies: 1742
Views: 637689

Re: Feature requests

Currently UPnP and Hairpin NAT does not work together. It is because the dynamic dst-nat rules created by UPnP has the in-interface=<external> filter. It would be nice to remove this filter from dynamic rules created UPnP, either by ...
by tangent
Mon Mar 11, 2024 7:41 am
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

by TheCat12
Mon Mar 11, 2024 7:29 am
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

by lanslot
Mon Mar 11, 2024 12:32 am
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

Thanks for confirming! Do you by any chance know how to submit feature requests to MikroTik? It would be nice for them to add a config option to remove the in-interface=ether1 filter from dynamic dst-nat rules. Unfortunately, yes. And the only workaround I see is to make the addresses of the UPnP en...
by TheCat12
Sun Mar 10, 2024 10:35 pm
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

Is my understanding above correct? Unfortunately, yes. And the only workaround I see is to make the addresses of the UPnP enabled devices static and add your dst-nat rules before the dynamic ones because, as you're probably familiar with, rules are processed in ascending order relative to their pla...
by lanslot
Sat Mar 09, 2024 6:15 pm
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

... this didn't work. I think the problem is in the dst-nat rule #3, not in the src-nat rules. Here is my understanding of the packet flow for Hairpin NAT (Scenario A): Say a LAN client at 192.168.1.100 sends a TCP SYN packet to my web server at <WAN_IP>:80 The packet enters the router at the ...
by anav
Fri Mar 08, 2024 6:33 pm
Forum: General
Topic: WireGuard help needed [SOLVED]
Replies: 3
Views: 699

Re: WireGuard help needed [SOLVED]

... in the Forward Chain vice DSTNAT ?? 7. Not sure why you are mangling or using UPNP for that matter. I would remove it and use the normal sourcenat hairpin rule. add chain=srcnat action=masquerade src-adddress=192.168.1.0/24 dst-address=192.168.1.0/24 Edit; Ahh I see you already have it in place, ...
by RhoAius
Fri Mar 08, 2024 2:06 pm
Forum: Beginner Basics
Topic: Port forwarding & PPPoE "Bridge"
Replies: 2
Views: 332

Re: Port forwarding & PPPoE "Bridge"

... Yes you can with port forwarding Do a dstnat and the "to Address" field should be the ip of the module 10.10.1.1 You will need "Hairpin NAT" if you want to access the status page via the dstnat from within the network
by mbovenka
Fri Mar 08, 2024 1:49 pm
Forum: SwOS
Topic: Loopback not working CRS305-1G-4S+IN
Replies: 7
Views: 3489

Re: Loopback not working CRS305-1G-4S+IN

... looking up the domain name from the inside gives you the internal address, and doing so from the outside gives you the external address. 2) Proper hairpin NAT, so that packets from the inside to your external address get bounced to the internal address. Either way the CRS305 has nothing to do with ...
by TheCat12
Thu Mar 07, 2024 11:04 pm
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

Re: UPnP and Hairpin NAT

Maybe change action=masquerade and set dst-address to be the one of the server on the hairpin nat rule as well as on the defconf rule unless there is a reason to be src-nat:
/ip firewall nat
set 0 action=masquerade src-address=""
set 1 action=masquerade dst-address=192.168.1.2
by TheCat12
Wed Mar 06, 2024 5:13 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

@adispy My bad, it's not possible to list out separate ports in the to-ports section. You can leave it blank and the rule will work as intended.
by adispy
Wed Mar 06, 2024 5:07 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

Thank you very much for your help guys. In the end I followed DeadStik advice and by removing the In. Interface from the DST-NAT rule, the HairPin NAT started working. @ TheCat12 just curious how you manage to put those ports in the to-ports section of the rule, because it does not let me. ...
by TheCat12
Wed Mar 06, 2024 4:12 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

... in-interface=RDS_PPOE_01 dst-port=443,80,8080,8443 log=no log-prefix="" Secondly, I think the problem is that the Hairpin NAT rule is before the dst-nat rule whereas it should be the opposite because rules in Mikrotik are processed in ascending order (from top to ...
by adispy
Wed Mar 06, 2024 8:22 am
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

Sorry about that. Here it is. PUBLIC IP 1 - main IP for internet connection PUBLIC IP 2 - second public IP for my email and web services 0 ;;; HairPin NAT chain=srcnat action=masquerade protocol=tcp src-address=192.168.10.0/24 dst-address=192.168.10.10 log=no log-prefix="" 1 ;;; defconf: ...
by anav
Wed Mar 06, 2024 12:50 am
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

Yes its your config, which we know nothing about and thus cannot comment on
by DeadStik
Tue Mar 05, 2024 5:38 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

More likely your DST-NAT rule is not working as you intended. Using in-interface or in-interface-list limits the rules to those interfaces which local users do not reach.
by lanslot
Tue Mar 05, 2024 4:53 pm
Forum: General
Topic: UPnP and Hairpin NAT
Replies: 7
Views: 791

UPnP and Hairpin NAT

Hi there, I am having some trouble getting UPnP and Hairpin NAT to work together. Can you help? NAT is working for my web server with src-nat rule #0 in the config and dst-nat rule #2 Hairpin NAT is also working for devices on the LAN to access the ...
by adispy
Tue Mar 05, 2024 12:21 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

Thanks for the reply, but it's still not working. 0 ;;; HairPin NAT chain=srcnat action=masquerade protocol=tcp src-address=192.168.10.0/24 dst-address=192.168.10.254 log=no log-prefix="" I have also tried putting 192.168.10.10 as the dst-address ...
by jjmuriel
Tue Mar 05, 2024 1:42 am
Forum: General
Topic: DHCP deassigned/assigned log message [VLAN Switch - RB3011] [SOLVED]
Replies: 3
Views: 1062

DHCP deassigned/assigned log message [VLAN Switch - RB3011] [SOLVED]

... LAN de NTP (UDP-123) a enrutador." dst-port=123 \ protocol=udp src-address=192.168.111.0/24 add action=masquerade chain=srcnat comment="Hairpin NAT para HA" dst-address=\ 192.168.30.10 src-address-list=HA_CON add action=dst-nat chain=dstnat comment="HA Yellow-Acceso desde Internet" ...
by anav
Mon Mar 04, 2024 10:57 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

out-interface=LAN is not required.
by TheCat12
Mon Mar 04, 2024 10:45 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

Re: HairPin NAT not working [SOLVED]

The second rule is almost correct, provided that dst-address is the one to which you want to hairpin nat and you've made the rest of your configurarion properly as @anav already said: /ip firewall nat add chain=srcnat action=masquerade src-address=192.168.10.0/24 dst-address=192.168.10.254 ...
by adispy
Mon Mar 04, 2024 5:51 pm
Forum: General
Topic: HairPin NAT not working [SOLVED]
Replies: 10
Views: 757

HairPin NAT not working [SOLVED]

Hello everyone, I am trying to set up my hairpin NAT but no matter what I do can't seem to make it work. I have two PPPOE WAN IPs and I have tried using: 0 chain=srcnat action=masquerade src-address=192.168.10.0/24 dst-address=192.168.10.0/24 ...
by jaclaz
Thu Feb 29, 2024 4:57 pm
Forum: Beginner Basics
Topic: Setting up port forwarding
Replies: 5
Views: 457

Re: Setting up port forwarding

... are trying from another connection through internet it should be enough. If you are trying from the same network, then you will need additionally hairpin NAT: https://help.mikrotik.com/docs/display/ROS/NAT#NAT-HairpinNAT
by baragoon
Thu Feb 29, 2024 3:44 pm
Forum: Beginner Basics
Topic: Setting up port forwarding
Replies: 5
Views: 457

Re: Setting up port forwarding

Hairpin NAT
by DeadStik
Wed Feb 28, 2024 7:08 pm
Forum: Beginner Basics
Topic: DNS Redirect Sanity Check [SOLVED]
Replies: 3
Views: 408

Re: DNS Redirect Sanity Check [SOLVED]

If the DNS server is in the same IP scope, it would be broken without the masquerade rule. This is the same issue as Hairpin NAT.

If you use an IP outside of your LAN IP scope, there is no need for the rule as the packets would return to the router already.
by Amm0
Mon Feb 26, 2024 7:48 pm
Forum: General
Topic: What happened to anav and "The DEFACTO DEFAULT FIREWALL Setup"
Replies: 18
Views: 1120

Re: What happened to anav and "The DEFACTO DEFAULT FIREWALL Setup"

... not steps. e.g. even after much reading, still not find the perhaps 5-10+ lines of config to adapt the default firewall for SOHO things like hairpin NATs or blocking inter-VLAN routing. And that's if you figured out VLAN bridging first. A SOHO user may lack networking knowledge, but may be ...
by MTNick
Sun Feb 25, 2024 12:27 am
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

You're right, the Hairpin NAT has 0 traffic in the counters. So, it's not needed. Tested, proved lol If access using LAN is working, I'd say the OP is wrapped up. OP stated external access is good. Now internal access is as well. The ...
by Mesquite
Sat Feb 24, 2024 8:39 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

... similar in concept to what you have offered, but since I dont understand it at all,,,,,,, just putting it out there. I don't even think you need hairpin nat rule with this one. For the example 192.168.88.68 is the local LAN server IP and myserver is the domain name. Create the following rule! ...
by MTNick
Sat Feb 24, 2024 7:53 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

... port 443. In the test router, the following NAT rules are applied: /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=192.168.88.0/24 protocol=tcp src-address=192.168.88.0/24 add action=dst-nat chain=dstnat comment="Server - HTTPS" ...
by MTNick
Sat Feb 24, 2024 4:34 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

... users using the DOMAIN name Do NOT reach the servers Exactly. It seems counter-intuitive to me, but that's, what it is. The above points to the hairpin NAT rule. The domain name shouldn't be needed in the address list. But I see what's trying to be accomplished. Has a static DNS been attempted ...
by MTNick
Sat Feb 24, 2024 5:32 am
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

... nat add action=masquerade chain=srcnat comment="ISP Masquerade" out-interface-list=WAN add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address-list=expected-address-from-LAN out-interface-list=LAN protocol=tcp src-address-list=expected-address-from-LAN add action=dst-nat ...
by MTNick
Sat Feb 24, 2024 4:25 am
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

Hi Mesquite. Stop yelling at me lmao (1) The hairpin nat rule is port/protocol agnostic. Not required. He has the correct rule. ----- Didn't know this. But still, this rule works haha. (2) The dstnat (port forwarding rules) can very much so have ...
by Mesquite
Sat Feb 24, 2024 4:07 am
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

Hey MTNICK. (1) The hairpin nat rule is port/protocol agnostic. Not required. He has the correct rule. (2) The dstnat (port forwarding rules) can very much so have a different dst port, the one hitting the router, and a to-port the ...
by MTNick
Sat Feb 24, 2024 3:46 am
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP

Hello atais & Mesquite. Hoping I can help out on this one. Looking at the Hairpin NAT rule. It's missing the protocol & you might as well add the out-interface-list=LAN. I've got the same scenario that's been working well for a long time. I can access my ...
by Mesquite
Wed Feb 21, 2024 11:10 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS

... firewall rule allowing port forwarding add chain=forward action=accept connection-nat-state=dstnat comment="port fowarding" You need a hairpin nat source nat rule in case you want internal users to be able to access the server by the WANIP or DNS name. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
by Mesquite
Tue Feb 20, 2024 9:00 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS

... and get port forwarded to the router. dst-address=actual WANIP for static, in-interface=WAN for dynamic. ( dst-address-list=some dyndns URL for hairpin) OR you connect directly to the LANIP of the server from internally. THere is no such thing or even a good idea to connect using the interface ...
by Mesquite
Tue Feb 20, 2024 6:08 pm
Forum: Beginner Basics
Topic: Problem with port forwarding on L009UiGS, double NAT, dynamic WANIP
Replies: 39
Views: 1887

Re: Problem with port forwarding on L009UiGS

... IP address as if you were coming in from externally. Boggles my mind, why not just use the LANIP address LOL. In any case you are running into hairpin NAT. 1. Solved partially by adding this sourcenat rule put at the top of the order add action=srcnat chain=masquerade src-address=192.168.88.0/24 ...
by optio
Mon Feb 19, 2024 5:46 pm
Forum: Beginner Basics
Topic: Pihole - NAT firewall Rule not redirected static DNS [SOLVED]
Replies: 3
Views: 849

Re: Pihole - NAT firewall Rule not redirected static DNS [SOLVED]

This doesn't make sense since have hairpin dst-nat NAT rule for all outgoing DNS traffic from LAN to Pi-hole unless Chrome is performing DoH request to Google DNS when is set manually and that bypasses router NAT rules. Did you try with other ...
by Kataius
Sun Feb 18, 2024 12:03 am
Forum: Beginner Basics
Topic: Pihole - NAT firewall Rule not redirected static DNS [SOLVED]
Replies: 3
Views: 849

Pihole - NAT firewall Rule not redirected static DNS [SOLVED]

... protocol=tcp src-address-list=!excluded \ to-addresses=192.168.55.55 to-ports=53 add action=masquerade chain=srcnat comment="PiHole hairpin NAT" dst-address=\ 192.168.55.55 dst-port=53 protocol=udp src-address-list=filtered add action=masquerade chain=srcnat comment="PiHole ...
by bpwl
Thu Feb 15, 2024 10:37 pm
Forum: Beginner Basics
Topic: Accessing / pinging another subnet on the same router
Replies: 1
Views: 278

Re: Accessing / pinging another subnet on the same router

... subnet range Some reading : https://forum.mikrotik.com/viewtopic.php?t=201448 If you still want to have it on one L2 network, start reading about Hairpin NAT in this Forum
by PhilipPeake
Wed Feb 14, 2024 10:09 pm
Forum: Beginner Basics
Topic: Help with traffic forwarding
Replies: 4
Views: 463

Re: Help with traffic forwarding

... add action=masquerade chain=srcnat comment="WG-UK VPN" out-interface=\ wireguard2 add action=masquerade chain=srcnat comment=\ "Hairpin - Loopback for external address" dst-address=10.0.0.0/24 \ src-address=10.0.0.0/24 add action=dst-nat chain=dstnat comment="Camera ...
by PhilipPeake
Wed Feb 14, 2024 6:57 pm
Forum: Beginner Basics
Topic: Help with traffic forwarding
Replies: 4
Views: 463

Re: Help with traffic forwarding

... add action=masquerade chain=srcnat comment="WG-UK VPN" out-interface=\ wireguard2 add action=masquerade chain=srcnat comment=\ "Hairpin - Loopback for external address" dst-address=10.0.0.0/24 \ src-address=10.0.0.0/24 add action=dst-nat chain=dstnat comment="Camera ...
by TheIBM
Sun Feb 11, 2024 4:40 am
Forum: Forwarding Protocols
Topic: Dual WAN but second WAN only working inbound
Replies: 9
Views: 1108

Re: Dual WAN but second WAN only working inbound

... now I can't get past the router DMZ address from the LAN. I've tried umpteen configurations to no avail. Gone round in circles actually. I tried hairpin and simple routing. If I get one side working it breaks the other. Rather than share a clearly incorrect set of configs can anyone share a working ...
by patrikg
Wed Feb 07, 2024 9:44 am
Forum: General
Topic: problem connection home automation app
Replies: 2
Views: 288

Re: problem connection home automation app

When i read this, something says me that your app even tries to connect to your wan ip.
If so you should look and enable the function hairpin nat.

https://help.mikrotik.com/docs/display/ ... HairpinNAT
by Mesquite
Mon Feb 05, 2024 5:21 pm
Forum: Beginner Basics
Topic: Apache on public IP ( Forwarding )
Replies: 9
Views: 586

Re: Apache on public IP ( Forwarding )

... not static. Please confirm if your IP indeed does not change. If it indeed static, vingjfg dst-nat rules are correct. I personally prefer a wider hairpin nat rule, to account for potentially more servers and users involved. To- ports are not required if same as dst-ports. Finally if static, then ...
by vingjfg
Mon Feb 05, 2024 12:32 pm
Forum: Beginner Basics
Topic: Apache on public IP ( Forwarding )
Replies: 9
Views: 586

Re: Apache on public IP ( Forwarding )

... all I asked. Regarding your test, I suspect you are trying from the same network as your server is on. This cannot work as is, as this needs hairpin NAT. For all to work correctly, your NAT rule should look like this. Replace <PUBLIC IP> with your actual public IP. /ip firewall nat add action=masquerade ...
by vingjfg
Sun Feb 04, 2024 10:03 am
Forum: Beginner Basics
Topic: Apache on public IP ( Forwarding )
Replies: 9
Views: 586

Re: Apache on public IP ( Forwarding )

... internal server (note: using the real IP, not the external)? Lastly, if you try from the inside using the external IP, you will need to set up a hairpin NAT, which I do not see in your configuration. Regarding the source NAT: the in-interface describes the interface which receives the packet ...
by schoudhry
Sun Feb 04, 2024 12:49 am
Forum: Beginner Basics
Topic: MikroTik WebFig Not Working With SSL/TLS enabled
Replies: 23
Views: 4501

Re: MikroTik WebFig Not Working With SSL/TLS enabled

... to the correct local ip addresses in Adguard (or whatever DNS server in use) Port forward 80 and 443 to NGINX proxy on the WAN interface Have hairpin NAT rule. I added x.x.x.x/24 to x.x.x.x/24 for all ports Generated Let's Encrypts certificates through NGINX. Then exported and imported into ...
by gabrielrocha
Tue Jan 30, 2024 1:17 am
Forum: General
Topic: Can't reach site hosted on the same AS
Replies: 4
Views: 380

Re: Can't reach site hosted on the same AS

You need a HairPin NAT. https://help.mikrotik.com/docs/display/ROS/NAT (about a quarter of the way down the page) Edit: I misread the question (that's what I get for doing it FAST), so this answer is not likely what you need... ...
by k6ccc
Tue Jan 30, 2024 12:47 am
Forum: General
Topic: Can't reach site hosted on the same AS
Replies: 4
Views: 380

Re: Can't reach site hosted on the same AS

You need a HairPin NAT.
https://help.mikrotik.com/docs/display/ROS/NAT (about a quarter of the way down the page)

Edit: I misread the question (that's what I get for doing it FAST), so this answer is not likely what you need... sorry.
by mkx
Sun Jan 28, 2024 12:12 pm
Forum: General
Topic: Reverse Porxy doesn't work without 2nd masquerading for specific IP
Replies: 1
Views: 268

Re: Reverse Porxy doesn't work without 2nd masquerading for specific IP

... NAT device. As client originally started connection towards WAN IP, reply from server's LAN IP is not valid. One of solutions is implementation of hairpin-NAT and your second src-nat rule is a variation of it. One of side effects of hair-pin nat is that all connections appear to come from router ...
by adispy
Thu Jan 25, 2024 12:05 pm
Forum: General
Topic: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]
Replies: 12
Views: 905

Re: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]

... 6. Set you masquerading rule to send traffic only on the first public IP/PPPOE connection. This will cause another problem with the hairpin NAT rule if you have one, in that it is not going to work anymore. 4.png It should work now, your internal server should get the public IPs ...
by adispy
Wed Jan 24, 2024 10:28 am
Forum: General
Topic: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]
Replies: 12
Views: 905

Re: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]

One other thing that I have noticed is that if I masquerade just one public IP (primary one) the hairpin NAT rules is not working anymore.
by adispy
Wed Jan 24, 2024 10:12 am
Forum: General
Topic: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]
Replies: 12
Views: 905

Re: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]

... protocol=tcp dst-address=<PUBLIC_IP_02> connection-mark="" in-interface=RDS_PPOE_02 dst-port=80,443 log=no log-prefix="" 5 ;;; Hairpin NAT Sophos Proxy chain=dstnat action=dst-nat to-addresses=192.168.10.10 protocol=tcp src-address=192.168.10.0/24 dst-address=<PUBLIC_IP_01> ...
by adispy
Tue Jan 23, 2024 2:28 pm
Forum: General
Topic: Mikrotik D-NAT from two public PPPOE IPs [SOLVED]
Replies: 12
Views: 905

Mikrotik D-NAT from two public PPPOE IPs [SOLVED]

... connection-nat-state=!dstnat \ connection-state=new in-interface-list=WAN /ip firewall nat add action=dst-nat chain=dstnat comment="Hairpin NAT Sophos Proxy" \ dst-address-list=!192.168.10.254 dst-address-type=local dst-port=80,443 \ protocol=tcp src-address=192.168.10.0/24 ...
by system7
Sun Jan 21, 2024 6:47 pm
Forum: General
Topic: Port forward does not work on L009
Replies: 3
Views: 531

Port forward does not work on L009

... W/ this rule, I should see my web server from outside the network, sadly I cannot! BUT if I add another rule what is for - as I know - for hairpin (to see my website inside the network) add action=masquerade chain=srcnat dst-port=443 protocol=tcp So, if I add these rules, after that I can ...
by vingjfg
Sun Jan 21, 2024 4:01 pm
Forum: Beginner Basics
Topic: Need some config help
Replies: 5
Views: 730

Re: Need some config help

... host routes (my preferred version but that's personal). For the NAT configuration, there are some issues, see the corrections below. There is no hairpin NAT, so you won't be able to reach the servers using the public IP. This explains why you connect to the device when you use the public IP addresses. ...
by anav
Fri Jan 19, 2024 11:30 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

Glad its working for you!!
by OctarineGlow
Fri Jan 19, 2024 9:06 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

Ah, thanks so much y'all! Turns out it my issue was the in-interface-list=WAN in the original dst-nat rule. I got a real kick out of Sob's bit there, it's foolproof, you can't mess it up (ok, I know I underestimate creativity of some people) But here we are. The final working rules are chain=dstnat ...
by jaclaz
Fri Jan 19, 2024 3:29 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

The whole post by Sob:
viewtopic.php?t=179343#p892135
by anav
Fri Jan 19, 2024 2:50 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

... nats the traffic from 192.168.88.1 to the original 192.168.88.5 and the packet arrives at the client and is accepted. Finally this explanation on hairpin nat from MKX is invaluable! Standard SRC-NAT is masquerading source address and standard DST-NAT is masquerading destination address . And hairpin ...
by sergeyseleznev
Fri Jan 19, 2024 11:52 am
Forum: General
Topic: IPv6 NAT: no access from LAN using public IP
Replies: 1
Views: 541

IPv6 NAT: no access from LAN using public IP

... but I want to use the public DNS name always to avoid TLS issues. As far as I understand, in IPv4 this problem can be solved by hairpin NAT. However, I couldn't manage to implement it with IPv6 and I'm not sure it's even applicable here. Thanks in advance for your help!
by OctarineGlow
Fri Jan 19, 2024 12:13 am
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

Anav, it's quite possible this is a foolish way to solve things. Currently, local users can access the site just fine through the LANIP, and I can access it on the desktop through localhost. I'd mostly prefer the consistency of having only one address. Hosting it on a different device on a different...
by anav
Thu Jan 18, 2024 5:34 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

Yes, nothing like a short video showing how the electrons are moving about, with some appropriate IPs, and text, would make it crystal clear, but I dont have those skill sets. I relied on explanations from others like MKX, to help understand. Its not something that sticks and have to relearn every t...
by tangent
Thu Jan 18, 2024 5:15 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

The difficult bit isn't regurgitating canned examples into the CLI, it's understanding what it does. Case in point, this thread's OP. :)
by anav
Thu Jan 18, 2024 4:59 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

There we disagree,
add chain=srcnat action=src-nat dst-address=SubnetofServer src-address=SubnetofServer

Is tres simple!! In zyxel speak, there was a checkbox called loopback to enable. Never knew what it was for until I started using MT devices.
by tangent
Thu Jan 18, 2024 4:30 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

... away is rare, so it costs me nearly nothing to switch the URLs when needed. My broader point is, for some applications, the automatic magic of hairpin NAT isn't pulling its own weight in terms of the complexity it adds to the router's configuration, so why add it?
by anav
Thu Jan 18, 2024 4:21 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

So you are using an application to do this???? Me is confused. My impression then was incorrect. I thought you were using a. mynetname or some other dyndns URL when external to the router to access your server AND b. you were able to construct an internal URL of sorts ( a way of pointing to the inte...
by tangent
Thu Jan 18, 2024 3:56 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

... site, I'd keep two different bookmarks in my browser, selected depending on where I am at the moment. Yes, these methods require a bit of thought. Hairpin NAT saves you from having to think about it, but I don't think it's worth the bother, in the main.
by anav
Thu Jan 18, 2024 3:39 pm
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

... there are a variety of reasons. What you are suggesting is KEEP the NAME method but NOT to use the external WANIP and this quite neatly avoids the hairpin nat problem. I also recommend simply moving the server or users to different subnet also avoiding the issue ( vlans are what .0001c - cheap) ...
by mkx
Thu Jan 18, 2024 9:27 am
Forum: Beginner Basics
Topic: Port Forwarding to Reverse Proxy Not Working
Replies: 1
Views: 629

Re: Port Forwarding to Reverse Proxy Not Working

... or out-interface instead of lists, then it's the out-interface-list=WAN which should be removed). As to the problem: you need to implement hairpin NAT . Without it, in your case, packets from client towards server go via router (who does port forwarding), but return packets go directly ...
by tangent
Thu Jan 18, 2024 8:32 am
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

Re: NAT Hairpin Configuration Troubles

... covers the example's 10.0.0.3 host and anything else inside the example's private LAN. If you have only one host inside the private LAN that needs hairpinning, you could write this example's rule as "10.0.0.3/32" instead. I'm afraid I just don't have that firm a grasp on it, though. Hairpinning ...
by OctarineGlow
Thu Jan 18, 2024 12:31 am
Forum: General
Topic: NAT Hairpin Configuration Troubles
Replies: 13
Views: 1119

NAT Hairpin Configuration Troubles

... DNAT worked like a charm, and the website's address resolves just fine outside of my LAN, but I'm having trouble interpreting the documentation on hairpin NATs. The example in the documentation is: /ip firewall nat add chain=dstnat action=dst-nat dst-address=172.16.16.1 dst-port=443 to-addresses=10.0.0.3 ...
by fionaellie
Wed Jan 17, 2024 12:30 am
Forum: Beginner Basics
Topic: Yet another new user with ddns issues :?
Replies: 0
Views: 679

Yet another new user with ddns issues :?

... DDNS (Cloudflare). I have checked to be sure the a record is indeed the same as the public IP. I have a feeling my issue is related to the way hairpin NAT is configured. [admin@MikroTik] > ip firewall nat print Flags: X - disabled, I - invalid; D - dynamic 0 D ;;; back-to-home-vpn chain=srcnat ...
by Spaider
Mon Jan 15, 2024 6:31 pm
Forum: General
Topic: Forward WAN port to another subnet/router LAN [SOLVED]
Replies: 8
Views: 2055

Re: Forward WAN port to another subnet/router LAN [SOLVED]

... firewall nat add action=masquerade chain=srcnat disabled=yes out-interface=wg2 /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT for Home Assistant" dst-address=192.168.88.60 dst-port=443,8123 log-prefix=hair-pin protocol=tcp src-address=192.168.88.0/24 /ip firewall ...
by Pillendreher
Mon Jan 15, 2024 9:13 am
Forum: Beginner Basics
Topic: NGINX Proxy Manager & RouterOS
Replies: 11
Views: 5280

Re: NGINX Proxy Manager & RouterOS

Thanks! Just fyi: I got it to work by creating the hairpin NAT rule like this:

https://superuser.com/questions/663820/ ... airpin-nat

Hope that works for you as well :D
by henkieb
Sun Jan 14, 2024 1:24 pm
Forum: Beginner Basics
Topic: Remote acces to webinterface
Replies: 10
Views: 1249

Re: Remote acces to webinterface

Hairpin is only in case of the internal server cannot be reached from the LAN side right? My problem is only from the WAN side. From LAN 192.168.88.50/console works fine, from WAN external ip:8091/console the server (which ...
by gigabyte091
Sun Jan 14, 2024 5:19 am
Forum: Beginner Basics
Topic: Remote acces to webinterface
Replies: 10
Views: 1249

Re: Remote acces to webinterface

Public IP (that was the previous way) and they would like to keep it that way
Well in that case you need something called hairpin nat: https://forum.mikrotik.com/viewtopic.php?t=172380
by anav
Thu Jan 11, 2024 2:34 am
Forum: Beginner Basics
Topic: Difficulty Configuring Port Forwarding on RouterOS for Website Hosting
Replies: 2
Views: 644

Re: Difficulty Configuring Port Forwarding on RouterOS for Website Hosting

A couple of pointers on the last post. 1. The dst-nat rule does not require dst-address-type=local . 2 The general hairpin nat rule that will cover all servers in a subnet, or if just one............ one rule. add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address= ...
by MTNick
Wed Jan 10, 2024 11:56 pm
Forum: Beginner Basics
Topic: Difficulty Configuring Port Forwarding on RouterOS for Website Hosting
Replies: 2
Views: 644

Re: Difficulty Configuring Port Forwarding on RouterOS for Website Hosting

... protocol=tcp to-addresses=Local.Server.IP If your trying to access the server from your LAN/wifi, using the external website address, add the Hairpin NAT as well (don't forget to edit & add your network/server/ISP info): /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin ...
by dalben
Wed Jan 10, 2024 1:10 am
Forum: Beginner Basics
Topic: NGINX Proxy Manager & RouterOS
Replies: 11
Views: 5280

Re: NGINX Proxy Manager & RouterOS

... Container running on my Unraid server. Everything works when accessing from WAN, but unfortunately not when connecting from LAN. I even added an Hairpin NAT rule , yet that didn't work either. Did you set the rules up in Adguard Home? Yep, setup the rules in AGH / Filters / DNS rewrites. Pointed ...
by Pillendreher
Tue Jan 09, 2024 11:47 pm
Forum: Beginner Basics
Topic: NGINX Proxy Manager & RouterOS
Replies: 11
Views: 5280

Re: NGINX Proxy Manager & RouterOS

... Container running on my Unraid server. Everything works when accessing from WAN, but unfortunately not when connecting from LAN. I even added an Hairpin NAT rule , yet that didn't work either. Did you set the rules up in Adguard Home?
by Rihards9229
Mon Jan 08, 2024 7:50 pm
Forum: Beginner Basics
Topic: port forwarding
Replies: 61
Views: 4360

Re: port forwarding

... is critical, but its also very smart to organize chain rules together for easy reading to spot errors etc................ (3) I see you have a hairpin SourceNat Rule which tells me you have users on the same subnet as your server and you want them to use the dyndns name vice the direct LANIP ...
by anav
Mon Jan 08, 2024 6:35 pm
Forum: Beginner Basics
Topic: port forwarding
Replies: 61
Views: 4360

Re: port forwarding

... is critical, but its also very smart to organize chain rules together for easy reading to spot errors etc................ (3) I see you have a hairpin SourceNat Rule which tells me you have users on the same subnet as your server and you want them to use the dyndns name vice the direct LANIP ...
by k6ccc
Fri Jan 05, 2024 6:52 pm
Forum: Beginner Basics
Topic: Home web address goes to router.
Replies: 2
Views: 1061

Re: Home web address goes to router.

The Hairpin is used so that you can access the server from your local LAN using the public IP address or URL. To get port 80 to forward to the server you need a Destination NAT add action=dst-nat chain=dstnat comment="Web ...
by vingjfg
Fri Jan 05, 2024 6:47 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

I think you meant SERVER!
Correct, server not router.
by robmaltsystems
Fri Jan 05, 2024 5:45 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Thanks everyone for their input here. Fascinating subject. I will return to this soon as I'm like a dog with a bone on things like this. Probably spend hours learning (which is good) for a real edge case. But then again, I spent hours bringing a 10 year old laptop back to life!
by letmeout
Fri Jan 05, 2024 5:37 pm
Forum: General
Topic: Port forward to reverse proxy only works from outside LAN
Replies: 3
Views: 1367

Re: Port forward to reverse proxy only works from outside LAN

You need to add hairpin NAT if you want DNS lookups on dstnat IPs to work from the inside.
I tried but it didn't work
Image

im not shure how to setet corect
by anav
Fri Jan 05, 2024 5:16 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

... has a typo...... Lastly, You may opt to isolate the router on its own subnet. In that case, only the dstnat is needed as you are no longer doing a hairpin NAT. This would be my recommended solution as currently, you have a server directly reachable from the internet sitting in the middle of your ...
by kd2om
Fri Jan 05, 2024 5:08 pm
Forum: Beginner Basics
Topic: Home web address goes to router.
Replies: 2
Views: 1061

Home web address goes to router.

I am hosting a webpage on my network, I have added the Hairpin rule, which seems to work as I can connect to the webpage from a pc on my lan. This only works if I set the webserver to a port other than 80. When set to 80 I get the router home page. ...
by vingjfg
Fri Jan 05, 2024 2:14 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

/ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" connection-mark="Hairpin NAT" log-prefix="Hairpin NAT Masquerade" add action=masquerade chain=srcnat comment="Default NAT Masquerade" out-interface=ether1.12 ...
by robmaltsystems
Thu Jan 04, 2024 11:10 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Here is what it worked for me: And it worked for me on the DoH laptop.... I can see exactly what it's doing. Using mangle to mark packets from the LAN to the WAN which is then processed by the srcnat rule. Learning a lot here. Just need to zap my internal DNS zone record to make sure it works for c...
by tangent
Thu Jan 04, 2024 11:01 pm
Forum: General
Topic: Port forward to reverse proxy only works from outside LAN
Replies: 3
Views: 1367

Re: Port forward to reverse proxy only works from outside LAN

You need to add hairpin NAT if you want DNS lookups on dstnat IPs to work from the inside.
by robmaltsystems
Thu Jan 04, 2024 8:14 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

I was about to ask if somebody minded posting their firewall config that's using hairpin :D
by anthonws
Thu Jan 04, 2024 7:59 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Here is what it worked for me: /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" connection-mark="Hairpin NAT" log-prefix="Hairpin NAT Masquerade" add action=masquerade chain=srcnat comment="Default NAT Masquerade" ...
by robmaltsystems
Thu Jan 04, 2024 7:33 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Another suggestion is to use another subnet. This might work for me as I have the main private Wi-Fi interface but also a second 10.0.0.0/24 VLAN used for guests. Will try connecting client DoH laptop to that. That didn't work either although I suspect when the article talks about putting the serve...
by themrdrprof
Thu Jan 04, 2024 7:29 pm
Forum: General
Topic: Port Tested and Network Scanners Getting Incorrect Data
Replies: 5
Views: 1186

Port Tested and Network Scanners Getting Incorrect Data

... dst-address=FiberIP dst-port=32400 protocol=tcp to-addresses=10.0.0.61 to-ports=32400 add action=masquerade chain=srcnat comment="Hairpin NAT" disabled=yes dst-address=10.0.0.0/24 out-interface=sfp-sfpplus2 src-address=10.0.0.0/24 /ip firewall service-port set sip disabled=yes ...
by robmaltsystems
Thu Jan 04, 2024 1:10 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Thanks for that - will have a look at that later too.
by anav
Thu Jan 04, 2024 1:08 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Rule in forward chain needs to be add chain=forward action=accept connection-nat-state=dstnat The old default rule can be deleted but you need to add two more rules. THis one above it....... add chain=forward action=accept in-interface-list=LAN out-interface-list=WAN comment="internet traffic&q...
by robmaltsystems
Thu Jan 04, 2024 1:05 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

... where the LAN users and the Server are on the same subnet, all that is required is the following generic source NAT rule, often called the HAIRPIN NAT Rule placed as the first source NAT rule (although I have been told order here is not important). This required source NAT rule is independent ...
by vingjfg
Thu Jan 04, 2024 12:17 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Hi, Your dstnat rules need to be changed (Hairpin isn't coming in from a WAN port) add action=dst-nat chain=dstnat comment=https dst-port=443 in-interface-list=WAN protocol=tcp to-addresses=192.168.0.14 to-ports=443 instead of using in-interface-list=WAN, ...
by robmaltsystems
Thu Jan 04, 2024 12:10 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

... one can do with adguard/piehole/doh etc..... if the user is savvy enough. I'm not trying to block them using DoH as such but solve the classic hairpin issue. Not problem with them using DoH but this is what happens when you use DNS to workaround the hairpin issue: Clients on LAN using LAN DNS ...
by robmaltsystems
Thu Jan 04, 2024 12:03 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Your dstnat rules need to be changed (Hairpin isn't coming in from a WAN port) That's what I suspected which is why removing it (WAN interface) fixed for these specific cases but broke everything else. This dstnat rule format was created by ...
by anav
Thu Jan 04, 2024 3:24 am
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Its impossible to block or control DNS from an encrypted methodology to my knowledge.
In other words there are limits to what one can do with adguard/piehole/doh etc..... if the user is savvy enough.
by rplant
Thu Jan 04, 2024 2:31 am
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

Hi,

Your dstnat rules need to be changed (Hairpin isn't coming in from a WAN port)

add action=dst-nat chain=dstnat comment=https dst-port=443 in-interface-list=WAN protocol=tcp to-addresses=192.168.0.14 to-ports=443

instead of using in-interface-list=WAN, perhaps use dst-address-type=local
by robmaltsystems
Thu Jan 04, 2024 12:09 am
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Re: Simple hairpin not working

... connection-nat-state=!dstnat connection-state=new \ in-interface-list=WAN /ip firewall nat add action=masquerade chain=srcnat comment=hairpin dst-address=192.168.0.0/24 src-address=192.168.0.0/24 add action=masquerade chain=srcnat comment="outgoing nat" ipsec-policy=out,none ...
by robmaltsystems
Wed Jan 03, 2024 11:59 pm
Forum: General
Topic: Simple hairpin not working
Replies: 17
Views: 1759

Simple hairpin not working

I've read this thread: https://forum.mikrotik.com/viewtopic.php?t=179343 which is most useful in explaining the hairpin issue. Whilst I won't say my knowledge of NAT is deep, I understand the basic principals. I originally solved via the DNS approach as that, well, worked. My home ...
by vingjfg
Wed Jan 03, 2024 11:02 pm
Forum: General
Topic: Local IP Addressed leased but no internet.
Replies: 7
Views: 2225

Re: Local IP Addressed leased but no internet.

... NAT is problematic, you are changing the source IP to the same as the destination IP add action=masquerade chain=srcnat comment="for PiHole - Hairpin NAT" \ dst-address=192.168.0.17 dst-port=80 out-interface=vlan100 protocol=tcp \ src-address=192.168.0.0/24 to-addresses=192.168.0.17 You ...
by anav
Wed Jan 03, 2024 2:15 am
Forum: Beginner Basics
Topic: Port forwarding issue [SOLVED]
Replies: 5
Views: 1673

Re: Port forwarding issue [SOLVED]

... server by the server LAN IP address directly, but by the roundabout method of using the Domain Name/url/dyndns type name. then yes you need the hairpin nat rule. If you move the users or server to a separate subnet, then that is no longer the case.
by rseke
Wed Jan 03, 2024 1:53 am
Forum: Beginner Basics
Topic: Port forwarding issue [SOLVED]
Replies: 5
Views: 1673

Re: Port forwarding issue [SOLVED]

Ohhh this is so confusing for me,i cant add simple port forward to my server without this NAT HAIRPIN?
by MTNick
Tue Jan 02, 2024 10:25 pm
Forum: General
Topic: Force Users to Use Specific DNS Server
Replies: 31
Views: 21348

Re: Force Users to Use Specific DNS Server

... out-interface-list=WAN \ src-address-list=expected-address-from-LAN to-addresses=MY-WAN-IP add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address-list=\ expected-address-from-LAN out-interface-list=LAN protocol=tcp \ src-address-list=expected-address-from-LAN add ...
by ductiena12
Tue Jan 02, 2024 4:37 am
Forum: General
Topic: Local IP Addressed leased but no internet.
Replies: 7
Views: 2225

Local IP Addressed leased but no internet.

... comment="for WAN2 Connection" \ out-interface=pppoe-out-viettel add action=masquerade chain=srcnat comment=\ "for DVR Camera Apps - HairPin NAT" dst-address=192.168.0.60 dst-port=\ 8888 out-interface=vlan100 protocol=tcp src-address=192.168.0.0/24 add action=masquerade chain=srcnat ...
by falcka
Fri Dec 22, 2023 3:12 pm
Forum: General
Topic: Using WireGuard to connect to router from guest network using the same router
Replies: 2
Views: 790

Using WireGuard to connect to router from guest network using the same router

... in the hotel and went to our site – WireGuard will in that case send all traffic as usual, even internally. I’ve been experimenting with NAT hairpin/loopback in the affected VLAN, but the rules never shows any traffic being masqueraded to the gateway (UDP traffic in 10.203.86/23 with destination ...
by keirstitt
Thu Dec 21, 2023 12:51 pm
Forum: Wireless Networking
Topic: Bridge filtering client-to-client traffic
Replies: 14
Views: 2768

Re: Bridge filtering client-to-client traffic

... What I might try and do is use a spare rasberry pi and write something as a kernel module driving sk_buff directly to be an L2 NAT as a kind of hairpin - it will create a shadow device for everything on a particular VLAN that will allow it to hairpin.
by martinszeltins
Wed Dec 20, 2023 12:21 am
Forum: Beginner Basics
Topic: All ports open? Connectable via telnet
Replies: 3
Views: 1224

Re: All ports open? Connectable via telnet

... connection-nat-state=!dstnat \ connection-state=new in-interface-list=WAN /ip firewall nat add action=masquerade chain=srcnat comment="[Hairpin / Loopback NAT] - Allow t\ o access the home server on public IP address from within LAN" \ dst-address=192.168.8.230 dst-port=80 out-interface=bridge ...
by vingjfg
Sat Dec 16, 2023 4:31 pm
Forum: General
Topic: HAIRPIN NAT NOT WORK
Replies: 3
Views: 1094

Re: HAIRPIN NAT NOT WORK

... need to masquerade behind the public IP, just behind the local IP of the router. /ip firewall nat add action=masquerade chain=srcnat comment=TEST-HAIRPIN dst-address=\ 172.16.0.0/24 src-address=172.16.0.0/24 to-addresses=103.xx.xx.xx Second, depending on what the IP-PLUIT address-list contains, ...
by firsaavln
Sat Dec 16, 2023 3:22 pm
Forum: General
Topic: HAIRPIN NAT NOT WORK
Replies: 3
Views: 1094

Re: HAIRPIN NAT NOT WORK

... \ new-routing-mark=ROUTE-SOSMED passthrough=no src-address-list=IP-PLUIT /ip firewall nat add action=masquerade chain=srcnat comment=TEST-HAIRPIN dst-address=\ 172.16.0.0/24 src-address=172.16.0.0/24 to-addresses=103.xx.xx.xx add action=masquerade chain=srcnat comment=TEST-HAIRPIN dst-address-list=\ ...
by vingjfg
Sat Dec 16, 2023 1:03 pm
Forum: General
Topic: HAIRPIN NAT NOT WORK
Replies: 3
Views: 1094

Re: HAIRPIN NAT NOT WORK

Config export, please.
by firsaavln
Sat Dec 16, 2023 10:02 am
Forum: General
Topic: HAIRPIN NAT NOT WORK
Replies: 3
Views: 1094

HAIRPIN NAT NOT WORK

... with a static wan public ip, sometimes it can't be accessed by the local network, but if from the outside network it works, I have applied hairpin but it doesn't work, my own local server ip is 172.16.0.249, when we access to ip 172.16.0.249 from the local network, we can't access the server ...
by robmaltsystems
Thu Dec 14, 2023 11:38 pm
Forum: General
Topic: FTP client blocked
Replies: 5
Views: 1845

Re: FTP client blocked

... chain=dstnat dst-port=21 in-interface-list=WAN protocol=tcp to-addresses=192.168.88.197 to-ports=21 I still need to do some reading of this hairpin issue as I'm about to replace my Virgin Media Superhub with a hAP ax2 router so I'm using RouterOS all the time at home. I do have a bit of ...
by OliZi
Thu Dec 14, 2023 5:21 pm
Forum: General
Topic: Multi WAN and port forwarding
Replies: 23
Views: 3367

Re: Multi WAN and port forwarding

... W1" dst-address=\ 81.223.59.XXX dst-port=80 protocol=tcp to-addresses=10.0.0.60 to-ports=0 add action=masquerade chain=srcnat comment=Hairpin dst-address=10.0.0.0/24 \ src-address=10.0.0.0/24 add action=src-nat chain=srcnat comment="test src nat" src-address=10.0.0.64 \ to-addresses=176.66.79.XXX ...
by anav
Thu Dec 14, 2023 4:54 pm
Forum: Useful user articles
Topic: Advanced Routing Failover without Scripting
Replies: 268
Views: 136593

Re: Advanced Routing Failover without Scripting

... are required to reach server by the domain name/url ) 1. forward firewall rule add chain=forward action=accept connection-nat-state=dstnat 2. Hairpin sourcenat rule add chain=forward action=accept src-address=ServerSubnet dst-address=ServerSubnet 3. Properly formatted dstnat rules. add chain=dstnat ...
by hook
Thu Dec 14, 2023 10:51 am
Forum: Beginner Basics
Topic: Need help with NAT for home server(s)
Replies: 12
Views: 2714

Re: Need help with NAT for home server(s)

... . I would add comments to each rule, too, explaining why you need two rules to get port forwarding to work when one suffices in many normal cases. Hairpin NAT isn't always required. Now that I (re-)read about hairpin NAT that does sound like what I was trying to do those years ago. I just didn’t ...
by tangent
Thu Dec 14, 2023 12:58 am
Forum: Beginner Basics
Topic: Need help with NAT for home server(s)
Replies: 12
Views: 2714

Re: Need help with NAT for home server(s)

... . I would add comments to each rule, too, explaining why you need two rules to get port forwarding to work when one suffices in many normal cases. Hairpin NAT isn't always required.
by OliZi
Thu Dec 14, 2023 12:31 am
Forum: General
Topic: Multi WAN and port forwarding
Replies: 23
Views: 3367

Re: Multi WAN and port forwarding

... W1" dst-address=\ 81.223.59.XXX94 dst-port=80 protocol=tcp to-addresses=10.0.0.60 to-ports=0 add action=masquerade chain=srcnat comment=Hairpin dst-address=10.0.0.0/24 \ src-address=10.0.0.0/24 add action=masquerade chain=srcnat comment=Hairpin dst-address-list=RFC1918 \ src-address-list=RFC1918 ...
by vingjfg
Wed Dec 13, 2023 8:55 am
Forum: Beginner Basics
Topic: Need help with NAT for home server(s)
Replies: 12
Views: 2714

Re: Need help with NAT for home server(s)

You are doing hairpin NAT, that's often an issue but a casual review shows this is fine. I see that the HTTPS rule for Monolith is disabled. DId you enable it when you had disabled the other rules? The test you mention, does it run ...
by optio
Tue Dec 12, 2023 5:41 pm
Forum: Beginner Basics
Topic: Question about NAT Virtual Address
Replies: 5
Views: 1846

Re: Question about NAT Virtual Address

My sole objective is to have specific url pointing to the same IP address but with different ports.
You need some reverse proxy for this, like Nginx. Create hairpin nat for reverse proxy http service and configure it redirect traffic by host name to specific webapp ip:port.
by laurenettaieb91
Tue Dec 12, 2023 12:05 am
Forum: Beginner Basics
Topic: Question about NAT Virtual Address
Replies: 5
Views: 1846

Re: Question about NAT Virtual Address

... -> Internal IP, Port Y I have tried to have a specific virtual IP address for Application A and for Application B and then use DNS Hairpin to redirect to Internal IP, Port X and do the same for Application B. Unsure, what would be the best method. If someone has encountered the ...
by mkx
Sun Dec 10, 2023 5:29 pm
Forum: General
Topic: [Help] Port Forwarding with public IP "only with haproxy, socat.."
Replies: 3
Views: 1215

Re: [Help] Port Forwarding with public IP "only with haproxy, socat.."

# socat -T 600 UDP4-LISTEN:51515,reuseaddr,fork UDP4:xx.xx.xx.xx:51515 Isn't this what NAT does? With "hairpin" part added? Something like this: /ip/firewall/nat add chain=dstnat action=dst-nat protocol=udp dst-port=51515 to-addresses=xx.xx.xx.xx add chain=srcnat action=masquerade ...
by mkx
Sun Dec 10, 2023 11:31 am
Forum: Beginner Basics
Topic: Question about NAT Virtual Address
Replies: 5
Views: 1846

Re: Question about NAT Virtual Address

If your browsing PC is in same IP subnet as actual server (IP address on router, used as NAT intermediate, doesn't matter), then you have to implement hairpin NAT. Either use official docs or search this forum to get an idea of what and how.
by GrennKren
Sat Dec 09, 2023 10:31 am
Forum: General
Topic: After 7.2.2 update, can't ping or winbox through IP Addres [SOLVED]
Replies: 3
Views: 3033

Re: After 7.2.2 update, can't ping or winbox through IP Addres [SOLVED]

... routing tables behaviour for local destinations. Thanks! I joined this forum just to express my gratitude. Spent quite some time dealing with the Hairpin NAT issue. Finally figured out that disabling all Mangle was the solution, so I went around looking for ways to keep Mangle while fixing the ...
by tnakir
Fri Dec 08, 2023 2:32 pm
Forum: General
Topic: How to setup NAT in this case
Replies: 3
Views: 1397

How to setup NAT in this case

... dst-port=8080 protocol=tcp to-addresses=192.168.1.10 to-ports=80 If i try to access from any IP from the Bridge-PUBLIC, it doesn't work. I guess Hairpin NAT will not solve the issue since I am not doing NAT from private range? What am I doing wrong?
by thegorneman
Thu Dec 07, 2023 3:39 pm
Forum: Beginner Basics
Topic: NGINX Proxy Manager & RouterOS
Replies: 11
Views: 5280

Re: NGINX Proxy Manager & RouterOS

... from WAN, but in LAN they are unreachable. In my router I've set up these rules: /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" dst-address=LAN subnet src-address=LAN subnet add action=src-nat chain=srcnat comment="Server interni" dst-address-type="" ...
by rplant
Wed Dec 06, 2023 9:56 am
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

If the router is actually routing the packet, it can dst-nat the packet it doesn't need to have the IP address on itself.

Because it will presumably be hairpinning the packet, you will need to src-nat the packet as well.
(Possibly the src-nat IP you use does need to be on the router)
by stevester
Wed Dec 06, 2023 12:53 am
Forum: General
Topic: Help with hairpin NAT between VLAN's
Replies: 2
Views: 1728

Re: Help with hairpin NAT between VLAN's

Hey thanks for your help, Using the actual IP address of the WAN interfaces (as opposed to the interface name) in the dst-nat rules did the trick. Does seem odd though as the interface name method should in theory work as well you'd think but nonetheless happy with the outcome. Also cleaned up my co...
by GiovanniG
Mon Dec 04, 2023 7:36 pm
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

Thanks for answer and solutions, unfortunately solution with DNS is smart can't be considered because on router 2 (gateway) thery are connected others internal "router1", each one with a videorecorder, and the client should be ablt to see other DVR when connected to the wifi of router1. Th...
by killa88
Sat Dec 02, 2023 1:54 pm
Forum: Beginner Basics
Topic: PCC Mangle and routes reducing Client speeds ? [SOLVED]
Replies: 23
Views: 4245

Re: PCC Mangle and routes reducing Client speeds ? [SOLVED]

... strong and fine enough for this, but usually not a lot of users, just those in the field will be using it. for Internal users (would this require Hairpin nat) via lanIP, and we are going to be deploying ms server 2012 domain name for thin clients also. Would that be an issue ? 3]Good, that was ...
by samimetro
Fri Dec 01, 2023 9:45 pm
Forum: General
Topic: Can't access locally hosted servers using domain.tld
Replies: 2
Views: 1219

Re: Can't access locally hosted servers using domain.tld



normis my friend, this was exactly it, thank you for both links, worked first try.
really appreciate your help :wink:
by rplant
Thu Nov 30, 2023 11:57 pm
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

Another (possibly easy) option is to use DNS. Externally, the DNS used will point to the gateway. Internally the DNS will point direct to the router1 You would perhaps need to create another DNS record specifically for this task. Another another option If the access point is a Mikrotik, (or the traf...
by GiovanniG
Thu Nov 30, 2023 10:12 am
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

Hi, upgrade the link is not possible.

I don't think the soluton is too difficoult, I need to mark the packets exiting with Public IP:targetTCP and somehow reply to them using source adress the Public IP, even if it not present on router1. Can I do it?
by rplant
Thu Nov 30, 2023 9:55 am
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

... saying that the link between router1 and router2 is 10Mbps? If so, the likely best option is to upgrade this link. Otherwise, my guess is that the hairpin is getting throttled by some queue's, presumably on router2. In this case, (I am assuming router2 is an MT), add appropriate fast queueing for ...
by spippan
Wed Nov 29, 2023 5:25 pm
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

Re: How to Hairpin on the first hop (not on internet gateway)

....on your router's make and model.
NO! - but on your network's setup! a mikrotik router NAT configuration from plain functionality (not speaking of performance) is model agnostic
by dalben
Wed Nov 29, 2023 6:12 am
Forum: Beginner Basics
Topic: NGINX Proxy Manager & RouterOS
Replies: 11
Views: 5280

NGINX Proxy Manager & RouterOS

... a different server. Using the direct IP:Port# works internally. I tried DNS rewrite rules on my DNS (Adguard Home) but that didn't work either. A Hairpin NAT rule might be needed but the one I tried didn't work. I was expecting it just to work, as it did with the USG, without needing to do extra ...
by GiovanniG
Tue Nov 28, 2023 11:47 pm
Forum: General
Topic: How to Hairpin on the first hop (not on internet gateway)
Replies: 6
Views: 1890

How to Hairpin on the first hop (not on internet gateway)

... harpin on the router 2 who has the public IP, but in this way I load the connection between router which is only 10 megabits. Hhow can i create hairpin directly on router1? I've tried to mark connection on router1 with the public IP address (WAN of router2) and then masquerade it, but it doesn't ...
by MTNick
Mon Nov 27, 2023 5:43 am
Forum: Beginner Basics
Topic: Config with Advanced Firewall verification requested (WG, DoH & server are working great). Nothing is failing
Replies: 2
Views: 1170

Re: Config with Advanced Firewall verification requested (WG, DoH & server are working great). Nothing is failing

... add action=drop chain=forward comment="drop all else" /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT - LAN" \ dst-address-list=expected-address-from-LAN src-address-list=expected-address-from-LAN add action=masquerade chain=srcnat out-interface-list=WAN ...
by MTNick
Sun Nov 26, 2023 4:50 pm
Forum: Beginner Basics
Topic: Config with Advanced Firewall verification requested (WG, DoH & server are working great). Nothing is failing
Replies: 2
Views: 1170

Config with Advanced Firewall verification requested (WG, DoH & server are working great). Nothing is failing

... add action=masquerade chain=srcnat comment="LAN Masquerade" \ out-interface-list=WAN add action=masquerade chain=srcnat comment="Hairpin NAT - LAN" \ dst-address-list=LAN src-address-list=LAN add action=dst-nat chain=dstnat comment="SyncServer NAT - HTTPS" \ dst-address-type=local ...
by mexus
Fri Nov 24, 2023 10:41 am
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... - users are forced to access servers via DYNDNS type domain name/url or by WANIP. (If b is the correct answer then we have to make changes due to hairpin nat). (4) Do not use same DNS sites for Recursive as you do for DNS.......... so recommend change DNS Keep 8.8.8.8 and 1.1.1.1 for DNS and 8.8.4.4 ...
by mexus
Fri Nov 24, 2023 10:31 am
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... - users are forced to access servers via DYNDNS type domain name/url or by WANIP. (If b is the correct answer then we have to make changes due to hairpin nat). (4) Do not use same DNS sites for Recursive as you do for DNS.......... so recommend change DNS Keep 8.8.8.8 and 1.1.1.1 for DNS and 8.8.4.4 ...
by templlama
Thu Nov 23, 2023 8:51 pm
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... - users are forced to access servers via DYNDNS type domain name/url or by WANIP. (If b is the correct answer then we have to make changes due to hairpin nat). (4) Do not use same DNS sites for Recursive as you do for DNS.......... so recommend change DNS Keep 8.8.8.8 and 1.1.1.1 for DNS and 8.8.4.4 ...
by mexus
Thu Nov 23, 2023 1:16 pm
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... as described by you Changed the fasttrack-connection filter rule adding connection-mark=no-mark, couldn't find the hw-offload=yes Changed the hairpin Nat similar to the rules you provided Fixed the inconstancies in the route, leaving the IP addresses instead of ether1/ether2, leaving the slower ...
by mexus
Wed Nov 22, 2023 10:48 pm
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... going out to the internet. (4) Can you clarify that local users are also using the WANIPs to reach servers and not the direct LANIPs?? (5) If hairpin nat is indeed required, the correct format is add chain=srcnat action=masquerade src-address=192.168.0.0/24 dst-address=192.168.0.0/24 (6) The ...
by anav
Wed Nov 22, 2023 7:42 pm
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... going out to the internet. (4) Can you clarify that local users are also using the WANIPs to reach servers and not the direct LANIPs?? (5) If hairpin nat is indeed required, the correct format is add chain=srcnat action=masquerade src-address=192.168.0.0/24 dst-address=192.168.0.0/24 (6) The ...
by mexus
Wed Nov 22, 2023 7:23 pm
Forum: Beginner Basics
Topic: Dual WAN failover, port forward not working when changing route distance
Replies: 22
Views: 2499

Re: Dual WAN failover, port forward not working when changing route distance

... (7) I manage only one of the few servers behind the router, I'll address your concerns to the personal managing the others. (8 and 9) kind of hairpin NAT, so that the personnel can access their webmail from the local network using the domain they already used before the installation of the ...
by tritor
Mon Nov 20, 2023 9:51 pm
Forum: Forwarding Protocols
Topic: LAN access with FQDN via Nginx ReverseProxy
Replies: 4
Views: 1568

Re: LAN access with FQDN via Nginx ReverseProxy

the hairpin nat describes all on IP base but is the approach the same when using FQDN?
by infolpg
Mon Nov 20, 2023 9:51 pm
Forum: Forwarding Protocols
Topic: LAN access with FQDN via Nginx ReverseProxy
Replies: 4
Views: 1568

Re: LAN access with FQDN via Nginx ReverseProxy

The functionality you need is called "NAT Hairpin" https://help.mikrotik.com/docs/display/ROS/NAT#NAT-HairpinNAT of course NAT Hairpin - and as I saw this: Hairpin NAT looks like: #Hairpin-NAT - local to local chain=srcnat action=masquerade ...
by Cha0s
Mon Nov 20, 2023 9:33 pm
Forum: Forwarding Protocols
Topic: LAN access with FQDN via Nginx ReverseProxy
Replies: 4
Views: 1568

Re: LAN access with FQDN via Nginx ReverseProxy

The functionality you need is called "NAT Hairpin"
https://help.mikrotik.com/docs/display/ ... HairpinNAT
by tritor
Mon Nov 20, 2023 7:06 pm
Forum: Forwarding Protocols
Topic: LAN access with FQDN via Nginx ReverseProxy
Replies: 4
Views: 1568

LAN access with FQDN via Nginx ReverseProxy

... to a Proxmox container running Ubuntu and Nextcloud does work like well when accessing https://next.test.net The issue: Internal access with FQDN Hairpin NAT looks like: #Hairpin-NAT - local to local chain=srcnat action=masquerade src-address=192.168.10.0/24 dst-address=192.168.10.0/24 # ReverseProxy ...
by unlikely
Sat Nov 18, 2023 1:48 pm
Forum: Useful user articles
Topic: Advanced Routing Failover without Scripting
Replies: 268
Views: 136593

Re: Advanced Routing Failover without Scripting

Unfortunately I observe a problem with Hairpin NAT that is related to the recently added config for WAN Failover. Since longtime I have two NAT rules very similar to those described in https://help.mikrotik.com/docs/display/ROS/NAT , the second ...
by anav
Sat Nov 18, 2023 5:49 am
Forum: Beginner Basics
Topic: wireguard connection restricted to a single internal IP [SOLVED]
Replies: 8
Views: 3322

Re: wireguard connection restricted to a single internal IP [SOLVED]

... how many subnets you have. If there are users in the same subnet as the server and they are using the WANIP to access the server you will need a hairpin NAT rule. add chain=srcnat action=masquerade src-address=192.168.88.0/24 dst-address=192.168.88.0
by keirstitt
Fri Nov 17, 2023 8:06 pm
Forum: Wireless Networking
Topic: Bridge filtering client-to-client traffic
Replies: 14
Views: 2768

Re: Bridge filtering client-to-client traffic

... exclusive. Okay, yeah that's for WPA3 etc. Our APs are cAP AC which I don't think meet the requirements for that anyway. I just want to get a hairpin somehow. I've tired using L2 NAT but it's not working, I think I'm going to have to do it on another router which translates the packets and ...
by anav
Fri Nov 17, 2023 5:35 pm
Forum: Beginner Basics
Topic: Blocking traffic to rest of network but allowing access to forwarded ports on public IP
Replies: 3
Views: 838

Re: Blocking traffic to rest of network but allowing access to forwarded ports on public IP

... source nat rules, I see you have accounted for local users on the trusted subnet also accessing the servers by the WANIP, as you have the required hairpin nat rule in place. The hairpin nat rule is NOT required for the VLAN subnet as that is a different subnet. (7) Not sure what you are doing with ...
by keirstitt
Thu Nov 16, 2023 1:15 pm
Forum: Wireless Networking
Topic: Bridge filtering client-to-client traffic
Replies: 14
Views: 2768

Re: Bridge filtering client-to-client traffic

... two devices that need to talk to each other but in a controlled way on different VLAN's, then "shorting" the VLAN's would create a hairpin as the bridge would be happy to see the same packet return back through the same port so long as its VLAN has changed? I'll have a play. Kind ...
by vingjfg
Wed Nov 15, 2023 9:46 am
Forum: Beginner Basics
Topic: Hairpint NAT between two mikrotiks
Replies: 5
Views: 1467

Re: Hairpint NAT between two mikrotiks

... it is a bit difficult to create a config without more elements. First: /ip firewall nat add action=masquerade chain=srcnat comment="NAT HAIRPIN" dst-address=192.168.1.3 out-interface=br1.lan protocol=tcp src-address=192.168.130.0/24 to-addresses=192.168.1.3 Remove this as it makes ...
by kothet
Wed Nov 15, 2023 5:05 am
Forum: Beginner Basics
Topic: Port Forwarding problem
Replies: 1
Views: 922

Port Forwarding problem

Hello, first of all, thanks for everyone helping each other. I am new with this, and I already read much about NAT, Hairpin and so on. In my configuration, there is something special, I think, and I am not sure, where my default error is. I want to port forward localip:80 from 1 ...
by keirstitt
Tue Nov 14, 2023 1:38 pm
Forum: Wireless Networking
Topic: Bridge filtering client-to-client traffic
Replies: 14
Views: 2768

Bridge filtering client-to-client traffic

... can't leave a bridge through the port it entered and therefore the two clients are entirely blocked from communicating except via some form of hairpin. There's a thread from 10 years ago where someone described the same problem https://forum.mikrotik.com/viewtopic.php?t=79006 we now are able ...
by archi989
Tue Nov 14, 2023 1:29 pm
Forum: Beginner Basics
Topic: Hairpint NAT between two mikrotiks
Replies: 5
Views: 1467

Re: Hairpint NAT between two mikrotiks

Hi,

it is correct, i need to acces to server web in 192.168.1.0/24 througt a lan address from mikrotik2 but connecting to a public IP address, and the comunication between mikrotik1 and 2 is 192.168.130.0/24, so if is not hairpin nat, what should i have to do?

thanks in advance,
by sindy
Tue Nov 14, 2023 11:01 am
Forum: General
Topic: PPPoE Static IP fast switch
Replies: 5
Views: 733

Re: PPPoE Static IP fast switch

... ICMP packet, and a scheduled script watch for such items in address lists and treat them as WAN switch commands. Or you can use a hairpin connector connecting 1,2 to 3,6 on a free Ethernet port as a switch - if inserted, the port goes up in Fast Ethernet mode (but it must not be ...
by anav
Mon Nov 13, 2023 8:51 pm
Forum: Beginner Basics
Topic: dstnat rules not works
Replies: 13
Views: 1920

Re: dstnat rules not works

... add action=accept chain=forward in-interface-list=LAN out-interface-list=WAN src-address= ! 10.10.0.0/24 comment="internet traffic" (5) HAIRPIN, not required unless you had other users on the 192.168.55.0 subnet where the pi server resides (6) Format for dstnat rules seems to be okay, ...
by vingjfg
Sun Nov 12, 2023 12:58 pm
Forum: Beginner Basics
Topic: Hairpint NAT between two mikrotiks
Replies: 5
Views: 1467

Re: Hairpint NAT between two mikrotiks

Thinking of the configuration you sent and your explanations, I think the issue is not a hairpin NAT. But first, does this accurately represent what you have? ft1.drawio (1).png If so, you do not have a hairpin NAT issue but most likely an ACL issue. The interface with ...
by 0xAA55
Sat Nov 11, 2023 6:01 pm
Forum: Beginner Basics
Topic: New L009UiGS-2HaxD - Need help port forwarding past default config
Replies: 3
Views: 994

Re: New L009UiGS-2HaxD - Need help port forwarding past default config

... your servers locally from users on the same subnet as the server via the dyndns address (not direct LANIP) then you will run into loopback or hairpin nat. https://forum.mikrotik.com/viewtopic.php?t=179343 You are correct I was trying to test the dest-nat rule from within the same network by ...
by anav
Sat Nov 11, 2023 2:26 pm
Forum: Beginner Basics
Topic: New L009UiGS-2HaxD - Need help port forwarding past default config
Replies: 3
Views: 994

Re: New L009UiGS-2HaxD - Need help port forwarding past default config

... your servers locally from users on the same subnet as the server via the dyndns address (not direct LANIP) then you will run into loopback or hairpin nat. https://forum.mikrotik.com/viewtopic.php?t=179343
by archi989
Thu Nov 09, 2023 10:20 am
Forum: Beginner Basics
Topic: Hairpint NAT between two mikrotiks
Replies: 5
Views: 1467

Hairpint NAT between two mikrotiks

Hellow, i have a problem between two mikrotiks, i need to do hairpin nat, but it doesnt work, this is the escenario: mikrotik 1 --> 192.168.1.1/24 192.168.130.1/24 Internet connection on this router mikrotik 2 --> 192.168.130.2/24 Two router are connected ...
by Josephny
Mon Nov 06, 2023 5:12 pm
Forum: General
Topic: How to secure the environment?
Replies: 20
Views: 1953

Re: How to secure the environment?

... comment="allow port forwarding" \ connection-nat-state=dstnat /ip firewall nat add action=masquerade chain=srcnat comment="Hairpin NAT" connection-mark=\ "Hairpin NAT" dst-address=192.168.2.0/24 src-address=192.168.2.0/24 add action=masquerade chain=srcnat ...
by alarmcom
Sun Nov 05, 2023 8:30 pm
Forum: General
Topic: MikroTik-RB4011iGS+RM PPPoE Dynamic Static IP
Replies: 19
Views: 2321

Re: MikroTik-RB4011iGS+RM PPPoE Dynamic Static IP

... add gateway=10.100.10.100 You need to find an equivalent setting for UBNT. With these settings, you won't need any dst-nat rules, hence also no hairpin nat rule to allow the LAN-side clients of one of your internal routers to establish connections with the public address of another one of your ...
by sindy
Sun Nov 05, 2023 6:42 pm
Forum: General
Topic: MikroTik-RB4011iGS+RM PPPoE Dynamic Static IP
Replies: 19
Views: 2321

Re: MikroTik-RB4011iGS+RM PPPoE Dynamic Static IP

... add gateway=10.100.10.100 You need to find an equivalent setting for UBNT. With these settings, you won't need any dst-nat rules, hence also no hairpin nat rule to allow the LAN-side clients of one of your internal routers to establish connections with the public address of another one of your ...
by sindy
Sun Nov 05, 2023 4:36 pm
Forum: General
Topic: Hairpin doesnt work
Replies: 2
Views: 579

Re: Hairpin doesnt work

It all depends on how exactly you have implemented the forwarding of incoming traffic from the internet towards the public addresses to UBNT 1 and UBNT 2 from the 4011, but normally, it should work just fine. So post the output of /export hide-sensitive command on the 4011 after redacting all occurr...
by anav
Sun Nov 05, 2023 4:18 pm
Forum: General
Topic: Hairpin doesnt work
Replies: 2
Views: 579

Re: Hairpin doesnt work

Why dont you answer the questions asked here first!!

viewtopic.php?p=1033604#p1033604
by alarmcom
Sun Nov 05, 2023 3:56 pm
Forum: General
Topic: Hairpin doesnt work
Replies: 2
Views: 579

Hairpin doesnt work

Hi.I have a home network according to the picture. I have problem with hairpin. When I need connnect from router 1 network to router 2 network (but when I disconnect on one side main wan connection and connecting via Backup WAN, all works fine). Please help ...
by sindy
Sat Nov 04, 2023 5:21 pm
Forum: General
Topic: wifiwave2: no connection to CAPsMAN
Replies: 10
Views: 1657

Re: wifiwave2: no connection to CAPsMAN

... that doesn't allow processes running on the same hardware to talk to each other on L2 as both use the same bridge port and the bridge cannot hairpin frames back to the port it has received them from. And the auto-discovery of CAPsMAN only uses L2 frames.
by anav
Wed Nov 01, 2023 4:02 pm
Forum: General
Topic: Help with hairpin NAT between VLAN's
Replies: 2
Views: 1728

Re: Help with hairpin NAT between VLAN's

Hairpin NAT would not be the issue as the other LAN users are on a different subnet/vlan. Hairpin would exist if you also also had users on the 192.168.89.0 subnet attempting to reach the server by WANIP. In firewall rules ...
by stevester
Tue Oct 31, 2023 10:30 pm
Forum: General
Topic: Help with hairpin NAT between VLAN's
Replies: 2
Views: 1728

Help with hairpin NAT between VLAN's

... subnet in a VLAN. My LAN devices can access/see the mail server just fine, however the problem seems to be it is unable to resolve the WAN IP (hairpin NAT type issue as I understand it?). I have a dual WAN setup, with my LAN primarily using using WAN1 (sfp1) and my mail server primarily using ...
by anav
Mon Oct 30, 2023 5:51 pm
Forum: General
Topic: Manual DNS bypasses the Pihole - force redirect to pihole
Replies: 10
Views: 1811

Re: Manual DNS bypasses the Pihole - force redirect to pihole

... ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Now test with any changes made and see what happens. I dont think you need hairpin nat rule but if still no joy try adding. add chain=srcnat action=masquerade src-address=192.168.0.0/20 dst-address=192.168.0.0/20
by fifka1002
Fri Oct 27, 2023 3:01 pm
Forum: Beginner Basics
Topic: New users first configuration [SOLVED]
Replies: 12
Views: 3349

Re: New users first configuration [SOLVED]

... add action=masquerade chain=srcnat out-interface-list=WAN src-address=\ 192.168.2.0/2 1st rule - default masquerade 2nd rule - hairpin nat 3rd rule - port forward to nvr 4th rule - masquerade for l2tp users. l2tp users are not added to any interface. If I disable this rule, ...
  • 1
  • 2
  • 3
  • 4
  • 5
  • 15