Categories: TutorialsUbuntu

UFW Remove Rule

We all know that a Firewall works on the stated rules. Depending upon the requirements, these rules can be added or omitted from the set of Firewall rules. However, at times, you accidentally add a Firewall rule, or you might not need a certain Firewall rule any longer. In both of these cases, you would feel the need to remove that particular rule. Therefore, in this article, we will teach you how you can remove a UFW rule.

How to Remove a UFW Rule

Before teaching you how you can remove a UFW rule, we will first add a new rule to our Firewall, which we will remove later. To add a new Firewall rule, you can execute the following command. We have added this particular rule for the sake of demonstration. However, you are free to add any rule of your choice.

$

Sponsored
sudo ufw allow 53/tcp

The output presented in the following image shows that the specified Firewall rule has been added successfully:

Now, we will attempt to remove the very same Firewall rule. For that, we will run the following command:

Sponsored
$ sudo ufw delete allow 53/tcp

The following output confirms that the specified Firewall rule has been removed successfully.

Conclusion

By following this very basic yet useful guide, you can quickly remove any UFW rule that you want. All you need to know is the exact rule or its associated number, and you can easily remove any UFW rule of your choice whenever you want.

Ubuntu Server Admin

Recent Posts

Canonical announces 12 year Kubernetes LTS

Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…

23 hours ago

Ubuntu Weekly Newsletter Issue 878

Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…

2 days ago

How your feedback shapes the way we support open source software

At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…

2 days ago

How To Install osTicket v1.14 On Ubuntu 20.04

I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…

3 days ago

How To Install WordPress On Ubuntu 20.04

Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…

3 days ago

How To Install DNS Server (Bind9) On Ubuntu 20.04

Now I want to share the DNS server installation process on your Ubuntu 20.04 server.…

3 days ago