How to solve these challenges:


Challenge #1

Write the iptables commands that set the default POLICY to ACCEPT on INPUT and OUTPUT chains and DROP on FORWARD chain.

Are you stuck? Do you want to see the solution for this exercise? Click here.


Challenge #2

Write the iptables command that lists only the filter table of INPUT chain.

Are you stuck? Do you want to see the solution for this exercise? Click here.


Challenge #3

Write the iptables commands that list the nat table.

Are you stuck? Do you want to see the solution for this exercise? Click here.


Challenge #4

Write the iptables command that flushes the filter table of all chains.

Are you stuck? Do you want to see the solution for this exercise? Click here.


Challenge #5

Write an iptables rule that drops all incoming packets to port 22/tcp (ssh). This should be the first rule in the chain.

Are you stuck? Do you want to see the solution for this exercise? Click here.


Challenge #6

Write the iptables commands that flush all the tables of all chains and set the ACCEPT policy on all chains. This will delete any firewall.

Are you stuck? Do you want to see the solution for this exercise? Click here.