"ip route show dev enp0s9" does not show all routes for enp0s9
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
iproute2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Compare the outputs below:
$ ip -6 route show dev enp0s9
2001:2:0:1000::/64 proto ra metric 1024 expires 65518sec pref medium
fe80::/64 proto kernel metric 256 pref medium
$ ip -6 route
2001:2:0:1000::/64 dev enp0s9 proto ra metric 1024 expires 65525sec pref medium
fe80::/64 dev enp0s3 proto kernel metric 256 pref medium
fe80::/64 dev enp0s9 proto kernel metric 256 pref medium
default proto ra metric 1024 expires 589sec pref medium
nexthop via fe80::200:
nexthop via fe80::200:
The default route is associated with enp0s9, yet the first command above does not show it.
FWIW, the two default route entries were created by two separate routers on the network, each sending their RA.
ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: iproute2 6.1.0-1ubuntu6
ProcVersionSign
Uname: Linux 6.8.0-35-generic x86_64
ApportVersion: 2.28.1-0ubuntu3
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Wed Jun 26 11:51:48 2024
InstallationDate: Installed on 2024-06-24 (2 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-
XDG_RUNTIME_
SourcePackage: iproute2
UpgradeStatus: No upgrade log present (probably fresh install)
In case you have trouble creating the condition that reproduces this bug, there are two ways (that I know of) that will create two default routes on an interface:
1) Configure two IPv6 routers on the same network and have each send their own RAs with the same GA-prefix.
This will cause the host to configure an IPv6 SLAAC address and create the two default routes.
2) Configure systemd-networkd
E.g. assume your interface is called enp0s9 and you already have add a config file in /etc/system/ network/ 10-enp0s9. network. Now add an override.conf as follows:
$ cat /etc/systemd/ network/ 10-enp0s9. network. d/override. conf 2001:2: 0:1000: a00:27ff: fe5f:f72d/ 64
[Network]
Address=
[Route] fe80::200: 10ff:fe10: 1060
Gateway=
GatewayOnLink=true
[Route] fe80::200: 10ff:fe10: 1061
Gateway=
GatewayOnLink=true
Now reload and reconfigure the interface and you will see two routes.
$ networkctl reload
$ networkctl reconfigure enp0s9
$ ip -6 r
$ ip -6 r show dev enp0s9