Skip to content

"Interface route" cannot be modified and is set to 0 metric #10696

Open
@ArcherSeven

Description

@ArcherSeven

Bug Report

Description

Talos creates both a default route with metric 1024 and what I will naively call an "interface route" set to metric of 0 for each configured interface.

If multiple interfaces connect to the same subnet, it is possible to modify the default/gateway route, but not the interface route, and since the interface route is set to metric 0, it cannot be overwritten.

Example config (where an unconfigured interface is left to use DHCP)

    network:
        interfaces:
            - addresses:
                - 172.22.1.21/24
              deviceSelector:
                busPath: 0000:02:00.0
              routes:
                - gateway: 172.22.1.1
                  metric: 2048
                  network: 0.0.0.0/0
                - network: 172.22.1.0/24
                  metric: 2048

Resulting routes:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.22.1.1      0.0.0.0         UG    1024   0        0 eno1
0.0.0.0         172.22.1.1      0.0.0.0         UG    2048   0        0 enp2s0
10.244.1.0      0.0.0.0         255.255.255.0   U     0      0        0 cni0
172.22.1.0      0.0.0.0         255.255.255.0   U     0      0        0 eno1
172.22.1.0      0.0.0.0         255.255.255.0   U     0      0        0 enp2s0
172.22.1.0      0.0.0.0         255.255.255.0   U     2048   0        0 enp2s0

This means that the actual order of preference for the routes is based on order of creation, so in the above situation, when the router reboots, the routes end up as:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.22.1.1      0.0.0.0         UG    1024   0        0 eno1
0.0.0.0         172.22.1.1      0.0.0.0         UG    2048   0        0 enp2s0
172.22.1.0      0.0.0.0         255.255.255.0   U     0      0        0 enp2s0
172.22.1.0      0.0.0.0         255.255.255.0   U     0      0        0 eno1
172.22.1.0      0.0.0.0         255.255.255.0   U     2048   0        0 enp2s0

At which point no destination is pingable (since enp2s0 is configured, but the interface isn't actually plugged in)

We need to either be able to change these "interface" routes, or have them set to a higher metric so we can override them.

Environment

  • Talos version: v1.9.2 (other versions 1.7+ also tested)
  • Kubernetes version: v1.27.15
  • Platform: Baremetal x86_64

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions