summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-04-10 19:28:31 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-04-10 19:28:31 +0200
commitfda34d4a6c03e919786b26876d6a9c051119db1d (patch)
treeab17b53150d53089b1211fa7afcbe4278d9076cf /contrib
parentbc66a6906c5a1a55c5c9adc7c69f2370327db139 (diff)
downloadnetctl-fda34d4a6c03e919786b26876d6a9c051119db1d.tar.gz
netctl-fda34d4a6c03e919786b26876d6a9c051119db1d.tar.xz
Location based firewall support (FS#26380)
Provide a sample hook file for supporting firewall rule sets based on network 'locations'.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/iptables.hook17
1 files changed, 17 insertions, 0 deletions
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"
+}
+