Gufw is the desktop version of ufw. The installation and configuration methods of Gufw are available on the Internet, but I think it is not very good. The tutorial on the Internet is also a bit confusing to the public, because according to his statement, the firewall cannot be automatically started at last, every time you need to manually start, and every time you enter the password, it is very troublesome, it is not recommended. It is better to run the ufw in the terminal. Related reading: Install and set up Gufw-ufw GUI firewall under Ubuntu8.10 [multi-diagram] test environment: Ubuntu10.041. install sudoapt
Gufw is the desktop version of ufw. The installation and configuration methods of Gufw are available on the Internet, but I think it is not very good. The tutorial on the Internet is also a bit confusing to the public, because according to his statement, the firewall cannot be automatically started at last, every time you need to manually start, and every time you enter the password, it is very troublesome, it is not recommended. It is better to run the ufw in the terminal.
Read more: Install and set Gufw-ufw GUI firewall in Ubuntu 8.10 [multi-figure]
Test environment: Ubuntu 10.04
1. Install
Sudo apt-get install ufw
2. Enable
Sudo ufw enable
Sudo ufw default deny
After running the preceding two commands, the firewall is enabled and automatically enabled when the system starts.
Disable all external access to the local machine, but the local access to the external is normal.
3. enable/disable
Sudo ufw allow | deny [service]
Open or close a port, for example:
Sudo ufw allow smtp allows all external IP addresses to access the local port 25/tcp (smtp ).
Sudo ufw allow 22/tcp allows all external IP addresses to access the local port 22/tcp (ssh)
Sudo ufw allow 53 allows external access to port 53 (tcp/udp)
Sudo ufw allow from 192.168.1.100 allows this IP address to access all local ports
Sudo ufw allow proto udp 192.168.0.1 port 53 to 192.168.0.2 port 53
Sudo ufw deny smtp prohibit external access to the smtp service
Sudo ufw delete allow smtp delete a rule created above
4. view the Firewall Status
Sudo ufw status
For general users, only the following settings are required:
Sudo apt-get install ufw
Sudo ufw enable
Sudo default deny
The preceding three commands are safe enough. If you need to open some services, use sudo ufw allow.