Add routes to /etc/netplan/50-cloud-init.yaml - OVH Ubuntu 18.04 network not working by default

Damo-HG

Member
Apr 28, 2020
11
0
21
37
Right now cloud-init is generating the following netplan config file /etc/netplan/50-cloud-init.yaml

Code:
network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - 145.239.202.202/32
            - 2001:41d0:800:226f::3/128
            gateway4: 51.89.172.254
            gateway6: 2001:41d0:800:22ff:ff:ff:ff:ff
            match:
                macaddress: 02:00:00:ff:3b:ea
            nameservers:
                addresses:
                - 213.186.33.99
                search: []
            set-name: eth0


To get the network working OVH requires me to either add routes or set dhcp4: true (but that wont get ipv6 working) and it's set to false by default anyway. I need to add the following onto the end of the 50-cloud-init.yaml file

Code:
        routes:
        - to: 51.89.172.254/32
          via: 0.0.0.0
          scope: link
        - to: 2001:41d0:800:22ff:ff:ff:ff:ff
          scope: link


It should end up looking like:

Code:
network:
    version: 2
    ethernets:
        eth0:
            addresses:
            - 145.239.202.202/32
            - 2001:41d0:800:226f::3/128
            gateway4: 51.89.172.254
            gateway6: 2001:41d0:800:22ff:ff:ff:ff:ff
            match:
                macaddress: 02:00:00:ff:3b:ea
            nameservers:
                addresses:
                - 213.186.33.99
                search: []
            set-name: eth0
            routes:
            - to: 51.89.172.254/32
              via: 0.0.0.0
              scope: link
            - to: 2001:41d0:800:22ff:ff:ff:ff:ff
              scope: link

What exactly is the file that determines the layout of the above settings inside the VM? Where is it located in my Proxmox Node or virtual machine. I presume it's somewhere in the Proxmox node that determines the layout of the file.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!