I have a PBX inside my network (pbxinaflash - asterisk/freepbx) living at 192.168.40.29
My router is a Netgear WNDR3700 v 1 running Attitude Adjustment 12.09-rc1.
I need to forward ports 5060 and 15002-20000 to the .29 address.
After failing to make this work, I have installed the following packages: kmod-ipt-nat, kmod-ipt-nathelper and kmod-ipt-nathelper-extra (each is version 3.3.8-1).
Setting up this simple port forwarding with a $20 D-Link, the ports are correctly forwarded. Using the Netgear with Openwrt, the packets never make it to the .29 address.
Under Luci -> Network -> Firewall -> Port Forwards I have the following text description of my rules:
Below is Section/Entry
Match: IPv4-TCP, UDP From any host in wan Via any router IP at port 5060
Forward To: IP 192.168.40.29, port 5060 in lan
And it is enabled.
The RTP ports read the same except the ports are 15002-20000
If I look at the same info under iptables, it reads as such (with iptables -t nat -L)
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
prerouting_rule all -- anywhere anywhere
zone_lan_prerouting all -- anywhere anywhere
zone_guest_prerouting all -- anywhere anywhere
zone_wan_prerouting all -- anywhere anywhere
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
postrouting_rule all -- anywhere anywhere
zone_lan_nat all -- anywhere anywhere
zone_guest_nat all -- anywhere anywhere
zone_wan_nat all -- anywhere anywhere
Chain nat_reflection_in (1 references)
target prot opt source destination
DNAT tcp -- 192.168.40.0/24 MyAddy tcp dpt:32976 to:192.168.40.28:32976
DNAT udp -- 192.168.40.0/24 MyAddy udp dpt:32976 to:192.168.40.28:32976
DNAT tcp -- 192.168.40.0/24 MyAddy tcp dpt:sip to:192.168.40.29:5060
DNAT udp -- 192.168.40.0/24 MyAddy udp dpt:sip to:192.168.40.29:5060
DNAT tcp -- 192.168.40.0/24 MyAddy tcp dpts:15002:20000 to:192.168.40.29:15002-20000
DNAT udp -- 192.168.40.0/24 MyAddy udp dpts:15002:20000 to:192.168.40.29:15002-20000
Chain nat_reflection_out (1 references)
target prot opt source destination
SNAT tcp -- 192.168.40.0/24 192.168.40.28 tcp dpt:32976 to:192.168.40.1
SNAT udp -- 192.168.40.0/24 192.168.40.28 udp dpt:32976 to:192.168.40.1
SNAT tcp -- 192.168.40.0/24 192.168.40.29 tcp dpt:sip to:192.168.40.1
SNAT udp -- 192.168.40.0/24 192.168.40.29 udp dpt:sip to:192.168.40.1
SNAT tcp -- 192.168.40.0/24 192.168.40.29 tcp dpts:15002:20000 to:192.168.40.1
SNAT udp -- 192.168.40.0/24 192.168.40.29 udp dpts:15002:20000 to:192.168.40.1
Chain postrouting_rule (1 references)
target prot opt source destination
nat_reflection_out all -- anywhere anywhere
Chain prerouting_guest (1 references)
target prot opt source destination
Chain prerouting_lan (1 references)
target prot opt source destination
Chain prerouting_rule (1 references)
target prot opt source destination
nat_reflection_in all -- anywhere anywhere
Chain prerouting_wan (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:openvpn
Chain zone_guest_nat (1 references)
target prot opt source destination
Chain zone_guest_prerouting (1 references)
target prot opt source destination
prerouting_guest all -- anywhere anywhere
Chain zone_lan_nat (1 references)
target prot opt source destination
Chain zone_lan_prerouting (1 references)
target prot opt source destination
prerouting_lan all -- anywhere anywhere
Chain zone_wan_nat (1 references)
target prot opt source destination
MASQUERADE all -- anywhere anywhere
Chain zone_wan_prerouting (1 references)
target prot opt source destination
DNAT tcp -- anywhere anywhere tcp dpt:32976 to:192.168.40.28:32976
DNAT udp -- anywhere anywhere udp dpt:32976 to:192.168.40.28:32976
DNAT tcp -- anywhere anywhere tcp dpt:sip to:192.168.40.29:5060
DNAT udp -- anywhere anywhere udp dpt:sip to:192.168.40.29:5060
DNAT tcp -- anywhere anywhere tcp dpts:15002:20000 to:192.168.40.29:15002-20000
DNAT udp -- anywhere anywhere udp dpts:15002:20000 to:192.168.40.29:15002-20000
prerouting_wan all -- anywhere anywhere
Clearly I'm doing something wrong if a cheap router does something basic that an opensource turbo-charged version doesn't.
Any help for the lost?
Andrew