You'll do this lab on your Ubuntu virtual machine.
- Shut down your Ubuntu virtual machine, and create a snapshot.
You'll roll back to this snapshot for the lab in the next section.
- Look at your iptables rules, or lack thereof, with:
sudo iptables -L
- Create the rules that you need for a basic firewall, allowing for Secure Shell access but denying everything else:
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT sudo iptables -A INPUT -j DROP
- View the results with:
sudo iptables -L
- Oops, it looks like you forgot about that loopback interface. Add a rule for it at the top of the list:
sudo iptables -I INPUT 1 -i ...