I have a problem when I want to use our in-house PBX over an IKEv2/IPsec connection. When I do a call to a team mate in-house they can’t hear me, but I can hear them.
So I did some research and it seems it’s a problem with NAT. In the connection table I saw, that the reply dst address for the RTP-stream is wrong, which probably causes the issue.
The next thing I don’t understand is: Why is there a NAT between the IKEv2/IPsec network and the in-house network?
Can this NAT be removed and if yes, how?
I’ll try to clarify this. The IPsec policy is matched against outbound packets after almost all routing and firewall work has been done, just before the packet would be sent out via the interface found using standard routing rules and firewall rules. This means that if the default route uses an output interface for which src-nat is configured (like in your case, masquerade is a special case of src-nat), the packet is src-nat’ed. Your IPsec policy matches any src address so it matches the packet even though it has been src-nat’ed, but the question is how the recipient of such packet likes packets which come from an unexpected source address (there may be firewall rules dropping such packets, or the phone/PBX may ignore them).
to insert an exception rule before the masquerade one in chain
srcnat
of table NAT to see whether that helps.
Also, if you use fasttrack (if yes, there is a rule with ****
action=fasttrack-connection
somewhere in chain
forward
of
/ip firewall filter
), you need to create an exception from that rule for both packets sent to 192.168.2.0/24 and packets arriving from there, because fasttracked packets bypass IPsec policy matching too.
Or you can replace both the above by rules in ****
/ip firewall raw
table with
action=no-track
for packets sent to and coming from 192.168.2.0/24 if you don’t need a stateful firewall between the networks for some other reason.