If you specify the parameter --listen "0.0.0.0:12300,[::]:12300" the app crashes with error:
Starting sshuttle proxy (version 1.3.2).
c : Starting firewall manager with command: ['/usr/local/bin/sshuttle', '-v', '-v', '-v', '--method', 'auto', '--firewall']
fw: Starting firewall with Python version 3.11.2
......
c : DNS requests normally directed at these servers will be redirected to remote:
c : (<AddressFamily.AF_INET: 2>, '192.168.1.1')
c : Trying to bind redirector on port 0
c : address in use
Traceback (most recent call last):
File "/usr/local/bin/sshuttle", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/dist-packages/sshuttle/cmdline.py", line 109, in main
return_code = client.main(ipport_v6, ipport_v4,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/sshuttle/client.py", line 1075, in main
raise last_e
File "/usr/local/lib/python3.11/dist-packages/sshuttle/client.py", line 1059, in main
tcp_listener.bind(lv6, lv4)
File "/usr/local/lib/python3.11/dist-packages/sshuttle/client.py", line 195, in bind
self.v4.bind(address_v4)
OSError: [Errno 98] Address already in use
To fix this you need to add one line of code to the function MultiListener.bind:
def bind(self, address_v6, address_v4):
assert not self.bind_called
self.bind_called = True
if address_v6 is not None:
self.v6 = socket.socket(socket.AF_INET6, self.type, self.proto)
self.v6.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 1) # <--- this
try:
self.v6.bind(address_v6)
except OSError as e:
if e.errno == errno.EADDRNOTAVAIL:
# On an IPv6 Linux machine, this situation occurs
# if you run the following prior to running
# sshuttle:
#
# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6
raise Fatal("Could not bind to an IPv6 socket with "
"address %s and port %s. "
"Potential workaround: Run sshuttle "
"with '--disable-ipv6'."
% (str(address_v6[0]), str(address_v6[1])))
raise e
else:
self.v6 = None
if address_v4 is not None:
self.v4 = socket.socket(socket.AF_INET, self.type, self.proto)
self.v4.bind(address_v4)
else:
self.v4 = None
If you specify the parameter --listen "0.0.0.0:12300,[::]:12300" the app crashes with error:
To fix this you need to add one line of code to the function MultiListener.bind: