0

I mostly followed the instructions at https://help.ubuntu.com/community/SSH_VPN to set up a VPN Tunnel over OpenSSH. I got hung up at the last step. It says to use ifup and /etc/network/interfaces. As I understand, these are deprecated by netplan.

For me to setup the connection manually, I do:

Machine 1:

sudo ssh -f -w 0:0 1.2.3.4
ip link set tun0 up
ip addr add 10.0.0.200/32 peer 10.0.0.100 dev tun0

Machine 2:

 ip link set tun0 up
 ip addr add 10.0.0.100/32 peer 10.0.0.200 dev tun0

I think what the ifup part of what I need to do is as follows:

Machine 1

 iface tun0 inet static
        pre-up sleep 5
        address 10.0.0.100
        pointopoint 10.0.0.200

Machine 2

 iface tun0 inet static
        pre-up ssh -f -w 0:0 root@MyServerIP 'ifdown tun0; ifup tun0'
        pre-up sleep 5
        address 10.0.0.200
        pointopoint 10.0.0.100

How would I no this with netplan?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.