Ubuntu14.04 firewall configuration
1. Installation:
Apt-get Install UFW
2. Enable:
UFW Enable
UFW default Deny
3. Turn ON/OFF:
UFW Allow 22/TCP allows all external IP access to the native 22/tcp (SSH) port
UFW deny 22/tcp Disable all external IP access to native 22/tcp (SSH) ports
UFW Delete Deny 22/tcp remove a rule from the firewall
4. Example:
1) View native firewall status:
2) Enable the firewall:
Because I am using the SSH connected server, so when I enable the firewall, the system asks whether to confirm this command operation, this command may disconnect the SSH connection.
3) Add rule:
Adding all external IPs can access 22 port rules per TCP protocol:
Then look at the system firewall state and you will find that the rule has been added:
Adding all external IPs can access 123 ports by TCP protocol:
Disable Port 123:
To remove the 123 port rule:
Allow this IP to access all of the native ports:
Delete the previous rule that you just added:
To disable the firewall:
---Ubuntu14.04 firewall configuration of Linux learning article