From 9375f3bd6cf0bcdb7d6275507597a756c5a2a911 Mon Sep 17 00:00:00 2001 From: Luan Utimura Date: Tue, 9 Sep 2025 13:44:38 -0300 Subject: [PATCH] Fix nexthop error when adding route to PUBLIC_SUBNET_IP The `stack` script has been consistently failing with: ``` Error: Nexthop has invalid gateway. ``` when it comes time to add a route to $PUBLIC_SUBNET_IP [1]. One solution to this is to add the `onlink` flag [2] to the link mentioned above: ``` onlink pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix. ``` [1] https://opendev.org/openstack/ironic/src/commit/daf856cd2d37b9b2d85d0edd4c82aff34df60ac4/devstack/lib/ironic#L2583 [2] https://man7.org/linux/man-pages/man8/ip-route.8.html Change-Id: Ia6363e6b68de344dd82106077efff86143e63d39 Signed-off-by: Luan Utimura --- devstack/lib/ironic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 7a8bc41de5..d7e2f1622b 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -2580,7 +2580,8 @@ SUBSHELL # behind it, should also just generally work. PUBLIC_SUBNET_ID=$(openstack router show $Q_ROUTER_NAME -c external_gateway_info -f json | jq -r .external_gateway_info.external_fixed_ips[0].subnet_id) # Add a route for dhcp-less return path traffic - sudo ip route add 10.0.6.0/24 via $PUBLIC_SUBNET_IP + PUBLIC_SUBNET_DEV=$(ip -j route get $PUBLIC_SUBNET_IP | jq -r '.[0].dev') + sudo ip route add 10.0.6.0/24 via $PUBLIC_SUBNET_IP dev $PUBLIC_SUBNET_DEV onlink if [[ "${IRONIC_NETWORK_SIMULATOR:-ovs}" != "ovs" ]]; then create_network_simulator