RTP packets are going out with the wrong IP address

I accidentally ran into an unusual problem because I have a VIP address for Asterisk on the server. SIP packets are correctly sent via the VIP IP, but RTP packets are sent from the network card’s source address. I have configured the transports, but for some reason, it doesn’t work.

[10.10.3.10-udp]
type=transport
protocol=udp
bind=10.10.3.10:5060
external_media_address=10.10.3.10
external_signaling_address=10.10.3.10
allow_reload=yes
tos=cs3
cos=3
local_net=10.10.3.0/24 ← Network Asterisk Server
local_net=10.20.1.0/24 ← Network VoIP Phone

sudo asterisk -rx “rtp show settings”

General Settings:

Port start:      10000
Port end:        20000
Checksums:       Yes
DTMF Timeout:    1200
Strict RTP:      Yes
Probation:       4 frames
Replay Protect:  Yes
ICE support:     Yes
STUN address:    0.0.0.0:0

The routing is fine because I’m using a separate table, and all incoming traffic to the VIP should go out via the VIP address. This works for SIP. However, RTP packets are sent from the network card’s address, not the VIP. The RTP packets are going out with the address 10.10.3.12.

The network card has two IP addresses:

10.10.3.10 ← VIP
10.10.3.12 ← network card’s address

Having the external address on the local network is not an intended use of the feature.

Asterisk will rely on the kernel routing tables to determine the outgoing interface for media. If you are doing something tricky with those, you need to provide the details.

This has been multiposted to RTP packets are going out with the wrong IP address - Configuration - FreePBX Community Forums where there are more extensive replies.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.