Check to see if the system has a firewall pre-installed. This command will also show any rules that have been applied. Use the following command to check it's status. The UFW firewall will not be enabled or started after it has been installed. Use the following commands to check it's status and change it's options. The last section will cover how to add and remove rules.
Check firewall status
Use the verbose option for a more detailed output.
Enable, Disable, Start and Stop
The UFW firewall is not enabled on startup on defualt.
If the UFW firewall is not already on the system
It can be easily installed using the following commands
Update the system and install UFW
Enable the UFW firewall on system start
Enable on startup and confirm
By default, no rules will be applied. If you would like to add any, the following commands can be used. In this example a rule for ssh will be added to the firewall which will allow all connections from this protocol
Allow SSH through the firewall
Confirm the rule was added
Use the following commnads to remove a rule