Score:0

I want to use an SSH server to provide internet connectivity with sshuttle

cn flag

I have a local network containing a machine named black running Ubuntu 16 server, and a raspberry pi. The pi has two network cards. One faces this local network, and the other connects to my ISP via a router. black has one interfaces which faces this network. The pi runs an ssh server configured out of the box.

I want to use sshuttle (or something else like it) to provide black with internet connectivity.

This is run before sshuttle is invoked:

username@black:~$ cat /etc/network/interfaces

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp2s0
iface enp2s0 inet static
    address 192.168.0.11
    netmask 255.255.255.0

username@black:~$ ip route

192.168.0.0/24 dev enp2s0  proto kernel  scope link  src 192.168.0.11 

username@black:~$ ping 8.8.8.8
connect: Network is unreachable

I then run sshuttle like so:

username@black:~$ sshuttle -r [email protected] 0.0.0.0/0
[email protected]'s password:
-c:3: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
client: Connected.

In a different terminal, I then run this:

username@black:~$ ip route

192.168.0.0/24 dev enp2s0  proto kernel  scope link  src 192.168.0.11 

username@black:~$ ping 8.8.8.8
connect: Network is unreachable

How can I make this work so that sending pings to ips outside of my local network works once connected with sshuttle? For various reasons, it has to be an ssh tunnel, but is there something other than sshuttle?

Ginnungagap avatar
gu flag
Do you need ping or TCP? `ssh` has the native `-D` (aka. `DynamicForward`) that'll create a SOCKS5 tunnel for TCP connections.
cn flag
Yeah, I need all traffic.
Score:1
gu flag

From the sshuttle docs:

Any TCP session you initiate to one of the proxied IP addresses will be captured by sshuttle and sent over an ssh session to the remote copy of sshuttle, which will then regenerate the connection on that end, and funnel the data back and forth through ssh.

It looks like it essentially does the same thing as the native SOCKS5 server that ssh -D does except it does so transparently for the local machine so clients don't need to support using a proxy server.

However, I can't see that it support proxying UDP or ICMP.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.