{"id":584,"date":"2014-12-03T15:13:15","date_gmt":"2014-12-03T20:13:15","guid":{"rendered":"http:\/\/www.devolve.net\/blog\/?p=584"},"modified":"2014-12-03T15:13:15","modified_gmt":"2014-12-03T20:13:15","slug":"fix-broken-apf-package-debian-ubuntu","status":"publish","type":"post","link":"https:\/\/www.devolve.local\/fix-broken-apf-package-debian-ubuntu\/","title":{"rendered":"Fix the broken APF package on Debian\/Ubuntu"},"content":{"rendered":"

\"R-fx<\/a>The Debian \/ Ubuntu package for Advanced Policy Firewall (APF) seems a bit unmaintained. By default it won’t run without some initial tweaking. Note that they probably want everyone to just download and run the installer from their site nowadays, but that’s not how I roll (usually).<\/p>\n

cd \/etc\/apf-firewall\/internals\r\nsudo cp -p functions.apf functions.apf.orig<\/pre>\n

In functions.apf<\/code>, change the line <\/p>\n

elif [ \"$KREL\" == \"2.6\" ]; then<\/pre>\n

to <\/p>\n

elif [ \"$KREL\" == \"2.6\" -o \"${KREL:0:1}\" == '3' ]; then<\/pre>\n

That allows the basic functionality of the software to work. Next, for the sake of upgrade-ability, I copy \/etc\/apf-firewall\/conf.apf<\/code> to \/etc\/apf-firewall\/conf.apf.my<\/code>. Then the only change needed to the installed config is to source the .my<\/code> file. Here’s the bottom of the file:<\/p>\n

##\r\n# [Import misc. conf]\r\n##\r\n. \/etc\/apf-firewall\/conf.apf.my\r\n\r\n# Internal variable file\r\nCNFINT=\"$INSTALL_PATH\/internals\/internals.conf\"\r\n. $CNFINT<\/pre>\n

Since it won’t work if you try to source the internals.conf<\/code> file twice, you need to make sure that the last line in the .my<\/code> file is commented or removed. Now you can edit the other values in the .my<\/code> file to your liking. Remember to turn off devel mode and change \/etc\/default\/apf-firewall<\/code> when you’re satisfied with any config changes, then restart the service in the usual way.<\/p>\n","protected":false},"excerpt":{"rendered":"

The Debian \/ Ubuntu package for Advanced Policy Firewall (APF) seems a bit unmaintained. By default it won’t run without some initial tweaking. Note that they probably want everyone to just download and run the installer from their site nowadays, but that’s not how I roll (usually). cd \/etc\/apf-firewall\/internals sudo cp -p functions.apf functions.apf.orig In […]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[34,16,17,24,26],"_links":{"self":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/584"}],"collection":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/comments?post=584"}],"version-history":[{"count":2,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/584\/revisions"}],"predecessor-version":[{"id":587,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/posts\/584\/revisions\/587"}],"wp:attachment":[{"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/media?parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/categories?post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devolve.local\/wp-json\/wp\/v2\/tags?post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}