aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/files
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2016-03-25 12:59:53 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2016-03-25 13:03:41 +0800
commit06cf46de14100257cc6843c01ffc92216550b06d (patch)
treeb0f0d0861556fc01543a9135f74e73dc9067b8a1 /deploy/adapters/ansible/roles/open-contrail/files
parent1420da02369d5db05487ea13e29f47947e07b338 (diff)
opencontrail: move vhost0 on eth1
JIRA: COMPASS-349 Change-Id: I2cdf8d10fbd2dbd3a015f0eb0eecc72f2266fb96 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/files')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py b/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
index f8eb306a..fd7795af 100755
--- a/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
+++ b/deploy/adapters/ansible/roles/open-contrail/files/setup_networks_opencontrail.py
@@ -75,6 +75,15 @@ def setup_ips_new(config):
LOG.info("setup_ips_new: cmd=%s" % cmd)
os.system(cmd)
+def setup_default_router(config):
+ LOG.info("setup_ips_new enter")
+ network = netaddr.IPNetwork(config["ip_settings"]["br-prv"]["cidr"])
+ intf_name = config["provider_net_mappings"][0]["interface"]
+ cmd = "route del default;"
+ cmd += "ip route add default via %s dev %s" % (config["ip_settings"]["br-prv"]["gw"], "vhost0")
+ LOG.info("setup_default_router: cmd=%s" % cmd)
+ os.system(cmd)
+
def remove_ovs_kernel_mod(config):
LOG.info("remove_ovs_kernel_mod enter")
cmd = "rmmod vport_vxlan; rmmod openvswitch;"
@@ -90,7 +99,8 @@ def main(config):
setup_intfs(config["sys_intf_mappings"], uplink_map)
setup_ips(config["ip_settings"], config["sys_intf_mappings"])
- setup_ips_new(config)
+# setup_ips_new(config)
+ setup_default_router(config)
if __name__ == "__main__":
config = yaml.load(open(config_path))