Linux Mastering Development Ubuntu

Ubuntu server 20.04 netplan multiple IP addresses on one network card

I have some real issues with one brand new Ubuntu 20.04 installation. I’m trying to accomplish simple network configuration – one physical interface with 2 different IP addresses from the same network using the same gateway. I see netplan is not supporting aliases anymore so I was following the recommendation from netplan page. Here is my config:

version: 2
renderer: networkd
         addresses: [,]  

So when I netplan apply server disappears from the network completely. By looking in the syslog i see the following error:

enp2s0: Could not set route: Nexthop has invalid gateway. Network is unreachable
enp2s0: Failed

I was following the examples from here
This should be very simple configuration which I don’t understand why not working. Am I missing something?

here is an output from netplan debug:

srv1:~$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:1744): DEBUG: 11:04:55.637: Processing input file /etc/netplan/00-installer-config.yaml..
** (generate:1744): DEBUG: 11:04:55.637: starting new processing pass
** (generate:1744): DEBUG: 11:04:55.637: We have some netdefs, pass them through a final round of validation
** (generate:1744): DEBUG: 11:04:55.637: enp2s0: setting default backend to 1
** (generate:1744): DEBUG: 11:04:55.637: Configuration is valid
** (generate:1744): DEBUG: 11:04:55.637: Generating output files..
** (generate:1744): DEBUG: 11:04:55.637: NetworkManager: definition enp2s0 is not for us (backend 1)
(generate:1744): GLib-DEBUG: 11:04:55.637: posix_spawn avoided (fd close requested)

Leave a Reply

Your email address will not be published. Required fields are marked *