Hot answers tagged

81

In the case of roads, a real world tunnel is a constructed passage that allows you to pass directly from A to B instead of taking a route that is longer and/or has more things to slow you down. Examples include tunnels through mountains that you might otherwise have to go round, underpasses that let you get to the other side of the road without walking ...


77

The correct configuration for OpenVpn is: route-nopull route 192.168.0.0 255.255.255.0 These entries belong in your .ovpn file and will direct all 192.168.0.* subnet traffic through the VPN. For one IP only (192.168.0.1): route-nopull route 192.168.0.1 255.255.255.255


68

To do what you are wanting, I recommend sshuttle. You use it like this: ./sshuttle -r username@sshserver 0.0.0.0/0 -vv It will tunnel all your TCP traffic automatically for you. You can add the --dns argument to have it tunnel your DNS traffic as well. The remote server only needs to have Python installed. If you only want to tunnel specific programs I ...


46

OpenSSH v7.3 onward supports a -J switch and a ProxyJump option, which allow one or more comma-separated jump hosts, so, you can simply do this now: ssh -J jumpuser1@jumphost1,jumpuser2@jumphost2,...,jumpuserN@jumphostN user@host


38

Why is a tunnel called a "tunnel"? The phrase was first used (as far as I can tell) in RFC 1075 Distance Vector Multicast Routing Protocol, where it is defined as follows: In addition, to allow experiments to traverse networks that do not support multicasting, a mechanism called "tunneling" was developed. ... Tunnels A tunnel is a ...


36

You need to enable GatewayPorts=yes in the config for SSHd (/etc/ssh/sshd_config), not the client in order to enable binding to interfaces other than loopback on remote ports. -o GatewayPorts=yes Only works for local ports when passed to the ssh command.


31

If you want to use a remote ssh server as a SOCKS5 proxy with Chromium, it is as easy as: ssh -ND 1080 remote_server -N: don't run a command: just make redirections/proxies -D: set up a proxy server on local port 1080 Other possibilities: -f: would fork immediately after successfully logging in and setting up the redirections -C: would activate ...


28

Goals Use the plain internet connection for all internet traffic by default, even when the VPN is connected. Route traffic to one specific IP address through the VPN. Steps Press Win + R and execute ncpa.cpl. Right-click the VPN connection and go to Properties → Networking. Select Internet Protocol Version 4 and go to Properties → Advanced.... ...


21

Because whatever you put in one end of the tunnel comes out the other end.


20

You can use option ssh_command of sshfs to do the trick: sshfs ma: /mnt -o ssh_command='ssh -t mb ssh' Unmount with the usual fusermount -u /mnt Sorry this is 7 years late...


20

Or you could simply use ssf (which was designed to handle this use case), with a simple command: Client side: #>./ssfc -U 53:192.168.1.1:53 server.foo.com This command redirects local port 53 (dns) to 192.168.1.1 port 53, through a secure tunnel between localhost and server.foo.com. You will need a ssf server (instead of - or next to - your ssh server)...


20

You have to use ClientAliveInterval in your sshd_config. ClientAliveInterval 15 Ref: man sshd_config ClientAliveCountMax Sets the number of client alive messages (see below) which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being ...


15

Can be achieved transparently with this snippet in ~/.ssh/config: Host sockstunnel ProxyCommand ssh -D 3128 localhost nc -q 1 localhost 22 Host target RemoteForward 3128 localhost:3128 ProxyCommand ssh -W target:22 sockstunnel Details We want a reverse DynamicForward. This is achieved using two ssh commands: ssh -D 3128 localhost ssh -R ...


15

It turns out that the above problem was quite simple. OpenVPN has to be run with administrative privileges. So, instead run sudo ./openvpn connection.ovpn


14

To your OpenVPN client config, add a line like: route The.IP.To.Go 255.255.255.255 (Where The.IP.To.Go is the IP you wish to route through the VPN) This instructs OpenVPN to create the entry in your OS's routing table. Alternatively, the OpenVPN server could be made to "push" this routing configuration down to clients, by adding to the server config: ...


14

Actually I just figured out that the "Link Speed" displayed in the Task Manager (10 Mbps) is just a dummy number set by the driver that OpenVPN is using. It doesn't slow down the connection of the tunnel, even though my Local Area Connection 4 is maxed out on 100% of the available bandwidth for that adapter (10 Mbps) the Local Area Connection 5 can display ...


