{"id":3469,"date":"2020-06-23T15:09:02","date_gmt":"2020-06-23T20:09:02","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=3469"},"modified":"2020-06-23T16:14:19","modified_gmt":"2020-06-23T21:14:19","slug":"whm-cpanel-firewall","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/whm-cpanel-firewall\/","title":{"rendered":"WHM\/cPanel Firewall"},"content":{"rendered":"\n<p>Had a weird issue where a certain address was unable to access the cpanel server, but it was intermittent with it working some times, but failing at other times.<\/p>\n\n\n\n<p>Ended up being the firewall on the WHM server blocking that particular IP address due to failed log in attempts.<\/p>\n\n\n\n<p>Check the status of LFD (Login Failure Daemon)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl status lfd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How do I know which IP&#8217;s are being blocked?<\/h2>\n\n\n\n<p>Check the logs, dmesg or tail \/var\/log\/messages<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[1122639.674605] Firewall: <em>UDP_IN Blocked<\/em> IN=eth0 OUT= MAC=8e:23:f5:16:a6:b1:cc:51:54:6a:2e:ea:14:00 SRC=72.211.105.113 DST=192.168.1.12 LEN=64 TOS=0x00 PREC=0x00 TTL=246 ID=40014 PROTO=UDP SPT=9307 DPT=161 LEN=44\n[1122646.728510] Firewall: <em>TCP_IN Blocked<\/em> IN=eth0 OUT= MAC=8e:23:f5:16:a6:b1:cc:51:54:6a:2e:ea:14:00 SRC=198.199.98.83 DST=192.168.1.12 LEN=40 TOS=0x00 PREC=0x00 TTL=244 ID=54321 PROTO=TCP SPT=57522 DPT=15672 WINDOW=65535 RES=0x00 SYN URGP=0<\/pre>\n\n\n\n<p>CSF keeps a file with addresses to deny in &#8220;\/etc\/csf\/csf.deny&#8221;  Also nice that if gives you a little bit of info on why it was blocked.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># grep -r \"192.168.1.21\" \/etc\/csf\/csf.deny\n192.168.1.21 # lfd: (pop3d) Failed POP3 login from 192.168.1.21 (US\/United States\/-): 10 in the last 3600 secs - Tue Jun 20 11:36:15 2020<\/pre>\n\n\n\n<p>You can also dump all of the rule in iptables with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">iptables --list | egrep \"192.168.1.21\"<\/pre>\n\n\n\n<p>Change 192.168.1.21 with the IP you are looking for<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Whitelist IP Addresses<\/h2>\n\n\n\n<p>Open up \/etc\/csf\/csf.allow with a text editor and add the IP to the bottom of the file.<\/p>\n\n\n\n<p>or add the IP address to the end of the file with the following command.  Replace 192.168.1.21 with the IP address you want to whitelist.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo \"192.168.1.21\" &gt;&gt; \/etc\/csf\/csf.allow<\/pre>\n\n\n\n<p>You can also do all of this from the WHM web interface &#8220;Plugins -&gt; ConfigServer Security &amp; Firewall&#8221;<\/p>\n\n\n\n<p>Further reading<\/p>\n\n\n\n<p><a href=\"https:\/\/documentation.cpanel.net\/display\/CKB\/How+to+Configure+Your+Firewall+for+cPanel+Services\">https:\/\/documentation.cpanel.net\/display\/CKB\/How+to+Configure+Your+Firewall+for+cPanel+Services<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Had a weird issue where a certain address was unable to access the cpanel server, but it was intermittent with it working some times, but failing at other times. Ended up being the firewall on the WHM server blocking that &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/whm-cpanel-firewall\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195],"tags":[196,160,1057,15,449,382],"class_list":["post-3469","post","type-post","status-publish","format-standard","hentry","category-cpanel","tag-cpanel-2","tag-firewall","tag-hosting","tag-iptables","tag-whitelist","tag-whm"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3469","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=3469"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3469\/revisions"}],"predecessor-version":[{"id":3471,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3469\/revisions\/3471"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=3469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=3469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=3469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}