If your firewalld is installed, there here are the commands useful in daily management

Check state of firewall

sudo firewall-cmd --state

Start firewall

sudo systemctl start firewalld

Stop firewall

sudo systemctl stop firewalld

Enable to autostart with system start

sudo systemctl enable firewalld

Add rule for given port number

sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --list-ports

The last line is responsible of listing all available ports for verification

Remove rule for given port number

sudo firewall-cmd --zone=public --remove-port=80/tcp --permanent
sudo firewall-cmd --reload
Ubuntu firewalld – few useful commands

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Widgets powered by AB-WebLog.com.