aboutsummaryrefslogtreecommitdiff
path: root/content/blog/commands/clean-conntrack-states.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/blog/commands/clean-conntrack-states.md')
-rw-r--r--content/blog/commands/clean-conntrack-states.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/blog/commands/clean-conntrack-states.md b/content/blog/commands/clean-conntrack-states.md
new file mode 100644
index 0000000..8a78930
--- /dev/null
+++ b/content/blog/commands/clean-conntrack-states.md
@@ -0,0 +1,17 @@
+---
+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 >}}