Skip to contentSkip to conversation

Flushing Conntrack Entrys

DISCUSSION VeNoMouS 2 participants 2 messages Aug 20, 2004 netfilter

lore
Share & tools
lore

VeNoMouS

author
#0 lore raw

How hard would it be to flush conntrack entries matching to a certain ip?

The issue im having is that i have a fake dns server on port 54 if they are not in the DNS table i created then it goes via redirect to 54, now the issue is when i put them into the DNS table they start getting tracked in the conntrack but when i remove them out of the DNS table they are in the conntrack for x amount of seconds, which means if i removed them they could do ssh over dns creating a tunnel, keeping the conntrack entry alive.

now how badly would the conntrack go mental if i were to delete an entry from the conntrack with some code.

#1 lore raw
Quoted 1 line · VeNoMouS

How hard would it be to flush conntrack entries matching to a certain ip?

See ctnetlink for an official API for doing this kind of stuff.

Or if you want to do it in kernelspace see the MASQUERADE target. It does exacly this when the IP of the MASQUERADE:d interface changes.

Or you could continue filtering the traffic even if the connection is not NEW. CONNMARK could be helpful there to aid in information about the specific connection especially so if there is NAT involved.

Quoted 1 line

now how badly would the conntrack go mental if i were to delete an entry from the conntrack with some code.

It should be quite happy.

Regards
Henrik