{"id":720,"date":"2018-10-10T19:50:19","date_gmt":"2018-10-10T13:50:19","guid":{"rendered":"http:\/\/hasibul.info\/blog\/?p=720"},"modified":"2018-10-10T19:50:19","modified_gmt":"2018-10-10T13:50:19","slug":"whitelist-ip-or-ip-range-in-out-using-iptables","status":"publish","type":"post","link":"https:\/\/hasibul.info\/blog\/2018\/10\/10\/whitelist-ip-or-ip-range-in-out-using-iptables\/","title":{"rendered":"Whitelist IP or IP range in\/out using iptables"},"content":{"rendered":"<p>#Flush existing rules<br \/>\niptables -F<\/p>\n<p># Set up default DROP rule for eth0 (Assuming eth0 is the Ethernet Port)<br \/>\niptables -P INPUT DROP<\/p>\n<p># Allow existing connections to continue<br \/>\niptables -A INPUT -i eth0 -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<\/p>\n<p># Accept everything from the 192.168.0.x network<br \/>\niptables -A INPUT -i eth0 -s 192.168.0.0\/24 -j ACCEPT<\/p>\n<p># Allow connections from this host to 192.168.1.10<br \/>\niptables -A OUTPUT -o eth0 -d 192.168.1.10 -j ACCEPT<\/p>\n","protected":false},"excerpt":{"rendered":"<p>#Flush existing rules iptables -F # Set up default DROP rule for eth0 (Assuming eth0 is the Ethernet Port) iptables -P INPUT DROP # Allow existing connections to continue iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT # Accept everything from the 192.168.0.x network iptables -A INPUT -i eth0 -s 192.168.0.0\/24 -j&hellip;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18,6,12,1],"tags":[113,95,226,97],"how-to":[],"_links":{"self":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts\/720"}],"collection":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/comments?post=720"}],"version-history":[{"count":0,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/posts\/720\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/media?parent=720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/categories?post=720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/tags?post=720"},{"taxonomy":"how-to","embeddable":true,"href":"https:\/\/hasibul.info\/blog\/wp-json\/wp\/v2\/how-to?post=720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}