Summary of common linux commands

iptables

Add and remove agreements

iptables -A INPUT -p tcp -dport 80 -j DROP

-A: The parameter is regarded as adding an INPUT rule
-p: specify what protocol is our commonly used tcp protocol, of course, there are also udp such as DNS of port 53
-dport: is the target port when data enters the server from the outside as the target
port- j: is to specify whether ACCEPT receives or DROP does not receive

Clear all protocol rules

iptables -F (flush clears all defined rules)

View existing protocol rules

iptables -nxvL INPUT

Leave a Comment

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