{"id":101,"date":"2015-09-21T11:02:26","date_gmt":"2015-09-21T10:02:26","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=101"},"modified":"2015-09-21T11:02:26","modified_gmt":"2015-09-21T10:02:26","slug":"automatically-loading-iptables-in-debian-and-ubuntu-linux","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2015\/09\/21\/automatically-loading-iptables-in-debian-and-ubuntu-linux\/","title":{"rendered":"Automatically loading iptables in Debian and Ubuntu Linux"},"content":{"rendered":"<p>Debian doesn&#8217;t have an automatic way of loading up iptables, so if you use Debian, or Ubuntu you might be wondering why everytime you restart you lose your iptables rules. And if you got that far your probably wondering where the default iptables file is stored. Here is news, there is no file store! You have to make it! Here is how I did it.<\/p>\n<p>1. Save your existing firewall rules to a file for later execution<\/p>\n<pre>\r\niptables-save > \/etc\/firewall.conf \r\n<\/pre>\n<p>2. Configure a firewall load command in if-up.d network startup script folder.<\/p>\n<pre> \r\niptables-restore < \/etc\/firewall.conf\r\n<\/pre>\n<p>3. Make sure that the script you've put in the if up auto configuration is executable<\/p>\n<pre> \r\nchmod +x \/etc\/network\/if-up.d\/iptables\r\n<\/pre>\n<p>4. Now when you add new iptables rules you can run a save command<\/p>\n<pre> \r\niptables-save > \/etc\/firewall.conf\r\n<\/pre>\n<p>or you can just edit the startup file, which will become active next reboot<\/p>\n<pre>\r\nvi \/etc\/firewall.conf \r\n<\/pre>\n<p>This is one of the most elegant and simple ways to configure iptables, thanks to Major Hayden, a fellow Rackspace employee for this tip.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Debian doesn&#8217;t have an automatic way of loading up iptables, so if you use Debian, or Ubuntu you might be wondering why everytime you restart you lose your iptables rules. And if you got that far your probably wondering where &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2015\/09\/21\/automatically-loading-iptables-in-debian-and-ubuntu-linux\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4,3],"tags":[],"class_list":["post-101","post","type-post","status-publish","format-standard","hentry","category-linux","category-networking","category-security"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":0,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}