[ About | Licence | Contacts ]
Written by Oleksandr Gavenko (AKA gavenkoa), compiled on 2020-02-13 from rev d88d5d1a8cd9+.

iptables

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