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 set up and enable the built-in firewall ufw for raspberry pie

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article is about how to set up and enable the built-in firewall ufw for raspberry pie. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Ufw is a host-side iptables firewall configuration tool, which is easy to use. If you have a raspberry pie exposed to the public network, you can improve security through this simple configuration.

Installation method

Sudo apt-get install ufw

Of course, there is a graphical interface (relatively crude). Search gufw in Synaptic.

Usage

Enable

Sudo ufw enablesudo ufw default deny

Function: turn on the firewall and turn off all external access to the machine at the same time as the system starts (local access is external normal).

Close

Sudo ufw disable

View firewall status

Sudo ufw status

Enable / disable the corresponding port or service example

Sudo ufw allow 80 allow external access 80 Port sudo ufw delete allow 80 disable external access Port 80 sudo ufw allow from 192.168.1.1 allow this IP access to all native ports sudo ufw deny smtp prohibit external access to smtp service sudo ufw delete allow smtp delete a rule established above ufw deny proto tcp from 10.0.0.0 port 8 to 192.168.0.1 port want to deny all traffic from TCP 10.0.0. Address from 0bank 8 to port 22 192.168.0.1

All RFC1918 networks (Lans / WLANs) can be allowed to access this host (/ 8, 16 and 12 is a network rating):

Sudo ufw allow from 10.0.0.0/8sudo ufw allow from 172.16.0.0/12sudo ufw allow from 192.168.0.0/16

Recommended settin

Sudo apt-get install ufwsudo ufw enablesudo ufw default deny

This setting is already very secure, and if you have special needs, you can use sudo ufw allow to turn on the service.

Thank you for reading! This is the end of the article on "how to set up and enable the built-in firewall ufw for raspberry pie". 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, you can 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

Internet Technology

Wechat

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

12
Report