Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-15298

os-net-config does not raise an error when next hop is invalid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhos-18.0.16
    • None
    • os-net-config
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • rhos-connectivity-nfv
    • None
    • Moderate

      When configuring an invalid next hop like this:

      [root@compute-0 ~]# cat /tmp/config.yaml 
      
      network_config:
      - type: interface
        name: nic2
        use_dhcp: false
        addresses:
        - ip_netmask: 192.0.50.18/24
        routes:
        - default: true
          nexthop: 192.0.50.1
        - destination: 192.168.50.0/24
          next_hop: 192.0.51.100
      

      We don't get an error when os-net-config applies the configuration:

      [root@compute-0 ~]# os-net-config --debug -c /tmp/config.yaml > /tmp/os-net-config.log 2>&1
      [root@compute-0 ~]# echo $?
      0
      

      Activating the debug log we can see the error:

      2025-03-31 10:21:27.693 DEBUG os_net_config.impl_ifcfg.apply eno2: Applying routes for interface
      2025-03-31 10:21:27.693 INFO os_net_config.execute Running ip route add 192.168.50.0/24 via 192.0.51.100 dev eno2
      2025-03-31 10:21:27.699 WARNING os_net_config.impl_ifcfg.apply Error in 'ip route add 192.168.50.0/24 via 192.0.51.100 dev eno2', restarting eno2:
      Unexpected error while running command.
      Command: /sbin/ip route add 192.168.50.0/24 via 192.0.51.100 dev eno2
      Exit code: 2
      Stdout: ''
      Stderr: 'Error: Nexthop has invalid gateway.\n'
      2025-03-31 10:21:27.700 INFO os_net_config.execute running ifdown on interface: eno2
      

      However, as can be seen above os-net-config applies the valid config without error.

      I'm not sure if os-net-config should raise an error or not.

              vcandapp@redhat.com Vijayalakshmi Candappa
              rdiazcam@redhat.com Ricardo Diaz Campos
              rhos-dfg-nfv
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: