Firewalls place a barrier between your servers and other machines on the network to protect them from external attacks. Firewalls can be host-based, which are configured per server using services such as IPTables or UFW. Others are network-based, designed to stop traffic before anytime.

The firewall service is available in all regions and at no cost.

Firewall rules are for inbound connections only.

To create the firewall rules, click on the instance name and on the instance details page, click the Firewall menu

instance-create

Its initial configuration allows connection on all inbound ports. You can change the default rules to Drop all traffic and create the rules of the firewall allowing access to your instance.
In this tutorial, we will be some rules to block access to instance.

firewall-default

Click the New Firewall Rule button to add your rules.

rule-firewall

  • Rule Type: Select a preconfigured rule for your service or select Custom to set the port as needed
  • Protocol: TCP or UPD
  • Port: Type a single port (80), a list (80,8080), a range of ports (80: 8000) or leave it empty for all ports.
  • Source IPs: Enter the IP or Range you want to block or allow according to your rule.

Click the Add Drop Firewall Rule button to add your rule.

After configuring the firewall rules, click the Apply All Changes button.

apply-firewall

To delete a rule, select the rule and click the Delete Selection button.

delete-rule-firewall

Read more about: Instances