I'm getting a sshuttle crash when trying to ssh to a 172.*.*.* server
through the tunnel. I noticed someone else had a similar issue before,
and a patch was made, but that patch seems to be already included in
the current version.
I'm running sshuttle revision a8b71f6 from Tue May 31 14:21:39 2011
+1000 on Ubuntu 11.04, kernel 2.6.38-11-generic, iptables v1.4.10 and
Python 2.7.1+. The client has the address 192.168.0.9 behind a NAT
router at 192.168.0.1
The remote server (
server.mydomain.com below) is Ubuntu 10.04.2 with
kernel 2.6.32-28-server, iptables v1.4.4 and Python 2.6.5.
I hope the terminal capture below helps. Public IPs and hostnames have
been obfuscated.
$ sudo ./sshuttle -vvvv --dns -r
akai...@server.mydomain.com
172.0.0.0/16
Starting sshuttle proxy.
Binding: 12300
Listening on ('127.0.0.1', 12300).
DNS listening on ('127.0.0.1', 12300).
firewall manager ready.
c : connecting to server...
c : executing: ['ssh', '
akai...@server.mydomain.com', '--',
'P=python2; $P -V 2>/dev/null || P=python; exec "$P" -c \'import sys;
skip_imports=1; verbosity=4; exec compile(sys.stdin.read(764),
"assembler.py", "exec")\'']
c : > channel=0 cmd=PING len=7 (fullness=0)
server: assembling 'cmdline_options.py' (29 bytes)
server: assembling 'helpers.py' (698 bytes)
server: assembling 'ssubprocess.py' (13702 bytes)
server: assembling 'ssnet.py' (5446 bytes)
server: assembling 'hostwatch.py' (2238 bytes)
server: assembling 'server.py' (2377 bytes)
s: latency control setting = True
s: available routes:
s:
222.22.222.160/27
s:
172.19.0.0/19
s: > channel=0 cmd=PING len=7 (fullness=0)
s: > channel=0 cmd=ROUTES len=32 (fullness=7)
s: Waiting: 1 r=[4] w=[5] x=[] (fullness=39/0)
s: Ready: 1 r=[] w=[5] x=[]
s: mux wrote: 15/15
s: mux wrote: 40/40
s: Waiting: 1 r=[4] w=[] x=[] (fullness=39/0)
c : connected.
Connected.
c : Waiting: 3 r=[3, 5, 9] w=[9] x=[] (fullness=7/0)
c : Ready: 3 r=[9] w=[9] x=[]
c : < channel=0 cmd=PING len=7
c : > channel=0 cmd=PONG len=7 (fullness=7)
c : < channel=0 cmd=ROUTES len=32
firewall manager: starting transproxy.
>> iptables -t nat -N sshuttle-12300
>> iptables -t nat -F sshuttle-12300
>> iptables -t nat -I OUTPUT 1 -j sshuttle-12300
>> iptables -t nat -I PREROUTING 1 -j sshuttle-12300
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest
172.0.0.0/16 -p tcp --to-ports 12300 -m ttl ! --ttl 42
>> iptables -t nat -A sshuttle-12300 -j RETURN --dest
127.0.0.0/8 -p tcp
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest
192.168.0.1/32 -p udp --dport 53 --to-ports 12300 -m ttl ! --ttl 42
c : mux wrote: 15/15
c : mux wrote: 15/15
c : Waiting: 3 r=[3, 5, 9] w=[] x=[] (fullness=14/0)
s: Ready: 1 r=[4] w=[] x=[]
s: < channel=0 cmd=PING len=7
s: > channel=0 cmd=PONG len=7 (fullness=39)
c : Ready: 3 r=[9] w=[] x=[]
c : < channel=0 cmd=PONG len=7
c : received PING response
c : Waiting: 3 r=[3, 5, 9] w=[] x=[] (fullness=0/0)
s: mux wrote: 15/15
s: Waiting: 1 r=[4] w=[] x=[] (fullness=46/0)
s: Ready: 1 r=[4] w=[] x=[]
s: < channel=0 cmd=PONG len=7
s: received PING response
s: Waiting: 1 r=[4] w=[] x=[] (fullness=0/0)
c : Ready: 3 r=[5] w=[] x=[]
c : DNS request from ('192.168.0.9', 52672): 32 bytes
c : > channel=1 cmd=DNS_REQ len=32 (fullness=0)
c : Remaining DNS requests: 1
c : mux wrote: 40/40
c : Waiting: 3 r=[3, 5, 9] w=[] x=[] (fullness=32/0)
s: Ready: 1 r=[4] w=[] x=[]
s: < channel=1 cmd=DNS_REQ len=32
s: Incoming DNS request.
s: DNS: sending to '127.0.0.1'
s: Waiting: 2 r=[4, 6] w=[] x=[] (fullness=0/0)
s: Ready: 2 r=[6] w=[] x=[]
s: DNS recv from '127.0.0.1': [Errno 111] Connection refused
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "assembler.py", line 26, in <module>
File "server.py", line 237, in main
File "ssnet.py", line 555, in runonce
File "server.py", line 153, in callback
File "server.py", line 128, in try_send
File "<string>", line 1, in connect
socket.error: [Errno 22] Invalid argument
c : Ready: 3 r=[9] w=[] x=[]
firewall manager: undoing changes.
>> iptables -t nat -D OUTPUT -j sshuttle-12300
>> iptables -t nat -D PREROUTING -j sshuttle-12300
>> iptables -t nat -F sshuttle-12300
>> iptables -t nat -X sshuttle-12300
c : fatal: server died with error code 1
Regards,
Antti