Managing Linux VPS Firewall Rules

From Wiki
Jump to: navigation, search

Adding an allow rule to a Linux VPS Firewall


You want to open up a custom TCP or UDP port on your VPS, but want to restrict it such that only a specific IP address can connect on that port.


You will need to create an allow rule for your server's firewall. For example, you want to open TCP port 6201, but you only want the address to have access. The rule would look like this:

tcp|in|d=6201|s= #Some useful description

Let's discuss each part of this sample rule. The first part is the protocol: tcp. The next part is the direction, which is inbound traffic. The next part is the port, 6201. The next part is the source IP address that you want the rule to apply to, And finally, you can put some short worthwhile comment on the end to remind yourself later what the rule is for.

Now, let's say for example that you want to allow inbound UDP port 6203, but you only want IP address to have access. The appropriate command would look like this:

udp|in|d=6203|s= #Another useful description.

Steps for adding firewall allow rules


  1. Log into WHM on your server at https://your_server_IP:2087
  2. Once logged in, scroll down and click on ConfigServer Security&Firewall
  3. Click on the Fireawll Allow IPs button
  4. Add the rule you created