-j target jump what to do if the condition is met for the packet (ACCEPT, DROP, RETURN)Īllows all packets which have already established connection through even after adding new rules iptables -A INPUT -m conntrack -ctstate ESTABLISHED,RELATED -j ACCEPTĪccept all connections for port 22 and 80 iptables -A INPUT -p tcp -dport 22 -j ACCEPT iptables -A INPUT -p tcp -dport 80 -j ACCEPTĪccept all loopback connection and put it on line 1 INPUT chain rule iptables -I INPUT 1 -i lo -j ACCEPTĪdd the drop rule for INPUT chain at the last line iptables -A INPUT -j DROP.-I inserts a new rule at the line number.-A appends rule to the end of the table.Iptables -L -line-numbers iptables -S iptables -L -t nat iptables -S -t nat iptables -L -t raw iptables -S -t raw iptables -S POSTROUTING -t nat iptables -S INPUT iptables -L -v Creating default rules iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPTįlush rules by using iptables -F this will flush everything except the default rules Extending rules -line-numbers shows line numbers per chain.-t is tables (filter raw, nat, mangle, security).-S is command style display which is easier to understand.-L is for table style display which is much harder to read.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |