Where can I find a tutorial on setting up tun devices to use with ssh -w? - ssh

I have a remote machine (Linux) and a local laptop (MacOS), I would like to resolve network traffic to certain domains/IPs transparently via the local laptop in an effort to essentially share a VPN that's running on the laptop with the remote machine.
The network conditions of the laptop are unpredictable as it could be on public wifi, mobile tethering or my home network - so I cannot set up a VPN running on a static IP.
I wondered if I could forward UDP traffic over SSH via -R, host a wireguard server on the laptop and connect to it on the remote. Turns out that's not possible.
However, OpenSSH has the -w flag (docs) that allows the tunneling of any kind of IP traffic over SSH but requires setting up tun devices on both ends. I don't know exactly what that means or where to get started learning about it.
Googling tutorials on SSH tunnels turns up results for TCP port tunneling (-L and -R), but nothing on -w.
Can you point me in a direction where I can figure out how to do this and if this will even work for me?

Related

ssh tunnel high latency with multiple connections

hi I'm running an Ubuntu 20.04.5 server I'm using it for dynamic port forwarding kinda like a vpn but the problem is when I'm downloading something or there is multiple connections ping increases drastically 500ms-1000ms but if I run two tunnels with different users and download from one and test my ping from the other the ping is perfectly fine. I'm wondering if this is a user limit on linux I've tried tunneling with the root user but still when there is the slightest sign of traffic the ping goes above 250ms.
I've tried tuning the tcp and raising open file limits and port range but all to no avail.

raspbian ssh connection refused after having enabled it

I used sudo raspi-config, went into the advanced options, enabled ssh and tried with and without rebooting after this step, I am still getting Network Error: Connection refused
when trying to establish a connection via PuTTY
EDIT: It seems like the device isn't even connected to the network, even though I use DLAN to get it connected directly to the broadband router, the same DLAN I use to connect my primary desktop.
Have you checked your firewall?
I know that this is an old question, but I run into this same problem today when connecting to raspberry with Putty. In my case, the problem was that I used wlan instead of ethernet cable, and hostname -i gave the wrong Ip address.
I then run ifconfig, and realized that there was different Ip address for wlan. With that Ip address, Putty and Filezilla connected right away to my raspberry.
Hope that this will help someone.

RDP through ICMP

I have got a VM in Google Compute Engine. And I want to use this VM using RDP. I have enabled the firewall settings to accept RDP(TCP:3389). This works fine when I connect to it using a LAN connection. But when I try to connect to this VM using an ICMP connection(ICMP tunneling software), it shows an error that couldn't connect to the remote computer for one of these reasons:
1. Remote access to server is not enabled.
2. The remote computer is turned on.
3. The remote computer is not available on the network.
But my current configuration works fine when I connect over a LAN. I want to use RDP using an ICMP tunnel. Is there a way to use RDP using ICMP?
Ping also works when trying to connect through ICMP.

Connecting to ubuntu home server without internet connection

I am running an Ubuntu server with my laptop through an Orcale VirtualBox and I try to maximize the bandwidth of my home server, as it really slows down my internet connection. My router supports up to 300Mbit upload/download speed and my laptop wifi's card up to 150bit.
I configured my server with the following(static IP, configured by vim /etc/network/interfaces):
auto eth0
iface eth0 inet static
address 192.168.1.240
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
192.168.1.1 is my default gateway, and I just configured a static IP which ends with 240.
When my laptop's WIFI is on, I can easily access the server's files(.html files etc) through chrome from any computer on my house, as I just need to enter the server's IP into the browser, plus I can access the server through SSH. But when It's off, I can't even access the server's HTML files through the laptop itself, though I can see that the server is still running on VirtualBox. When I turn the WIFI once again, I can run services which require Apache2 but they really slow my internet connection, as a result I can barely surf the web. I am trying to configure the server to use only the bandwidth of my router, since my actual internet connection is 30 Mbit download and 1.90 Mbit upload(according to speedtest), and It probably interferes with it. Is it possible to access the server without WIFI connection, so it will purely use my router's speed?
Any help would be appreciated.
1) Looks like you using bridged networking in VM config. When your network adapter is connected to real network - you can interact with your VM via network bridge. When it's not connected - your bridge is also closed. If you need to interact with your VM without WiFi connection - you can add one more virtual network adapter to you VM config: use "Host-only" adapter and configure it on both VM and host PC. Your VM will use new host-only adapter to interact with your PC, and old bridged adapter to interact with other network.
2) Check your WiFi speed near the router. Maybe it's too far or provides too weak signal.
PS. Sorry for my poor english.

SSH over VPN connection

We have an AWS EC2 server that we've configured to be only accessible (via SSH) from within our office network. Obviously this isn't ideal for remote arrangements where someone has to connect to the EC2 instance and is working remotely outside the office such as during a business trip.
I've managed to set-up a VPN through PPTP and can connect to the office network (I have two local IP's one from wlan0 and one from ppp0) regardless of anywhere I am. However, when I SSH to the EC2 instance, it's still rejecting me most likely because it sees that I'm still trying to ssh from outside the network.
I think I'm missing something very important. What do you think, what am I missing to to get the ssh to use the vpn connection rather than one in wlan/eth?
I'm starting to think this isn't possible so kindly let me know. My other option is to ssh to a machine within the office network and then use that machine to ssh to the EC2 instance but I've been hesistant to do that as it seems excessive.
Find your gateway through which you want to connect to your ec2-instance.
For Linux systems, route -n will show you the routing table. Now add the route
sudo route add -host gw
Just having a VPN to your office does not mean all traffic from your machine will go through the VPN - that depends on how you configure the VPN.
You can SSH from your machine to an office machine, and from there ssh to EC2 - that should work.
Alternatively, configure your system to route traffic for the ec2 instance through the VPN connection - doing this depends on your specific VPN configuration.