Using ubuntu 22.04 I tried to assign the two IP addresses 192.168.200.100
and 169.254.1.0
to the ethernet device enx00e04c680202
. Following this tutorial and this answer I created a file /etc/netplan/01-network-config_home.yaml
with the following content:
network:
version: 2
renderer: NetworkManager
ethernets:
enx00e04c680202:
addresses:
- 192.168.200.100/24
- 169.254.1.100/24
routes:
- to: default
via: 192.168.200.220
nameservers:
addresses:
- 8.8.8.8 # Add your DNS server IP address
- 8.8.4.4 # Add another DNS server IP address
and applied the changes using the command
sudo netplan apply
I checked the configuration with the command ip address show dev enx00e04c680202
, but it seems only one address has been applied:
3: enx00e04c680202: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:68:02:02 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.100/24 brd 192.168.200.255 scope global noprefixroute enx00e04c680202
valid_lft forever preferred_lft forever
But the other configured address seems to be working! Even it does not show up with the command
ip address show dev enx00e04c680202
I am able to connect to a device with IP address 169.254.1.0 that is connected only to that ethernet adapter.
When I add an IP address to that adapter enx00e04c680202
using the following command
sudo ip addr add 169.254.1.100/24 dev enx00e04c680202
then I see the following output of the command ip address show dev enx00e04c680202
:
3: enx00e04c680202: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:e0:4c:68:02:02 brd ff:ff:ff:ff:ff:ff
inet 192.168.200.100/24 brd 192.168.200.255 scope global noprefixroute enx00e04c680202
valid_lft forever preferred_lft forever
inet 169.254.1.100/24 scope global enx00e04c680202
valid_lft forever preferred_lft forever
It shows the two IP addresses not only one. Maybe that is a bug with ip address show
?