- Write the iptables commands that set the default POLICY to ACCEPT on INPUT and OUTPUT chains and DROP on FORWARD chain.
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
- Write the iptables command that lists only the filter table of INPUT chain.
- Write the iptables commands that list the nat table.
- Write the iptables command that flushes the filter table of all chains.
- Write an iptables rule that drops all incoming packets to port 22/tcp (ssh). This should be the first rule in the chain.
iptables -t filter -I INPUT -p tcp -dport 22 -j DROP
- 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.
iptables -t filter -F
iptables -t nat -F
iptables -t mangle -F
iptables -t raw -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT