0

in Ubuntu 18.04 (and 18.10) we're finding (on proxmox host) that Ubuntu VM's are losing the lan IP route on restart. We know the command to make them re-add it. But we don't want to have it run it manually. These are Class C connections that should not require a gateway.

For refernce this is the command in command line that we have to run every reboot (where 10.90.90.52 is the static client ip) it works perfectly

  # ip route add 10.90.90.0/24 dev eth1 proto kernel scope link src 10.90.90.52

I have looked at the netplan examples but they make no mention of eth1.. what is the yaml equivalent of the above working command line?

this is our (not working) /etc/netplan/config.yaml we were fiddling with. we know it's not good enough.

network:
  version: 2
  ethernets:
    ens160:
        addresses:
        - 10.90.90.2/24
        dhcp4: false            

this is the proxmox config

enter image description here

remember this command # ip route add 10.90.90.0/24 dev eth1 proto kernel scope link src 10.90.90.52 is currently working but when we restart we have to manually run it. We're simply looking for the yaml version of what works by hand.

0

in the end this worked but we're not entirely happy with what we did

# nano /etc/netplan/01-systemd-networkd-eth1.yaml

note the two spaces before the word "network: " they matter - yaml is whitespace/ indent sensitive

  network:
     version: 2
      ethernets:
        eth1:
          addresses: [10.90.90.52/24]
          dhcp4: false

this gives us this on reboot

# ip r
default via xx.x2.x18.x7 dev eth0 proto static
10.90.90.0/24 dev eth1 proto kernel scope link src 10.90.90.52
xx.x2.x18.x7  dev eth0 proto static scope link

which is what

# ip route add 10.90.90.0/24 dev eth1 proto kernel scope link src 10.90.90.52

was giving us

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.