I want to assign multiple IP4 addresses to a USB->Ethernet adapter in an Ubuntu 18.04 LTS system. I have removed netplan, since I find the yaml-based configuration even more obscure than the traditional way of configuring the network.
Since I want the extra addresses to be permanent, I put them into /etc/network/interfaces, as described here as "Legacy method".
Adding extra IP4 addresses to a "fixed" ethernet interface works, but the same doesn't work with the USB-to-Ethernet dongle. I'm puzzled as to what the difference is.
EDIT: I was asked to share my interfaces file. Here it is:
auto lo iface lo inet loopback auto eno1 iface eno1 inet static address 192.168.2.6 netmask 255.255.255.0 broadcast 192.168.2.255 offload-gro off offload-gso off offload-tso off auto enx000ec6fe56fb iface enx000ec6fe56fb inet static address 192.168.31.6 netmask 255.255.255.0 broadcast 192.168.31.255 gateway 192.168.31.1 offload-gro off offload-gso off offload-tso off auto enx000ec6fe56fb:0 iface enx000ec6fe56fb:0 inet static address 192.168.31.4 netmask 255.255.255.0 auto eno1:0 iface eno1:0 inet static address 192.168.2.4 netmask 255.255.255.0
As you can see, I introduce a virtual IP interface for each of the real interfaces. eno1 is a plain Ethernet interface on the mainboard, while enx000ec6fe56fb is a USB-to-Ethernet dongle. The virtual interface for eno1 works, the other doesn't.