Masqueraded traffic leaving interface with wrong IP after failover

Hi all, I currently manage an RB2011 with multiple WAN connections. Several scripts monitor the WAN links for packet loss, interface down, and PPPoE down.

If an issue is detected, the route distances are adjusted and the connections table is cleared.

For some time I have been battling an issue where by after a connection comes back up, routes are readjusted and connections are cleared, but some UDP packets will leave the interface with the wrong IP.

Any ideas why this is occurring? I have a simple masquerade rule on the WAN connections.

Thanks

Flush connections when you switch routes?

I am flushing routes after adjusting route distances.

I do not understand why these packets have the wrong IP. Surely all traffic should hit the masquerade rule regardless of connection.

Does anyone else have any ideas? Thanks

Last bump. Hopefully someone is able to assist.