• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How to Disable or Enable Firewall in Ubuntu Linux

How to Disable or Enable Firewall in Ubuntu Linux

By Sourabh / June 8, 2022 Category: How To, Ubuntu

How to check firewall in Ubuntu Linux? Useful Ubuntu firewall commands to disable firewall in Ubuntu and enable firewall in Ubuntu.

Check Status of Firewall in Ubuntu Linux

ufw – Uncomplicated Firewall is the default firewall configuration tool for Ubuntu. Developed to ease iptables firewall configuration, ufw provides a user-friendly way to create an IPv4 or IPv6 host-based firewall.

Note that ufw by default is initially disabled.

“ufw is not intended to provide complete firewall functionality via its command interface, but instead provides an easy way to add or remove simple rules. It is currently mainly used for host-based firewalls.”

To check the status of Ubuntu firewall, use ufw command. This command displays what rules are currently configured in the firewall of the system.

$ sudo ufw status

You can also use the iptables command to list all configured firewall rules.

$ sudo iptables -L

How to Disable Firewall in Ubuntu Linux

To disable and turn off the Ubuntu firewall, use the following command.

$ sudo ufw disable

The above command will disable the firewall from starting automatically upon system reboots.

If you want to delete all configured ufw rules and set the firewall back to default settings, run the ufw command with reset option.

$ sudo ufw reset

Linux users can also use iptables commands to bypass the ufw interface and manage the system firewall directly. The following set of commands can be used:

sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
sudo iptables -X
sudo iptables -t nat -F
sudo iptables -t nat -X
sudo iptables -t mangle -F
sudo iptables -t mangle -X

How to Enable Firewall in Ubuntu Linux

To enable and turn on the firewall use the following command.

$ sudo ufw enable

Primary Sidebar

Latest Posts

Downlaod Ubuntu 26.10 Stonking Stingray

How To Shutdown Linux With A 15 Minute Delay And Message

Using Linux Terminal How To Get Total Disk Size In GB

Count And Find Number Of Files In A Linux Directory Using Command

Check How Many Users Are Created In Linux Ubuntu

How To Check User Permissions In Linux Using Command

Check Which Folder Is Taking More Space In Ubuntu Linux

How to Install Claude Desktop App in Ubuntu Linux

Job Scheduling Using At Command In Linux With Examples

How To Check Permissions Of A Directory In Linux Command

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap