From 348c6ace71f791034dae19a3467d18cea3140d5a Mon Sep 17 00:00:00 2001 From: gong yong sheng Date: Tue, 23 Jun 2015 14:03:47 +0800 Subject: [PATCH] Use ip route replace to avoid the existing route Change-Id: I3cc82aca1e3fd26e3beb4baee1f11a9b45e8b9f7 Closes-Bug: 1467762 --- lib/neutron-legacy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 3ac76a2586..279f6e937b 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -721,7 +721,7 @@ function start_neutron_agents { sudo ip addr del $IP dev $PUBLIC_INTERFACE sudo ip addr add $IP dev $OVS_PHYSICAL_BRIDGE done - sudo route add -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE + sudo ip route replace $FIXED_RANGE via $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE fi fi @@ -1275,7 +1275,7 @@ function _neutron_configure_router_v4 { fi ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' -v subnet_id=$PUB_SUBNET_ID '$4 == subnet_id { print $8; }'` die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP" - sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP + sudo ip route replace $FIXED_RANGE via $ROUTER_GW_IP fi _neutron_set_router_id fi @@ -1310,7 +1310,7 @@ function _neutron_configure_router_v6 { # Configure interface for public bridge sudo ip -6 addr add $ipv6_ext_gw_ip/$ipv6_cidr_len dev $ext_gw_interface - sudo ip -6 route add $FIXED_RANGE_V6 via $IPV6_ROUTER_GW_IP dev $ext_gw_interface + sudo ip -6 route replace $FIXED_RANGE_V6 via $IPV6_ROUTER_GW_IP dev $ext_gw_interface fi _neutron_set_router_id fi