HG Firewall Plugin
HostGator offers the HG Firewall plugin for managing firewall settings from WHM. HG Firewall is available to customers who are administrating VPS or Dedicated servers. This article will detail how to access and use this plugin.
- How to access and use HG Firewall↴
- Opening an outbound port↴
- Opening an inbound port↴
- Blacklisting an IP address↴
- Whitelisting an IP address↴
- How to add a custom iptables rule to a chain↴
The following video will provide instructions on how to access and use the HostGator Firewall plugin:
How to access and use HG Firewall
To access HG Firewall on your VPS or Dedicated server:
- Log in to WHM as root.
- Select HG Firewall Administration from the Plugins section in the left-hand navigation bar:
This will open up the HG Firewall management screen. From here, you may open ports, whitelist or blacklist IP addresses, add custom rules, delete rules, and even stop, start, and restart the firewall service.
Locate the buttons for managing the service
Click the desired button:
- Stop- is used to disable the firewall (Not recommended except as a temporary troubleshooting step).
- Start - is used to start the stopped firewall service.
- Restart- is used to restart the firewall quickly.
Removing a rule that has been previously added
- Scroll to the list of existing firewall rules:
- Double-click on the existing rule that you would like to delete.
- Restart the firewall service to ensure that the rule is cleared.
Opening an outbound port
Outbound ports allow services hosted locally on the server to connect outbound to external servers. For example, if you have software installed that needs to send mail using SMTP via an external server, port 26 may need to be opened outbound to allow the software to connect externally. To open an outbound port:
- Enter the desired port number in the text box.
- Click Open Port.
Your software and services should now be able to connect to external servers via the opened port. If it is not yet working, please attempt to restart the firewall.
Opening an inbound port
Inbound ports are required for external software and services to access services on your server. For example, the correct SSH port (22 by default on VPS and Dedicated servers) needs to be open to using SSH to access your server. To open inbound ports:
- Enter the desired port number in the text box.
- Click Open Port.
You should now be able to access your server via the now open port. If it is not yet working, please attempt to restart the firewall.
Blacklisting an IP address
You may entirely deny access to your server to specific IP addresses by using this blacklist. To add an IP address to the blacklist:
- Enter the desired IP Address in the text box.
- Click Block IP.
Whitelisting an IP address
You may whitelist an IP address that you have previously denied access to or which has in some other way become blacklisted. To add an IP address to the whitelist:
- Enter the desired IP Address in the text box.
- Click Add IP.
How to add a custom iptables rule to a chain
The most powerful feature of the HG firewall is the ability to add custom iptables rules to your chain of firewall rules.
To add a custom rule:
- Enter the correctly formatted iptables rule into the text box (You may omit the prefix iptables as this will be added automatically).
- Click Add Rule.