In this hands-on lab, we will work with firewalld via YaST to enable the firewall as well as allow some ports. This is a fundamental process for any administrator and something that should be considered a basic task.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Verify the Status of the Firewall on the Affected System
Check iptables:
sudo iptables -S
Verify the rules are blank.
- Use YaST to Enable the Firewall, Move the Interface, and Allow the Appropriate Services
Open YaST:
sudo yast
Under Security and Users > Firewall > Start-Up, set the current status to be start, and after reboot to start.
Go to Interfaces, and move the eth0 interface to the public zone.
Configure the public zone to add HTTP, and confirm that at least HTTP and SSH are allowed
Save the configuration and exit YaST.
- Verify That the Firewall Is Set Correctly
Check iptables:
sudo iptables -S
Near the end of the listing, you should see the rules for:
-A IN_public_allow -p tcp -m tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT -A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT