diff options
author | wutianwei <wutianwei1@huawei.com> | 2018-01-27 18:08:34 +0800 |
---|---|---|
committer | wutianwei <wutianwei1@huawei.com> | 2018-01-27 18:08:34 +0800 |
commit | 3907d59a072d158de67e3cc94bc6ea0ed747d390 (patch) | |
tree | 441271197d405e7ca50ca90e10b83c3f30ab708b /deploy/network.sh | |
parent | 2c93fa28f1f1e78f4135f096f0c59e82963fd847 (diff) |
Compass4nfv virtual deploy support direct connection
compass4nfv using nat for VM external network currently,
this patch add the direct connection method.
if want to use it ,you need set the NAT_EXTERNAL to false,
and configure the network.yml according to you environment
Change-Id: I5a1a2f96b8c32a00eaef4d591c4452b555f0c9a2
Signed-off-by: wutianwei <wutianwei1@huawei.com>
Diffstat (limited to 'deploy/network.sh')
-rwxr-xr-x | deploy/network.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/deploy/network.sh b/deploy/network.sh index 698771b3..eea62277 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -76,9 +76,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_nat/g" \ + -e "s/REPLACE_OVS/br-external/g" \ $COMPASS_DIR/deploy/template/network/bridge_ovs.xml \ > $WORK_DIR/network/external.xml @@ -86,14 +86,12 @@ function setup_bridge_external() sudo virsh net-start external sudo virsh net-autostart external - python $COMPASS_DIR/deploy/setup_vnic.py } function recover_bridge_external() { sudo virsh net-start external - python $COMPASS_DIR/deploy/setup_vnic.py } function setup_nat_net() { @@ -128,7 +126,12 @@ function recover_nat_net() { function setup_virtual_net() { setup_nat_net install $INSTALL_GW $INSTALL_NETMASK - setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + + if [[ "$NAT_EXTERNAL" == "false" ]]; then + setup_bridge_external + else + setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + fi } function recover_virtual_net() { |