Reply
Emerging Member
Posts: 52
Registered: ‎01-12-2016
Kudos: 6
Solutions: 2

Can I forward the same port to 2 different IP addresses?

I have two instances of NVR running as VMs, one for my house and one for a friend. It was easy to set up the friend to stream content to my house by pointing the NVR to my public IP and forwarding the appropriate ports.

 

Now I have the need to add a remote camera to stream to "my NVR". My problem is that with the cameras, I'm able to change the default ports 7080, 7442, and 7443, but not 6666.

 

Can I forward port 6666 to two different IP addresses?

 

SuperUser
Posts: 7,841
Registered: ‎01-05-2012
Kudos: 2072
Solutions: 1034

Re: Can I forward the same port to 2 different IP addresses?

You could use a different external port, eg forward 1 ext.port 6666 >> int.port 6666, forward 7 ext.port 6667 >> int.port 6666, or if you know the public ip address, you could use manual DNAT/firewall rules, declaring the source ip address in those rule for the target host...

Cheers,

jonatha

Veteran Member
Posts: 7,450
Registered: ‎03-24-2016
Kudos: 1930
Solutions: 853

Re: Can I forward the same port to 2 different IP addresses?

Using 6667 on the outside assumes you can configure port on the client.

 

If you can't....

 

If you know the client IP address, you can make 2 dNAT rules for 6666->6666, and specify source IP on them

To do that dynamically, requires (ugly) scripting: If connection enters on port 7080, auto-add 6666 dNAT rule for that source IP

Enable log on port 7080 session setup firewall rule, monitor /var/log/messages for connection event, and auto-add the 6666dNAT rule for the source IP showing up in the log

Reply