Bug 2183048

Summary: Partial ipv6 route remains in the old table after changing auto-route-table-id
Product: Red Hat Enterprise Linux 9 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED MIGRATED QA Contact: Mingyu Shi <mshi>
Severity: low Docs Contact:
Priority: low    
Version: 9.3CC: ferferna, jiji, jishi, network-qe, sfaye, till
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-17 12:26:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mingyu Shi 2023-03-30 10:16:10 UTC
Description of problem:
After changing `auto-route-table-id`, partial ipv6 route still shows in the old table.

Version-Release number of selected component (if applicable):
nmstate-2.2.9-1.el9.x86_64
nispor-1.2.10-1.el9.x86_64
NetworkManager-1.43.4-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
#!/bin/bash -xe

ip link add veth0 type veth peer veth0_ep
ip link set veth0 up
ip link set veth0_ep up
nmcli dev set veth0 managed yes
nmcli dev set veth0_ep managed yes
ip link add veth1 type veth peer veth1_ep
ip link set veth1 up
ip link set veth1_ep up
nmcli dev set veth1 managed yes
nmcli dev set veth1_ep managed yes

cat << EOF > auto_table.yaml
interfaces:
- name: veth0
  type: ethernet
  state: up
  ipv4:
    enabled: true
    auto-route-table-id: 1000
    dhcp: true
  ipv6:
    enabled: true
    auto-route-table-id: 1000
    dhcp: true
    autoconf: true
- name: veth1
  type: ethernet
  state: up
  ipv4:
    enabled: true
    auto-route-table-id: 1001
    dhcp: true
  ipv6:
    enabled: true
    auto-route-table-id: 1001
    dhcp: true
    autoconf: true
- name: veth0_ep
  type: ethernet
  state: up
  ipv4:
    enabled: true
    address:
    - ip: 192.168.199.1
      prefix-length: 24
  ipv6:
    enabled: true
    address:
    - ip: 192:168:199::1
      prefix-length: 64
- name: veth1_ep
  type: ethernet
  state: up
  ipv4:
    enabled: true
    address:
    - ip: 192.168.200.1
      prefix-length: 24
  ipv6:
    enabled: true
    address:
    - ip: 192:168:200::1
      prefix-length: 64
EOF

cat << EOF > /etc/dnsmasq.d/nmstate.conf
interface=veth0_ep
dhcp-range=192.168.199.100,192.168.199.250,255.255.255.0,48h
enable-ra
dhcp-range=192:168:199::100,192:168:199::ffff,ra-names,slaac,64,480h
dhcp-option=option:classless-static-route,198.50.199.0/24,192.168.199.1
dhcp-option=option:dns-server,192.168.199.251
interface=veth1_ep
dhcp-range=192.168.200.100,192.168.200.250,255.255.255.0,48h
enable-ra
dhcp-range=192:168:200::100,192:168:200::ffff,ra-names,slaac,64,480h
dhcp-option=option:classless-static-route,198.50.200.0/24,192.168.200.1
dhcp-option=option:dns-server,192.168.200.251
EOF

systemctl restart dnsmasq
nmstatectl apply auto_table.yaml

# Waiting for DHCP delivered
sleep 10

sed 's/auto-route-table-id: 100/auto-route-table-id: 200/g' auto_table.yaml > change_table.yaml
nmstatectl apply change_table.yaml

# ipv4 routes were all removed from old table 1000(moved to table 2000), while a ipv6 route remained
ip route ls table 1000
ip route ls table 1001
ip -6 route ls table 1000
ip -6 route ls table 1001

Actual results:
+ ip route ls table 1000
+ ip route ls table 1001
+ ip -6 route ls table 1000
192:168:199::f065 dev veth0 proto kernel metric 101 pref medium
+ ip -6 route ls table 1001
192:168:200::6de5 dev veth1 proto kernel metric 103 pref medium

Expected results:
All ipv4/ipv6 routes were moved from table 1000/1001 to table 2000/2001

Additional info: