Linux Iptable default security ruleset

If you want to more higher security level of network. i recommend to use iptables.

Default ruleset need to ssh and outbound accept.

#Default Ruleset

sudo iptables -P INPUT ACCEPT
sudo iptables -F
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -P INPUT DROP
sudo iptables -P FORWARD DROP
sudo iptables -P OUTPUT ACCEPT
sudo iptables -L -v

And, if you need to connect some service per host.

i recommend to open the ip level.

 

#IP level open

sudo iptables -A INPUT -s x.x.x.x -j ACCEPT

 

Then, finally save the iptables

sudo iptables-save

 

 

 

 

Facebook Comments

Leave A Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.