Firewall Src Nat issue wrong reply Dst Address

I have an odd nat problem. It is occurring on a subnet that has VOIP ATA’s the traffic is being routed through a l2tp tunnel to my voice servers. I have similar setups with never this problem.

What is happening is that when the ATA first connects it registers correctly and the screen in ip firewall connections looks correct like in the attachment, but after some time the reply dst address changes to the client public ip, then the ata’s become ungregistered. I am able to fix this by selecting the bad connections and clicking the minus sign. Next time the ATA preregisters (1 min) the reply dst address is correct. I have tried adding additional masq rules, enabling and disabling the sip helper, and made sure the nat setting in asterisk was set to yes for the line (although that usually just creates one way audio if set incorrectly)

ATA 10.10.100.222
Client MT 10.10.100.1
Client MT VPN IP (assigned in secrets of CORE) 10.10.0.227
Client MT PUbic IP. (fake) 4.2.2.2
Relevent Nat rules, the number 3 rule was added to try to force the correct reply dst result.

3 chain=srcnat action=masquerade src-address=10.10.100.0/24
dst-address=10.10.30.0/24 out-interface=l2tp-out1

4 chain=srcnat action=masquerade src-address=10.10.100.0

Relevent routes in client device:
2 ADC 10.10.0.1/32 10.10.0.227 l2tp-out1 0
3 A S 10.10.30.0/24 10.10.0.1 1
4 ADC 10.10.100.0/24 10.10.100.1 phone bridge 0

Core MT Public IP (fake (8.8.8.:sunglasses:
Core MT VPN Local IP 10.10.0.1
Core MT Inside IP 10.10.30.1


Voice server: 10.10.30.144

See how the little word ‘sip’ is appearing in the connections viewer?
That’s the mikrotik barfing all over your SIP packets.
:open_mouth:

Go into IP > Firewall > Service Ports and disable SIP.
This is what’s called an ALG (application layer gateway), which means that the Mikrotik is trying to help the sip work better with NAT. I’ve never personally seen this ALG do anything but screw things up.

When you disable it, things should stop being haunted.

Thanks, I had done that in previous troubleshooting, but not before I made the additional nat rule to force the destination. I will post my results. On a second note, I have seen the what used to be called sip helper make things work when the nat settings were wrong on the * server.

I am happy to say that this seems to have fixed the problem.

I’ve got the same problem with little difference - my VPN is not l2tp, but ovpn.
Now I have switched off sip service in the firewall.
Need some days for testing.
I’ll post the results in a week or some more.

Confirmed. Thanks!