Before I begin, let me introduce the basic structure of my Asterisk server.
Asterisk uses PJSIP, connected to an ISP-provided SIP service on one side and multiple extensions on the other.
The server itself has several NICs: ens33, ens34, ens35, and ens37. Among them, ens33 is for internet connection using DHCP; ens34 is for other purposes with IP 192.168.11.11/255.255.255.0; ens35 is for ISP-provided SIP service using DHCP, with an assigned address range in 172.0.0.0/7 (which I believe is incorrectly configured as it includes global IPv4 addresses); and ens37 is for other extensions connecting to Asterisk, using IP 192.168.33.1/255.255.255.0.
Now, considering my situation, I have allocated two transports in pjsip.conf as follows:
[external-udp]
type=transport
protocol=udp
bind=173.28.123.123 // ip address for ens35 which is dynamically configured
[internal-udp]
type=transport
protocol=udp
bind=192.168.33.1 // ens37 for extensions
Then, I used ip route add 172.0.0.0/7 dev ens35
to manually control routing in the multi-NIC setup.
However, Asterisk is unable to register with the ISP’s SIP service. Packet capture shows that Asterisk attempts to send packets with 173.28.123.123 as the source IP via ens34, which is futile.
My confusion is, given that I’ve already configured the bind address and routing for ens35, why is Asterisk still sending register packets from ens34? Where might the issue be?
Moreover, how should the bind address be handled in the case where ens35’s IP is dynamically assigned via DHCP? Could this be related to my problem?
Any suggestions would be greatly appreciated!