Firewall Gufw-ufw under Ubuntu

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.