Nat – How to forward range of ports in FreeBSD

asterisknat;port-forwarding

I am trying to configure asterisk PBX behind my FreeBSD router.
To allow other sip clients to call I need to forward ports to my local network asterisk machine.
I did it for 5060 and 5061 ports using ipnat and configuring ipnat.rules

rdr fxp0 217.199.MYIP.MYIP/32 port 5061 -> 192.168.1.7 port 5061 udp

But I do not know how I can redirect UDP port range from 60000 to 610000 and also port
range UDP Port 10000 – 20000

Best Answer

With PF, you could do it with variables.

myports = "{ 22 25 2022 2222 8000 }" rdr on $ext_if proto udp from any to $ext_if port $myports -> 192.168.1.7

...or something.

Related Topic