Iptables: Difference between revisions
From James's Wiki
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
set overall policies: | set overall policies: | ||
iptables - | iptables -P INPUT DROP | ||
iptables -P FORWARD ACCEPT | iptables -P FORWARD ACCEPT | ||
iptables -P OUTPUT ACCEPT | iptables -P OUTPUT ACCEPT |
Revision as of 04:17, 25 February 2018
to save firewall rules use:
sudo dpkg-reconfigure iptables-persistent
or (stretch):
sudo dpkg-reconfigure iptables-persistent
allow ssh:
sudo iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT sudo iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
delete by number:
sudo iptables -L --line-numbers sudo iptables -D INPUT 3
set overall policies:
iptables -P INPUT DROP iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT
references: