summaryrefslogtreecommitdiffstats
path: root/deploy/network.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/network.sh')
-rwxr-xr-xdeploy/network.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/deploy/network.sh b/deploy/network.sh
index 558d690c..e50f52a6 100755
--- a/deploy/network.sh
+++ b/deploy/network.sh
@@ -47,6 +47,7 @@ function save_network_info()
ip_info=`ip addr show $external_nic|grep -Eo '[^ ]+ brd [^ ]+ '`
if [ $br_exist -eq 0 ]; then
if [ "$external_nic" != "br-external" ]; then
+ sudo ip link set br-external up
sudo ovs-vsctl --may-exist add-port br-external $external_nic
sudo ip addr flush $external_nic
sudo ip addr add $ip_info dev br-external
@@ -54,6 +55,7 @@ function save_network_info()
fi
else
sudo ovs-vsctl add-br br-external
+ sudo ip link set br-external up
sudo ovs-vsctl add-port br-external $external_nic
sudo ip addr flush $external_nic
sudo ip addr add $ip_info dev br-external
@@ -73,9 +75,9 @@ function setup_bridge_external()
sudo virsh net-destroy external
sudo virsh net-undefine external
- save_network_info
+ #save_network_info
sed -e "s/REPLACE_NAME/external/g" \
- -e "s/REPLACE_OVS/br-external/g" \
+ -e "s/REPLACE_OVS/br-external_nat/g" \
$COMPASS_DIR/deploy/template/network/bridge_ovs.xml \
> $WORK_DIR/network/external.xml
@@ -123,6 +125,7 @@ function recover_nat_net() {
function setup_virtual_net() {
setup_nat_net install $INSTALL_GW $INSTALL_MASK
+ setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END
}
function recover_virtual_net() {
@@ -133,7 +136,8 @@ function setup_baremetal_net() {
if [[ -z $INSTALL_NIC ]]; then
exit 1
fi
- setup_bridge_net install $INSTALL_NIC
+ sudo ifconfig $INSTALL_NIC up
+ sudo ifconfig $INSTALL_NIC $INSTALL_GW
}
function recover_baremetal_net() {
@@ -149,7 +153,7 @@ function setup_network_boot_scripts() {
sudo cat << EOF >> /usr/sbin/network_setup
sleep 2
-save_network_info
+#save_network_info
clear_forward_rejct_rules
EOF
sudo chmod 755 /usr/sbin/network_setup
@@ -161,13 +165,12 @@ EOF
}
function create_nets() {
- setup_nat_net mgmt $MGMT_GW $MGMT_MASK $MGMT_IP_START $MGMT_IP_END
# create install network
setup_"$TYPE"_net
# create external network
- setup_bridge_external
+# setup_bridge_external
clear_forward_rejct_rules
setup_network_boot_scripts