sshuttle / sshuttle

Transparent proxy server that works as a poor man's VPN. Forwards over ssh. Doesn't require admin. Works with Linux and MacOS. Supports DNS tunneling.
GNU Lesser General Public License v2.1
11.69k stars 731 forks source link

MacOS method tproxy crashes #420

Open piotrskowronski opened 4 years ago

piotrskowronski commented 4 years ago

$ sshuttle --method tproxy --dns --remote lx 0/0 --exclude lx Traceback (most recent call last): File "/opt/local/bin/sshuttle", line 11, in load_entry_point('sshuttle==0.78.5', 'console_scripts', 'sshuttle')() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sshuttle/cmdline.py", line 82, in main opt.sudo_pythonpath) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sshuttle/client.py", line 772, in main fw.method.setup_tcp_listener(tcp_listener) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sshuttle/methods/tproxy.py", line 143, in setup_tcp_listener tcp_listener.setsockopt(socket.SOL_IP, IP_TRANSPARENT, 1) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sshuttle/client.py", line 124, in setsockopt self.v6.setsockopt(level, optname, value)

sshuttle installed via mac ports. OS version High Sierra.

brianmay commented 4 years ago

This isn't actually a bug, tproxy is a Linux specific interface. OSX doesn't have it.

Possibly the documentation could be more clear on this however. Pull requests welcome.

piotrskowronski commented 4 years ago

Hi, What I could do is to implement a guard showing a clear error message when using this option on non Linux OS. Cheers,

brianmay commented 4 years ago

That sounds like a good idea also.

skuhl commented 3 years ago

This error message has been improved for a while. It now displays something like:

fw: fatal: The tproxy method is not supported on this machine. Check that the appropriate programs are in your PATH.
c : fatal: ['/usr/bin/sudo', '-p', ... ] returned 99