-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
False
-
-
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.