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

How to Fix VMware’s “Could not open /dev/vmmon” Error on Ubuntu

You’ve recently installed VMware Workstation on your Ubuntu system and encountered the frustrating “Could not…

3 hours ago

How to Fix Ubuntu 404 Errors While Fetching Dependencies

Have you ever found yourself staring at a terminal full of 404 errors while trying…

3 hours ago

How to Fix ‘Please Install All Available Updates’ Error When Upgrading Ubuntu 18.04 to 20.04 LTS

One particularly frustrating error that many users face when trying to upgrade from Ubuntu 18.04 …

3 hours ago

How to fix “Release is not valid yet” Error in Docker Containers

In the world of containerization, time synchronization issues can create unexpected roadblocks when working with…

3 hours ago

How to fix “Externally Managed Environment” Pip Errors on Ubuntu

If you’ve recently upgraded to Ubuntu 23.04 or newer, you might have encountered a frustrating…

3 hours ago

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI…

10 hours ago