Ubuntu comes with a relatively iptables, much simpler firewall configuration tool: UFW
UFW Firewall is uncomplicated firewall, not complex firewall, the cumbersome part of the setup still need to go to iptables
View firewall status
sudo UFW status
Firewall version
sudo UFW version
1. Installation
sudo apt-get install UFW
2. Enable
sudo ufw enablesudo UFW default Deny
After running the above two commands, the firewall is turned on and turned on automatically when the system starts.
All external access to the native is turned off, but the native access is normal externally.
3. Turn ON/off
sudo ufw allow|deny [service]
To turn a port on or off
4. Turn firewall on/off (The default setting is ' Disable ')
sudo ufw enable|disable
eg
sudo ufw allow 3306
To enable MySQL to be accessed remotely, turn on MySQL Port 3306
Ubuntu default firewall install, enable, configure, port, view status related information