Multiple devices and port forwarding

For my netgear router I have the following UDP port forwards:

        1	asterisk 	5060	5064	5060	5064	192.168.1.5
	2	IP_Phone	6670	6670	6670	6670	192.168.1.5
	3	Real-Audio	6970	7170	6970	7170	192.168.1.5
	4	asterisk2	10000	20000	10000	20000	192.168.1.5

However, everything goes to one device, in this case a hard phone. What if I add more devices? At the moment I have Asterisk on a virtual server with digital ocean.

If you have devices behind NAT connecting to a public Asterisk server then it is unlikely you need to set up any port forwards at all, if the remote Asterisk is configured to expect the devices to be behind NAT. It can keep the NAT mapping open so everything works as expected. It’s only in cases where the router is very broken that it can cause a problem.

Meaning that the device should be configured with a context including:

nat=force_rport,comedia
host=dynamic

so that Asterisk knows to keep the NAT mappings open?

The qualify option is what keeps the NAT mapping open for signaling. The above ensures that we ignore the address information they provide in their SIP messages.

1 Like