talos icon indicating copy to clipboard operation
talos copied to clipboard

Default gateway route misassignment to VLAN instead of physical interface

Open kvaps opened this issue 1 year ago • 1 comments

Bug Report

Description

I came across another interesting bug, or rather a peculiarity. A configuration of this type does not work:

interfaces:
  - deviceSelector:
      hardwareAddr: 9c:6b:00:47:06:6c
    addresses:
      - 11.22.33.206/26
    routes:
      - network: 0.0.0.0/0
        gateway: 11.22.33.193
    vlans:
      - addresses:
          - 192.168.100.12/24
        vlanId: 4006
        vip:
          ip: 192.168.100.10

This is because the deviceSelector matches all interfaces by MAC address, and the default gateway route is assigned to the VLAN interface, not the physical one:

NODE             NAMESPACE   TYPE          ID                         VERSION   DESTINATION GATEWAY        LINK              METRIC
192.168.100.12   network     RouteStatus   inet4/11.22.33.193//1024   1                     11.22.33.193   enp1d74731.4006   1024

The solution: explicitly specify the driver option for deviceSelector.

Logs

Environment

  • Talos version: v1.7.1
  • Kubernetes version: 1.30
  • Platform: metal

kvaps avatar May 06 '24 12:05 kvaps

you could also use physical: true

frezbo avatar May 06 '24 12:05 frezbo