Allow port with ufw using ubuntu via command

Introduction

The Unified Firewall (UFW) is a network firewall technology that allows network administrators to control the incoming and outgoing traffic on their networks. UFW can be used to protect networks from malicious attacks, prevent unauthorized access to systems, and protect data from being stolen.

In this post, You will get information about How to allow port in ufw firewall using command line in ubuntu linux.

Step 1: Get UFW status

You need to 1st check your ufw service is status by using given command.

sudo systemctl status ufw.service

Step 2: Allow port in UFW Firewall

You need to execute the following command in order to allow the port ufw firewall service.

sudo ufw allow <PORT-NUMBER-HERE>

for example with port 80.

sudo ufw allow 80

Step 3: Validate the Rule

You need to execute the given command to check the rule applied or not.

sudo ufw status 

Conclusion

We have successfully allow the port number in UFW firewall using command line, Kindly report in case you are facing difficulties with following details.

  • OS name
  • OS version
  • Package name
  • Logs – Error / Warning / failed
Allow port with ufw using ubuntu via command

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top