{"id":119,"date":"2022-11-29T22:16:36","date_gmt":"2022-11-29T14:16:36","guid":{"rendered":"https:\/\/namo.one\/?p=119"},"modified":"2022-11-29T22:16:36","modified_gmt":"2022-11-29T14:16:36","slug":"iptables-rules-to-just-allow-access-from-whitelist-ips","status":"publish","type":"post","link":"https:\/\/byso.top\/?p=119","title":{"rendered":"iptables rules to just allow access from whitelist IPs"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>iptables -I INPUT 1 -p icmp -j ACCEPT                    #allow ping packets\n\niptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT          #allow one port\n\niptables -I INPUT 1 -i lo -j ACCEPT                      #allow loopback\n\niptables -I INPUT 1 -s 1.2.3.4,5.6.7.8,x.y.z.a -j ACCEPT  #allow a few IPs\n\niptables -I INPUT 1 -p tcp --match multiport --dport 22,80,443 -j ACCEPT\n# allow a group of ports\n\niptables -I INPUT 1 -p tcp --match multiport --dport 39901:39999 -j ACCEPT\n# allow a range of ports\n\niptables -A INPUT -j DROP\n# drop all (this should be append to the last of the INPUT chain)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-119","post","type-post","status-publish","format-standard","hentry","category-linux-applications","category-vps"],"_links":{"self":[{"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/posts\/119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/byso.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=119"}],"version-history":[{"count":1,"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":120,"href":"https:\/\/byso.top\/index.php?rest_route=\/wp\/v2\/posts\/119\/revisions\/120"}],"wp:attachment":[{"href":"https:\/\/byso.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byso.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byso.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}