Skip to content

Commit 29d2e06

Browse files
tianyicuiapenwarr
authored andcommitted
Added --exclude-from feature.
(Slightly modified by apenwarr)
1 parent bff1610 commit 29d2e06

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Documentation/sshuttle.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ entire subnet to the VPN.
9494
`0/0 -x 1.2.3.0/24` to forward everything except the
9595
local subnet over the VPN, for example.
9696

97+
--exclude-from=*file*
98+
: exclude the subnets specified in a file, one subnet per
99+
line. Useful when you have lots of subnets to exclude.
100+
97101
-v, --verbose
98102
: print more information about the session. This option
99103
can be used more than once for increased verbosity. By

main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def parse_ipport(s):
5757
python= path to python interpreter on the remote server
5858
r,remote= ssh hostname (and optional username) of remote sshuttle server
5959
x,exclude= exclude this subnet (can be used more than once)
60+
exclude-from= exclude the subnets in a file (whitespace separated)
6061
v,verbose increase debug message verbosity
6162
e,ssh-cmd= the command to use to connect to the remote [ssh]
6263
seed-hosts= with -H, use these hostnames for initial scan (comma-separated)
@@ -104,6 +105,8 @@ def parse_ipport(s):
104105
for k,v in flags:
105106
if k in ('-x','--exclude'):
106107
excludes.append(v)
108+
if k in ('-X', '--exclude-from'):
109+
excludes += open(v).read().split()
107110
remotename = opt.remote
108111
if remotename == '' or remotename == '-':
109112
remotename = None

0 commit comments

Comments
 (0)