Member-only story

How to Delete Net Filter Firewall Rules on Linux

UFW: A User-Friendly and Robust Firewall Manager.

Mwiza Kumwenda
2 min readMar 18, 2024
Photo by Sigmund on Unsplash

Uncomplicated Firewall (UFW) is an excellent firewall manager, offering a user-friendly interface for effortlessly managing firewall rules on Linux.

To enhance your Linux system security and reduce the attack surface, you should always delete inactive or unused firewall rules.

Listing UFW Rules

Prior to making any adjustments to your UFW rules, it’s crucial to have a clear understanding of your firewall’s current state.

List or view your current UFW firewall rules using the following command.

sudo ufw status

Note that, you need elevated privileges to configure or modify UFW rules.

Deleting Firewall Rules

There are multiple methods for deleting firewall rules on Linux. One efficient approach is to remove a firewall rule based on its rule number.

To display firewall rules along with their corresponding rule numbers, simply run the following command.

sudo ufw status numbered

--

--

Mwiza Kumwenda
Mwiza Kumwenda

No responses yet