{"id":18,"date":"2014-09-28T14:37:09","date_gmt":"2014-09-28T14:37:09","guid":{"rendered":"http:\/\/marshallpdavis.com\/?page_id=18"},"modified":"2015-07-04T05:19:26","modified_gmt":"2015-07-04T05:19:26","slug":"iptables-firewall-configs","status":"publish","type":"page","link":"https:\/\/marshallpdavis.com\/?page_id=18","title":{"rendered":"IPTables Firewall Configs"},"content":{"rendered":"<p>List current chains:<\/p>\n<pre>iptables -L<\/pre>\n<p>Insert into chain INPUT in 1st position to accept only on tcp protocol from the 192.168.1.0\/24 network from port 443 to IP 192.168.1.51 port 443<\/p>\n<pre>iptables -I INPUT 1 -p tcp -s 192.168.1.0\/24 --sport 443 -d 192.168.1.51 --dport 443 -j ACCEPT<\/pre>\n<p>Insert into 4th position into chain INPUT<\/p>\n<pre>iptables -I INPUT 4 -p tcp -s 192.168.1.0\/24 --sport 443 -d 192.168.1.51 --dport 443 -j ACCEPT<\/pre>\n<p>Append to the end of chain INPUT<\/p>\n<pre>iptables -A INPUT -p tcp -j DROP<\/pre>\n<p>Always issue one of the following (depending on distro) to have changes survive reboot:<\/p>\n<pre>iptables-save<\/pre>\n<p>With systemd:<\/p>\n<pre>systemctl iptables save<\/pre>\n<p>With Upstart:<\/p>\n<pre>service iptables save<\/pre>\n<p>If none of the above work:<\/p>\n<pre>\/etc\/init.d\/iptables save<\/pre>\n<p>If you are on a Debian based distro (Ubuntu, Mint, etc.), remember to install iptables-persistent:<\/p>\n<pre>apt install iptables-persistent<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>List current chains: iptables -L Insert into chain INPUT in 1st position to accept only on tcp protocol from the 192.168.1.0\/24 network from port 443 to IP 192.168.1.51 port 443 iptables -I INPUT 1 -p tcp -s 192.168.1.0\/24 &#8211;sport 443 -d 192.168.1.51 &#8211;dport 443 -j ACCEPT Insert into 4th position into chain INPUT iptables -I &hellip; <a href=\"https:\/\/marshallpdavis.com\/?page_id=18\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">IPTables Firewall Configs<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-18","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18"}],"version-history":[{"count":4,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/18\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/18\/revisions\/97"}],"up":[{"embeddable":true,"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/marshallpdavis.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}