Greetings!
On Linux, I am using a SSH tunnel between my machine and a remote machine. This is an actual tunnel, using the 'tun5' device / interface, not just port-forwarding. This allows me to contact any machine on the remote machine's network, SSH in, VNC in or whatever I need. For routing on my local machine, I use the 'LocalCommand' option in my ~/.ssh/config to run the following script:
I have now been trying to get this migrated to FreeBSD, but I am unable to ping the remote machine or any other machines on its network. This is what I have so far (on FreeBSD 12.2 - amd64):
As mentioned, I cannot contact *anything* over the 'tun5' tunnel. I am not receiving any error messages when the above setup script runs. Can anyone assist me in getting this routing correct on my (FreeBSD) side?
Here is the relevant part of my ~/.ssh/config file:
Here's the output from
Here's what
Thank you in advance!
On Linux, I am using a SSH tunnel between my machine and a remote machine. This is an actual tunnel, using the 'tun5' device / interface, not just port-forwarding. This allows me to contact any machine on the remote machine's network, SSH in, VNC in or whatever I need. For routing on my local machine, I use the 'LocalCommand' option in my ~/.ssh/config to run the following script:
Bash:
# Linux version #
ip addr add 10.10.10.2/32 peer 10.10.10.10 dev tun5
ip link set up tun5
route add -net 10.10.10.0 netmask 255.255.255.0 dev tun5
route add -net 192.168.58.0/24 dev tun5
I have now been trying to get this migrated to FreeBSD, but I am unable to ping the remote machine or any other machines on its network. This is what I have so far (on FreeBSD 12.2 - amd64):
Bash:
# FreeBSD version #
ifconfig tun5 10.10.10.2 10.10.10.10 add
ifconfig tun5 up
route add -net 10.10.10.0 10.10.10.2 -ifp tun5
route add -net 192.168.58.0 10.10.10.2 -ifp tun5
As mentioned, I cannot contact *anything* over the 'tun5' tunnel. I am not receiving any error messages when the above setup script runs. Can anyone assist me in getting this routing correct on my (FreeBSD) side?
Here is the relevant part of my ~/.ssh/config file:
INI:
Host sshvpn
Hostname (remote machine's IP)
Port (non-standard port)
User root # necessary to make tunnel device
IdentityFile /home/me/.ssh/id_sshvpn
PreferredAuthentications publickey
PermitLocalCommand yes
LocalCommand /home/me/bin/setup-ssh-vpn
RemoteCommand /root/scripts/setup-ssh-vpn
Tunnel point-to-point
TunnelDevice 5:5
Here's the output from
netstat -4rn
:
Code:
$ netstat -4rn
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 192.168.0.1 UGS re0
10.10.10.0/24 10.10.10.2 UGS tun5
10.10.10.2 link#3 UHS lo0
10.10.10.10 link#3 UH tun5
127.0.0.1 link#2 UH lo0
192.168.0.0/24 link#1 U re0
192.168.0.100 link#1 UHS lo0
192.168.58.0/24 10.10.10.2 UGS tun5
Here's what
ifconfig
says:
Code:
$ ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
ether b0:6e:bf:c5:3f:83
inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::b26e:bfff:fec5:3f83%re0 prefixlen 64 scopeid 0x1
inet6 2600:6c55:7600:9c3:b26e:bfff:fec5:3f83 prefixlen 64 autoconf
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
tun5: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet6 fe80::b26e:bfff:fec5:3f83%tun5 prefixlen 64 scopeid 0x3
inet 10.10.10.2 --> 10.10.10.10 netmask 0xff000000
groups: tun
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Opened by PID 61315
Thank you in advance!