summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2010-05-02 02:00:19 -0400
committerAvery Pennarun <apenwarr@gmail.com>2010-05-02 02:00:58 -0400
commita244b325cb6c7ce86e1c4a78eed6a80b9357dbf1 (patch)
treecdf19eb1b57c39e18318a78505be4ce4febcfa05
parent10069f99e2161b26306c76e2c6ad0ef012162f12 (diff)
iptables: add a PREROUTING rule so we can proxy for other machines too.
If you run sshuttle on a router, it can handle vpn'ing for all the boxes on your network.
-rw-r--r--iptables.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/iptables.py b/iptables.py
index 5bb6133..096844e 100644
--- a/iptables.py
+++ b/iptables.py
@@ -44,6 +44,7 @@ def main(port, subnets):
# basic cleanup/setup of chains
if chain_exists(chain):
ipt('-D', 'OUTPUT', '-j', chain)
+ ipt('-D', 'PREROUTING', '-j', chain)
ipt('-F', chain)
ipt('-X', chain)
@@ -51,6 +52,7 @@ def main(port, subnets):
ipt('-N', chain)
ipt('-F', chain)
ipt('-I', 'OUTPUT', '1', '-j', chain)
+ ipt('-I', 'PREROUTING', '1', '-j', chain)
# create new subnet entries
for snet,swidth in subnets: