ssh -w from freebsd->linux

Dear forum,

I'm sorry for posting a further thread about this topic, but this is about problems using a different approach to achieve the same result. As I posted in thread Thread ppp-via-ssh-freebsd-ppp-linux-pppd.93634 I recently tried to establish a ancient "poor-mans-vpn" via ssh and ppp from freebsd-14 to linux. I gave up this method as the following seems much easier.


Consulting ssh(1) I'm now trying to set up a network tunnel using the -w switch. On freebsd I'm using the following code sequence to log into the linux remote system:
Code:
su root
ssh -w 0:0 -i /path/to/key-on-remote root@remotehost

Both tun0 devices are set up correctly on both sides but aren't exhibiting any ip.

Logged into the linux mashine the tun0 device is set up via
Code:
ip link set tun0 up
ip addr add 172.16.1.2/32 peer 172.16.1.1 dev tun0

on freebsd side the network interface tun0 is set up using:
Code:
ifconfig tun0 172.16.1.1/32 172.16.1.2

On both sides, the tun-devices having now an ip-address and a routing table entry. But sending ping requests aren't responded independently from the direction.

Using on both sides freebsd or linux mashines and setting the network up using os-specific commands, everything works. Hence the configuration seems to be ok on both. But why freebsd and linux aren't communicating via the tunnel and what can I do to fix this problem?

Many thanks and best regards
Paule
 
Dear Forum,
I continued with the problem above.

I logged on the linux machine from freebsd as root via ssh -w 0:0 -i <key> -l root <remotehost>. I set up the interfaces tun0 as described. Then I started as root tcpdump -i tun0 on freebsd and linux.

Now I sent a ping as user from freebsd (ip 172.16.1.1) to linux (ip 172.16.1.2).

on Freebsd tcpdump shows:
Code:
21:09:51.146899 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 3, length 64
21:09:52.179535 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 4, length 64
21:09:53.186784 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 5, length  64

on Linux tcpdump shows:
Code:
21:08:58.538176 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 3, length 64
21:08:58.538205 IP 172.16.1.2 > 172.16.1.1: ICMP echo reply, id 35849, seq 3, length 64
21:08:59.571303 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 4, length 64
21:08:59.571331 IP 172.16.1.2 > 172.16.1.1: ICMP echo reply, id 35849, seq 4, length 64
21:09:00.578478 IP 172.16.1.1 > 172.16.1.2: ICMP echo request, id 35849, seq 5, length 64
21:09:00.578507 IP 172.16.1.2 > 172.16.1.1: ICMP echo reply, id 35849, seq 5, length 64

So it seems, linux receives the icmp requests and is sending a response, but FreeBSD is somehow dropping them. But why?

The FreeBSD routing table for 172.16.1.* ( netstat -r) looks
Code:
172.16.1.1         link#2             UHS         lo0
172.16.1.2         link#3             UH         tun0

it look, that the FreeBSD tun0 IP is routed on lo0. Is this correct?

Many thanks for reading
and best regards
Paule
 
Back
Top