I setup a hairpin nat that works with a cctv camera system to allow me to use the public ip address both inside and outside the network.
Here it is:
add action=dst-nat chain=dstnat comment=“CCTV Port Forward” disabled=yes
dst-port=7000 in-interface=ether1-gateway protocol=tcp src-port=“”
to-addresses=192.168.1.100 to-ports=7000
add action=masquerade chain=srcnat comment=“Hairpin Nat” disabled=yes
dst-address=192.168.1.100 dst-port=7000 out-interface=ether2-master-local
protocol=tcp src-address=192.168.1.0/24
add action=dst-nat chain=dstnat comment=“Hairpin Nat” disabled=yes
dst-address-type=local dst-port=7000 protocol=tcp to-addresses=192.168.1.100However, on another system, 2 more ports needs to be forwarded: 67 & 68. And, both ports need both tcp & udp.
Is there a way to combine tcp & udp, or do you need to have a command for both?
Also, do I need to set up some type of hairpin for ports 67 & 68 like I did above for port 7000?
It is not working right now, and so far I have ports 7000, 67 & 68 forwarded to 192.168.1.100, with 67 & 68 using both tcp & udp, along with the hairpin nat for port 7000.
hairpin NAT is not needed for this set up, as I am seeing it.
Set up your router, create a DMZ zone and then you will be able to reach the cam over the internet and from
your local network (LAN) but the entire LAN is not affected by internet access of the cam.
Then your configuration as posted on the first post, should work. You should see counters running on your forwarding rules when you try to connect remotely. This is about port forwarding.
About hairpin nat, your config is not going to work, because you have specified ether1 as incoming interface, while your request is incoming from another interface. To make it work you should leave the incoming interface empty, so that router can capture and then forward requests from all interfaces.
Here core problem is he don’t have static IP, but every time dynamically he get public IP. So my friend as long as you know your public IP you can access your DVR from public network otherwise you can’t
Guys you’re making this really confusing. I have everything working fine. The only problem I’m having is with ports 67 and 68 udp. Something is not working. On other dvr’s with only one tcp port forwarded it works great.
Of course you can access your dvd remotely using dyndns. It keeps track of your wan ip.
Read other posts of mine on hairpin nat and you’ll see what type of setup I have.
Now port 67 and 68 are very strange to be needed because these ports are used by DHCP server and DHCP client, so you need to verify that imho.
For hairpin nat to work, you need to add another rule where you would specify the in-interface=LAN interface, or just leave empty the in-interface in the above rule. This because the requests are coming from the LAN interface. And, as you already mentioned (which I forgot to note on the previous post) you can reach your router by dynamic dns since your IP is Public Dynamic.