Hi all,
I’m trying to configure an access from the internet to a RadioRepeater using a MikroTik RB750 with hairpin NAT.
I tried everything I could but it just doesn’t want to work.
Modem local Lan IP = 10.10.10.1
RB750 Local Lan IP = 192.168.88.1
RB750 Internet Port IP = 10.10.10.2
RadioRepeater IP =192.168.88.20
Port = 50000 UDP
I can’t copy my configuration just because I don’t know how to do it 'cause I used Winbox.
Can someone help me suggesting NAT rules that could actually work?
Thanks for reading
-Pier
Hi Milotop,
my configuration is this.. I followed your tip but still… it doesn’t work, maybe I’m doing something wrong, tell me if you can.
[admin@MikroTik] > ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=50000
protocol=udp dst-address=“Public IP” in-interface=all-ethernet
dst-port=50000 log=no log-prefix=“”
thanks for your reply,
I need a DST NAT rule in order to connect an outside PC to the radio repeater.
The hairpin NAT is also needed because all the “slave” repeaters that connect to the master have to show up when the monitoring program connects to the Master.
I used your tip, correcting the “in-interface parameter” but it is still not working.
-Pier
your one rule is only for port forwarding.
for hairpin you need 2 more:
ip fire nat
add chain=dstnat in-interface=“your local interface to 192.168.88.20” dst-address=“your global IP” dst-port=50000 protocol=udp action=dst-nat to-address=192.168.88.20 to-ports=50000
add chain=srcnat out-interface=“your local interface from 192.168.88.20” src-address=“LAN hosts network that want to access your 192.168.88.20” dst-address=192.168.88.20 dst-port=50000 protocol=udp action=masquerade
Ok guys,
I tried to hairpin but I had some problems with the interfaces (errors referring to the “not master” interface so I installed a switch between the repeaters and the mikrotik.
The Port Forwarding rule works but I can’t see the peers (slaves) while checking on the radio network from another wan, I would like to specify the fact that I can see the peer while I’m connected LOCALLY to the radio network.
master = 192.168.88.20
peer = 192.168.88.25
The peer has been configured, in its local firmware, to connect to the master via IP (Master IP: 192.168.88.20) but the problem remains… I’m using the RB750 can you please tell me how to hairpin without having errors?
Thanks guys!
in-interface and out-interface must be from master-port interface, not slave. If you need input in slave interface or output from him, you should unmerge them from master-port or bridge.
“Couldn’t add new NAT Rule - incoming interface matching not possible in output and postrouting chains (6)” this is what I get when I do the masquerade…
Sorry, my bad on reading… I tried this configuration but it doesn’t work… probably I did something wrong.. what do you mean by “your local interface TO 192.168.88.20” and “your local interface FROM 192.168.88.20”?
Also the lan client who wants to acces my 192.168.88.20 is 192.168.88.25
EDIT: I was using a switch on ether 2 (master) but I felt like it could have created problems with the interface parameters so I removed the switch and connected the 88.25 directly on ethernet3 while leaving 88.20 on ether 2… Now I’m getting a red error message on the masquerade rule telling me that ether3 is a slave and in/out interface matcher is impossible cause of that.
Right. You need to figure out how to assign masquerade on main interface. Masq works only on bridge interface, master-port or on interface with option master-port:none, and only on out direction.
P.S.: “your local interface TO 192.168.88.20” means interface, which leads traffic from rouer to host 192.168.88.20. “your local interface FROM 192.168.88.20” means interface which leads traffic from host 192.168.88.20 to router. I just don’t know how you named it =)
Ok, I’ll be clearer, I’m using a monitoring program called RDAC which connects to the master via port 50099, I made a DST-NAT rule that changes that 50099 to 50000 and it works, this means that my master repeater ( 88.20) shows up on RDAC.
My Peer repeater (88.25) shows up only when I connect RDAC locally to the network but not when I connect remotely… The peer is configured to look for the master on 88.20, the fact that while using rdac locally I can see both, when I check RDAC remotely only the Master shows up…
I think the problem is in your nat rules, in case of out-interface for masquerading. Just look one more time in my hairpin nat rules and try to adjust them to you case.