--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/iptables.rst Tue Feb 26 00:30:42 2019 +0200
@@ -0,0 +1,41 @@
+
+==========
+ iptables
+==========
+.. contents::
+ :local:
+
+View iptables rules
+===================
+
+In command format with ``-S``::
+
+ iptables -S
+
+In table format with ``-L``::
+
+ /sbin/iptables -L
+ iptables -L
+ iptables -L INPUT
+ iptables -L OUTPUT
+
+Show rule stats (#packets/#bytes) with ``-v``::
+
+ iptables -L -v
+
+To clear stats counters::
+
+ sudo iptables -Z
+ sudo iptables -Z INPUT
+
+Blocking incoming connections
+=============================
+
+For given protocol, device and port::
+
+ sudo iptables -A INPUT -i eth0 -p tcp --dport 9200 -j DROP
+
+To delete rule::
+
+ sudo iptables -D INPUT -i eth0 -p tcp --dport 9200 -j DROP
+