From b90d140bfc3a7e33c40664324d85452b825795ee Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Tue, 9 Sep 2014 15:14:40 +0200 Subject: [PATCH] labs: move network-api IP address Eth3 is used for a bridge and should therefore not have an IP address. With the network-api address remaining on eth3, we can't talk to controller-api. This patch moves the IP address to the switch-internal network device of the bridge, br-ex. Change-Id: I2a52844a160fe7ccd95e8d1aa16eb2d451dd605f --- labs/scripts/setup_neutron_network.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/labs/scripts/setup_neutron_network.sh b/labs/scripts/setup_neutron_network.sh index 81f5ae8f..7d95da4a 100755 --- a/labs/scripts/setup_neutron_network.sh +++ b/labs/scripts/setup_neutron_network.sh @@ -85,6 +85,25 @@ sudo ovs-vsctl add-br br-ex echo "Adding port to external bridge." sudo ovs-vsctl add-port br-ex eth3 +network_api_ip=$(hostname_to_ip network-api) + +echo "Moving network-api IP address from eth3 to a switch-internal device." +sudo ifconfig eth3 0.0.0.0 +sudo ifconfig br-ex "$network_api_ip" + +echo "Making the IP address move reboot-safe." +sudo sed -i "s/$network_api_ip/0.0.0.0/" /etc/network/interfaces +cat << INTERFACES | sudo tee -a /etc/network/interfaces + +auto br-ex +iface br-ex inet static + address $network_api_ip + netmask 255.255.255.0 +INTERFACES + +# Check if we can get to the API network again +ping -c 1 controller-api + echo "Configuring Layer-3 agent." conf=/etc/neutron/l3_agent.ini iniset_sudo $conf DEFAULT interface_driver neutron.agent.linux.interface.OVSInterfaceDriver