12

I couldn't get nc to work for SNMP, because SNMP clients keep choosing a new source UDP port, and several can be active at once. Instead, I've written a post describing how to do it with socat in this blog post, using SNMP as an example. Essentially, using two terminals, starting with an overview: Terminal one: client$ ssh -L 10000:localhost:10000 server ...


11

The -localhost option is telling the VNC server to bind only to the loopback interface, so that you can only connect to the VNC server from the machine it's running on. This means that anyone trying to break into your VNC session would have to be able to get on that particular machine. Without -localhost, your VNC server would accept non-local connections, ...


11

In case anyone else finds this, there is a work around... you just need to reformat the tunnel with a specific bind address like this: ssh -L 127.0.0.1:8022:173.22.0.1:22 username@172.11.0.1 From reading through the bug listing linked in the other answer, it looks like the issue is in the IPv6 subsystem, so I'm guessing this works by forcing IPv4. Either ...


10

The DNS lookup is the first part of the process. If you use their DNS, and do a lookup for one of the services they unblock, then they will return the IP address of a proxy server in the right geolocation. Then when you go to the site you are after, your requests will instead go to their proxy which will access the site on your behalf. This is a "tunnel" ...


10

If you want to access a ssh server behind another ssh server, simply use "ProxyCommand". Example: add to .ssh/config Host Alice User myLoginAtAlice # optional ProxyCommand ssh -o Compression=no gateway netcat -w 90 %h %p ServerAliveInterval 30 Compression yes Host gateway HostName gateway.public.ip User myLoginAtTheGateway # optional ...


10

Luckily I got an answer at the sshuttle google group from the author of sshuttle. He wrote: You might need to add '-l 0.0.0.0' (that's a lowercase L) in order to tell sshuttle to listen for connections from other than localhost (the router itself). For security reasons, sshuttle won't route other people's traffic by default. And it works ...


10

The first command didn't have time to establish a tunnel when the second command was run, thus giving a "Connection refused". Just don't use & but use instead the option -f: -f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the ...


9

Why does it not work http://localhost:3333/path/to/repo.git This fails because the URL's hostname is different (localhost vs server2), and as a result the server uses a different configuration. All HTTP clients send the requested hostname to the server, and the server may choose from several configurations (virtual hosts) based on that name. This is how ...


8

Simple, run the command ssh -L 25565:minecraftserverIp:25565 user@remotelinuxbox Then add a server to your minecraft client localhost:25565 This will allow you to connect to the remote minecraft server via the ssh tunnel.


8

This answer is similar to kynan, as it involves the use of ProxyCommand. But it's more convenient to use IMO. If you have netcat installed in your hop machines you can add this snippet to your ~/.ssh/config: Host *+* ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') nc $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/...


8

SOCKS 5 supports UDP. OpenSSH claims to implement SOCKS4 and SOCKS5, but it only implements a subset of the SOCKS5 protocol. You won't find the specifics of what is, or is not supported in the documentation though, look at the source instead: if (s5_req.version != 0x05 || s5_req.command != SSH_SOCKS5_CONNECT || s5_req.reserved != 0x00) {...


8

Although in our technological world everything today seems possible, as far as I know true Bluetooth-to-Bluetooth-over-IP has never been implemented. I will try and explain the difficulties, that although not insurmountable, are the cause for this situation. Bluetooth itself is is a wireless technology standard for exchanging data over short distances. It ...


8

The Bitvise SSH Client user interface does not provide an option to start the profile automatically when Windows 10 starts up. Instead, you can create a shortcut to Bitvise with the "-loginOnStartup" option. The steps below are a lot easier than creating a batch file. In your Bitvise Profile, select these options: Uncheck "Open Terminal" Uncheck "Open ...


7

local$ ssh -R 1080 remote remote$ curl --socks5 localhost https://example.com since OpenSSH 7.6 ssh(1): add support for reverse dynamic forwarding. In this mode, ssh will act as a SOCKS4/5 proxy and forward connections to destinations requested by the remote SOCKS client. This mode is requested using extended syntax for the -R and RemoteForward ...


Only top voted, non community-wiki answers of a minimum length are eligible