Reset Firewall Ubuntu 18.04: Resetting firewall will helps you to manage the incoming and outcoming traffic to your server. By using a Firewall, You can close any unwanted ports and essential ports to your server. The most commonly accessing ports of the servers are “Port 80, Port 443 & Port 22“. To reset the Firewall settings you will need a DigitalOcean droplet running Ubuntu 18.04 or Ubuntu 16.04 and you will additionally need an SSH or Putty Software to access the Droplets.
- Needs of Firewall Resetting
- Disabling UFW
- Resetting UFW
- Deny All Incoming Request
- Allow All Outgoing Request
- Defining Ports
- Enabling UFW
Needs of Firewall Resetting:
Sometimes you may not be allowed to connect to your website or your droplet. This is due to the firewall disabled your incoming request to your droplet. Actually, you need to adjust the Firewall setting to default state to prevent the incoming and outgoing traffic request from your server. Resetting the firewall to a default state and allowing connections through to the ports you are trying to access may resolve the issue or rule out the firewall as a potential source.
In Ubuntu 16.04 or 18.04, UFW is expanding as “Uncomplicated Firewall“. You need to disable and reset the firewall and permitting the firewall to allow all connections through the most common parts.
You need to disable the UFW by using the following command.
By implementing the above command, you will able to connect to your server through the SSH connection If you are facing still any issues in connecting to your server and then you need to do some more resetting options for a firewall.
Resetting UFW:By implementing the above command, The UFW will remove all existing rules of Firewall and allow us to start from scratch.
Deny All Incoming Request:
The above command will deny all your Incoming Request to your server. We will define the ports in the below steps and follow the below steps to enable the Ports.
Allow All Outgoing Request:
The above command will allow you enabling the outgoing traffic from your server to the outside world.
The command to add a port through remains the same, only the port will change.
- SSH – Port 22
- HTTP – Port 80
- HTTPS – Port 443
Allow TCP connections on Port 22:Allow TCP connections on Port 80: Allow TCP connections on Port 443:
The above command will help you to enable the UFW to your server. This will allows an incoming and outgoing request to your server.
That’s it, friends. This article will help you reset the firewall settings to your server on Ubuntu 16.04 or Ubuntu 18.04 server. If you have any queries and then feel free to comment on us.
For more article, kindly visit our HomePage