Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to turn Ubuntu Firewall off or on

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to turn off or open the Ubuntu firewall. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

The method is as follows

1. First open the terminal command line of Ubuntu

In order to use the bash command, we need to open the terminal tool. We can use the alt+t shortcut to open the terminal. You can also use the mouse click terminal tool. As shown in the figure

2. View the current firewall status

In Ubuntu, we use the sudo ufw status command to view the current firewall status; the inactive state is the firewall off state. Active is on.

3. Turn on the firewall

In Ubuntu, we use the sudo ufw enable command to develop the firewall. Use the sudo ufw status command to check the status after the firewall is enabled. The active indicates that the firewall is enabled successfully.

4. Turn off the firewall

In Ubuntu, we use the sudo ufw disable command to turn off the firewall. After executing this command, we use the sudo ufw status command to check the status of the current firewall. If it is inactive, our firewall has been turned off.

5. Other commonly used firewall commands in Ubuntu

Ufw default allow/deny: foreign access allowed / denied by default

Ufw allow/deny 20: allow / deny access to port 20, followed by / tcp or / udp to indicate tcp or udp packets.

Ufw allow/deny servicename:ufw finds the port of the corresponding service from / etc/services and filters it.

Ufw allow proto tcp from 10.0.1.0 to Native ip port 25: allows tcp packets from 10.0.1.0 shock 10 to access port 25 of the native machine.

Ufw delete allow/deny 20: remove the previously defined "allow / deny access to port 20" rule

For example, enable port 80 to be accessed, as shown in the following figure

This is the end of the article on "how to close or open the Ubuntu firewall". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report