in a multi-ISP configuration, I'm routing and NATing specific traffic, e.g. VoIP, through specific interface - to a distinct provider. When one of the interfaces (or routes) becomes unavailable, all connections that were using it have to be dropped, and subsequent traffic has to be routed through the still working connection. Upon change in the status, I'm resetting and loading appropriate iptables and routing entries (it is "shorewall restart" - I'm using shorewall).
The problem is - the still present conntrack entries cause that the old (and now wrong) external address is still being used for NAT for those connections! After 'conntrack -D', the NAT works as expected again.
I'd like to delete only the conntrack entries belonging to the old external address or to solve the problem in a way that wouldn't affect connections through other interfaces.
E.g. - I'd like to delete all conntrack entries having reverse connection destination
udp 17 164 src=192.168.158.3 dst=126.96.36.199 sport=5060 dport=5060 packets=178 bytes=104509 src=188.8.131.52 dst=old.ext.ip.adr sport=5060 dport=5060 packets=234 bytes=127268 [ASSURED] mark=256 secmark=0 use=2
What i've already tried:
# conntrack -D -r 184.108.40.206 ^C (nothing happens, it just hangs) # conntrack -D -r 220.127.116.11 -d 18.104.22.168 Operation failed: such conntrack doesn't exist
Thank you in advance! Best regards, Zrin