The problem is that I often have SIP registration problem to my remote SIP provider. I do see it is trying to register but packet are lost just after prerouting.
prerouting: in:bridge1 out:(none), src-mac b0:b3:2b:06:06:1b, proto UDP, 192.168.1.23:5060->89.209.199.9:5060, NAT 192.168.1.23:5060->(89.209.199.9:5060->192.168.1.23:5060), len 425
Is this common behavior for internal PBX to source connection to the same port that it is starting from sourceip:5060 to external_provider_ip:5060?
What should NAT rules look like?
Code: Select all
0 ;;; defconf: masquerade
chain=srcnat action=masquerade out-interface-list=WAN ipsec-policy=out,none
1 chain=srcnat action=masquerade out-interface=ether1
2 chain=dstnat action=dst-nat to-addresses=192.168.1.23 to-ports=5522 protocol=udp dst-port=5522 log=no log-prefix=""
3 chain=dstnat action=dst-nat to-addresses=192.168.1.23 to-ports=5060 protocol=udp dst-port=5060 log=no log-prefix="SIP"
4 chain=dstnat action=dst-nat to-addresses=192.168.1.23 to-ports=5061 protocol=udp dst-port=5061 log=no log-prefix="SIP"
5 chain=dstnat action=dst-nat to-addresses=192.168.1.23 to-ports=8100-8300 protocol=udp dst-port=8100-8300 log=no log-prefix=""
6 X ;;; 10000-20000
chain=dstnat action=dst-nat to-addresses=192.168.1.23 to-ports=10000-20000 protocol=udp dst-port=10000-20000 log=no
PBX logs:
[2017-11-27][13:32:46.814] REGISTER 12 headers, 0 lines
[2017-11-27][13:32:46.817] .--------------- --- -- -
[2017-11-27][13:32:46.820] | SIP Reliably Transmitting (NAT) to 89.209.199.9:5060
[2017-11-27][13:32:46.828] |----------- --- -- -
[2017-11-27][13:32:46.831] | REGISTER sip:89.209.199.9 SIP/2.0
[2017-11-27][13:32:46.834] | Via: SIP/2.0/UDP 192.168.1.23:5060;
[2017-11-27][13:32:46.856] | CSeq: 106 REGISTER
[2017-11-27][13:32:46.897] | Event: registration
[2017-11-27][13:32:46.901] | Content-Length: 0
[2017-11-27][13:32:46.910] `------ --- -- -
[2017-11-27][13:32:47.808] .--------------- --- -- -
[2017-11-27][13:32:48.052] | SIP Retransmitting #1 (NAT) to 89.209.199.9:5060
[2017-11-27][13:32:48.056] |----------- --- -- -
[2017-11-27][13:32:48.060] | REGISTER sip:89.209.199.9 SIP/2.0
[2017-11-27][13:32:48.064] | Via: SIP/2.0/UDP 192.168.1.23:5060;
[2017-11-27][13:32:48.081] | CSeq: 106 REGISTER
[2017-11-27][13:32:48.102] | Event: registration
[2017-11-27][13:32:48.109] | Content-Length: 0