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

Meet the Canonical Ceph team at Cephalocon 2024

Photo by Jeton Bajrami on Unsplash Date: December 4-5th, 2024 Location: Geneva, Switzerland In just…

50 minutes ago

The transition to in-house software development in the automotive industry

Who will win the race to the perfect SDV? The automotive industry is experiencing a…

51 minutes ago

Profile-guided optimization: A case study

Software developers spend a huge amount of effort working on optimization – extracting more speed…

52 minutes ago

Ubuntu Weekly Newsletter 866

Welcome to the Ubuntu Weekly Newsletter, Issue 866 for the week of November 10 –…

17 hours ago

Ubuntu vs Debian: Linux Distributions Compared Deep Dive

Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…

1 day ago

How to Install Google Cloud BigQuery Python client library on Linux

In this article, we will see how to Install Google Cloud BigQuery Python client library…

3 days ago