www/content/blog/commands/clean-conntrack-states.md

17 lines
524 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Clean conntrack states"
linkTitle: "Clean conntrack states"
date: 2018-03-02
description: >
Clean conntrack states
---
Here is an example of how to clean conntrack states that match a specific query on a linux firewall :
{{< highlight sh >}}
conntrack -L conntrack -p tcp orig-dport 65372 | \
while read _ _ _ _ src dst sport dport _; do
conntrack -D conntrack proto tcp orig-src ${src#*=} orig-dst ${dst#*=} \
sport ${sport#*=} dport ${dport#*=}
done
{{< /highlight >}}