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.
This commit is contained in:
Avery Pennarun 2010-05-02 02:00:19 -04:00
parent 10069f99e2
commit a244b325cb

View File

@ -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: