From fda34d4a6c03e919786b26876d6a9c051119db1d Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Tue, 10 Apr 2012 19:28:31 +0200 Subject: Location based firewall support (FS#26380) Provide a sample hook file for supporting firewall rule sets based on network 'locations'. --- contrib/iptables.hook | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 contrib/iptables.hook (limited to 'contrib') diff --git a/contrib/iptables.hook b/contrib/iptables.hook new file mode 100755 index 0000000..95546ba --- /dev/null +++ b/contrib/iptables.hook @@ -0,0 +1,17 @@ +### Sample netcfg hook script for location based firewall rules. +### To install, make this executable and put it in /usr/lib/network/hooks + +### USAGE +## You need to have iptables installed to use this script. +## Add a location to your network profile and add firewall to your POST_UP. +## The iptables setup in /etc/iptables/$LOCATION.rules will now be loaded +## automatically when a connection is established. +## +## Sample excerpt from the profile: +## LOCATION="library" +## POST_UP="firewall" + +function firewall { + /usr/sbin/iptables-restore < "/etc/iptables/$LOCATION.rules" +} + -- cgit v1.2.3-24-g4f1b