{"id":342,"date":"2024-03-24T10:04:44","date_gmt":"2024-03-24T04:34:44","guid":{"rendered":"http:\/\/byomkesh.in\/wordpress\/?p=342"},"modified":"2024-05-23T10:53:54","modified_gmt":"2024-05-23T05:23:54","slug":"firewalld-ipset-for-blocking-list-of-ips","status":"publish","type":"post","link":"http:\/\/byomkesh.in\/wordpress\/firewalld-ipset-for-blocking-list-of-ips\/","title":{"rendered":"FirewallD IPSet for blocking list of ips"},"content":{"rendered":"\n<p>Decided to create ipset stophack and add all access to ports 23, 22, 3306, 110, 143, 25 of ip &lt;myserverip&gt;<\/p>\n\n\n\n<p>firewall-cmd &#8211;zone=external &#8211;add-rich-rule=&#8217;rule source ipset=stophack drop&#8217;<br>firewall-cmd &#8211;permanent &#8211;get-ipsets<br>firewall-cmd &#8211;permanent &#8211;new-ipset=stophack &#8211;type=hash:net<br>firewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;add-entries-from-file=stophack.txt<br>firewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;get-entries<br>firewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;add-entry=120.224.174.135<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat bdknock.xml\n&lt;?xml version=\"1.0\" encoding=\"utf-8\"?>\n &lt;service>\n  &lt;port port=\"12345\" protocol=\"tcp\"\/>\n  &lt;port port=\"2345\" protocol=\"udp\"\/>\n  &lt;port port=\"345\" protocol=\"udp\"\/>\n  &lt;port port=\"54321\" protocol=\"tcp\"\/>\n &lt;\/service>\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Decided to create ipset stophack and add all access to ports 23, 22, 3306, 110, 143, 25 of ip &lt;myserverip&gt; firewall-cmd &#8211;zone=external &#8211;add-rich-rule=&#8217;rule source ipset=stophack drop&#8217;firewall-cmd &#8211;permanent &#8211;get-ipsetsfirewall-cmd &#8211;permanent &#8211;new-ipset=stophack &#8211;type=hash:netfirewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;add-entries-from-file=stophack.txtfirewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;get-entriesfirewall-cmd &#8211;permanent &#8211;ipset=stophack &#8211;add-entry=120.224.174.135<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/comments?post=342"}],"version-history":[{"count":2,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/342\/revisions"}],"predecessor-version":[{"id":347,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/posts\/342\/revisions\/347"}],"wp:attachment":[{"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/media?parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/categories?post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/byomkesh.in\/wordpress\/wp-json\/wp\/v2\/tags?post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}