{"id":18808,"date":"2024-05-25T11:15:58","date_gmt":"2024-05-25T11:15:58","guid":{"rendered":"https:\/\/hostvento.com\/kb\/web-hosting\/how-to-set-up-csf-firewall-to-block-traffic-by-country-via-whm-cpanel\/"},"modified":"2024-06-16T16:42:23","modified_gmt":"2024-06-16T16:42:23","slug":"how-to-set-up-csf-firewall-to-block-traffic-by-country-via-whm-cpanel","status":"publish","type":"docs","link":"https:\/\/www.hostvento.com\/kb\/docs\/hosting-faqs\/how-to-set-up-csf-firewall-to-block-traffic-by-country-via-whm-cpanel\/","title":{"rendered":"How to Set up CSF Firewall to Block Traffic by Country via WHM\/cPanel?"},"content":{"rendered":"\n<p>By setting the CSF Firewall, you may choose to block client requests to the server depending on geography. Put simply, the CSF Firewall may be used to restrict internet traffic coming from a certain nation.<\/p>\n\n\n\n<p>We will demonstrate how to use the CSF settings for users with WHM root accounts in this article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">To Block Traffic by Country<\/h2>\n\n\n\n<p>1. Log in to your WHM root account.<\/p>\n\n\n\n<p>2. Select&nbsp;<strong>Plugins<\/strong>&nbsp;from the side menu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.hostvento.com\/kb\/hosting-faqs\/wp-content\/uploads\/2019\/10\/whm_plugins.png\" alt=\"\" class=\"wp-image-12290\"\/><\/figure>\n<\/div>\n\n\n<p>3. Click&nbsp;<strong>ConfigServer Security &amp; Firewall<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.hostvento.com\/kb\/hosting-faqs\/wp-content\/uploads\/2021\/08\/whm_configserver_security_firewall.png\" alt=\"\" class=\"wp-image-12536\"\/><\/figure>\n<\/div>\n\n\n<p>4. Select the&nbsp;<strong>csf<\/strong>&nbsp;tab and click&nbsp;<strong>Firewall Configuration<\/strong>&nbsp;under the&nbsp;<strong>csf-ConfigFirewall<\/strong>&nbsp;section.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.hostvento.com\/kb\/hosting-faqs\/wp-content\/uploads\/2021\/08\/whm_configserverwhm_configserver_security_firewall_csf-min.png\" alt=\"\" class=\"wp-image-12539\"\/><\/figure>\n<\/div>\n\n\n<p>The panel for CSF configurations will open.<\/p>\n\n\n\n<p>4. Search and select the&nbsp;<strong>Country Code Lists and Settings<\/strong>&nbsp;section.<\/p>\n\n\n\n<p>5. Enter the country codes in the&nbsp;<strong>CC_DENY<\/strong>&nbsp;field to block their traffic.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.hostvento.com\/kb\/hosting-faqs\/wp-content\/uploads\/2021\/09\/whm_csf_block_cc.png\" alt=\"\" class=\"wp-image-13105\"\/><\/figure>\n<\/div>\n\n\n<p>6. Once you have entered the country codes, click the&nbsp;<strong>Change<\/strong>&nbsp;button at the end of the panel.<\/p>\n\n\n\n<p>It will save the changes you made.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.hostvento.com\/kb\/hosting-faqs\/wp-content\/uploads\/2021\/08\/whm_restart_csf_ifd.png\" alt=\"\" class=\"wp-image-12555\"\/><\/figure>\n<\/div>\n\n\n<p>7. Click on&nbsp;<strong>Restart csf+lfd&nbsp;<\/strong>to restart the Firewall application. It will apply the changes you made to the Firewall.<\/p>\n\n\n\n<p>With this, the CSF Firewall will block traffic from the country or countries you mentioned in the settings<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By setting the CSF Firewall, you may choose to block client requests to the server depending on geography. Put simply, the CSF Firewall may be used to restrict internet traffic coming from a certain nation. We will demonstrate how to use the CSF settings for users with WHM root accounts in this article. To Block [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":23377,"menu_order":1384,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-18808","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/18808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/comments?post=18808"}],"version-history":[{"count":1,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/18808\/revisions"}],"predecessor-version":[{"id":18811,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/18808\/revisions\/18811"}],"up":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/23377"}],"wp:attachment":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/media?parent=18808"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/doc_tag?post=18808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}