Enable UFW (Uncomplicated Firewall) on Ubuntu

The default firewall configuration tool for Ubuntu is ufw (Uncomplicated Firewall). Developed to easeiptables firewall configuration,ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled.

Step 1: Enabling / Disabling ufw
To enable it, you just need to type the following command at the terminal.
# sudo ufw enable

Firewall is active and enabled on system startup

To disable it, just type.

# sudo ufw disable

Step 2: List the current ufw rules
After the firewall is activated you can add your rules into it. If you want to see what are the default rules, you can type.

  
# sudo ufw status verbose

sample output:

    
        Status: active
        Logging: on (low)
        Default: deny (incoming), allow (outgoing)
        New profiles: skip

Step 3: Adding specific rules to ufw
You can specify or add the port range which you want to setup with ufw.
# sudo ufw allow <port>/<optional: protocol>

Example: To allow incoming tcp and udp packet on port 53

# sudo ufw allow 53

Example: To allow incoming tcp packets on port 53

# sudo ufw allow 53/tcp

Example: To allow incoming udp packets on port 53

# sudo ufw allow 53/udp

If you need any assistance from our support person, you can contact us at [email protected] and [email protected] , we would be happy to help you.
  • 0 Kunder som kunne bruge dette svar
Hjalp dette svar dig?

Relaterede artikler

Increase PHP file Upload size in windows server 2008

The php.ini file is the default configuration file for running applications that require PHP. It...

Setup Basic POP3/IMAP Mail Server in Centos/RHEL

Setup Basic POP3/IMAP Mail Server in Centos/RHELSetting up a mail server can be quite...

How Do I access RDP

Remote Desktop Protocol (RDP) is a proprietary protocol developed by Microsoft, which provides a...

Update Time-Zone on OpenVZ VPS

OpenVZ will reflect the host server’s time by default, You can configure your VPS with custom...

Enable TUN/TAP in Solus VM

 TAP (as in network tap) simulates a link layer device and it operates with layer 2 packets such...