• 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

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

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

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