How to whitelist/blacklist IP addresses using command line and GUI in CSF firewall? Print

  • 0

CSF or ConfigServer security and firewall inside WHM allows you to whitelist or blacklist IP addresses and ports to your Linux servers. Here, we have mentioned how you can perform an IP address whitelist and blacklist using CSF CLI and GUI.

How to blacklist IP address using GUI in CSF?

  1. Login to your WHM panel using root user. 

  2. Inside the plugin, click on the configserver security and firewall.



  3. Click on the Firewall Deny IPs button and enter the IP address that you want to blacklist. 



  4. After adding the IP address, click on the change button. 

  5. Finally, restart the firewall using Restart csf+lfd button. 

How to whitelist IP address using GUI in CSF?

  1. Login to your WHM panel using root user. 

  2. Inside the plugin, click on the configserver security and firewall.



  3. Click on the Firewall Allow IPs button and enter the IP address that you want to blacklist. 



  4. After adding the IP address, click on the change button. 

  5. Finally, restart the firewall using Restart csf+lfd button. 

How to blacklist IP address using CLI in CSF?

  1. Login to your linux server using root or sudo user. 

  2. Go to the path /etc/csf/.

  3. Inside the CSF directory, edit the file called csf.deny. You can use your favourite editor to edit the file. 

  4. Add the IP address into the list which you want to blacklist. Save the file.

  5. Restart the firewall after adding the  IP address. Run the below command to restart the firewall.

    csf-r

How to whitelist IP address using CLI in CSF?

  1. Login to your linux server using root or sudo user. 

  2. Go to the path /etc/csf/.

  3. Inside the CSF directory, edit the file called csf.allow. 

  4. Add the IP address which you want to whitelist. Save the file. 

  5. Restart the firewall after adding the  IP address. Run the below command to restart the firewall.

    csf-r

Was this answer helpful?

« Back
Sign up for a newsletter

chat