Skip to content

Commit

Permalink
DM: auto-export policy not required for NAT'ed vrf
Browse files Browse the repository at this point in the history
- Do not add auto-export policy for NAT'ed vrf and make export targets empty
- work-around solution for dfwd issue (service set rules can't be more than 32, but cli allows 64)

Change-Id: Iebf3c3d03848691086024b001d57c3079e4a59d3
Closes-Bug: #1468143
Closes-Bug: #1468145
  • Loading branch information
sbalineni committed Jun 24, 2015
1 parent 7b1beb7 commit f61f1e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/config/device-manager/device_manager/db.py
Expand Up @@ -274,7 +274,7 @@ def push_config(self):
interfaces.append(service_ports[0] + "." + str(service_port_id + 1))
self.config_manager.add_routing_instance(vrf_name,
import_set,
export_set,
set(),
None,
None,
False,
Expand Down
Expand Up @@ -183,23 +183,23 @@ def add_routing_instance(self, ri_name, import_targets, export_targets,
if_element = etree.SubElement(ri, "interface")
etree.SubElement(if_element, "name").text = interface

if ri_opt is None:
ri_opt = etree.SubElement(ri, "routing-options")
if prefixes and fip_map is None:
if ri_opt is None:
ri_opt = etree.SubElement(ri, "routing-options")
static_config = etree.SubElement(ri_opt, "static")
static_config = etree.SubElement(ri_opt, "static")
for prefix in prefixes:
route_config = etree.SubElement(static_config, "route")
etree.SubElement(route_config, "name").text = prefix
etree.SubElement(route_config, "discard")
auto_export = "<auto-export><family><inet><unicast/></inet></family></auto-export>"
ri_opt.append(etree.fromstring(auto_export))
auto_export = "<auto-export><family><inet><unicast/></inet></family></auto-export>"
ri_opt.append(etree.fromstring(auto_export))
else:
etree.SubElement(ri, "instance-type").text = "virtual-switch"

if fip_map is not None:
if ri_opt is None:
ri_opt = etree.SubElement(ri, "routing-options")
static_config = etree.SubElement(ri_opt, "static")
static_config = etree.SubElement(ri_opt, "static")
route_config = etree.SubElement(static_config, "route")
etree.SubElement(route_config, "name").text = "0.0.0.0/0"
etree.SubElement(route_config, "next-hop").text = interfaces[0]
Expand Down Expand Up @@ -376,7 +376,7 @@ def add_routing_instance(self, ri_name, import_targets, export_targets,
services_config = self.services_config or etree.Element("services")
service_name = 'sv-' + ri_name
#mx has limitation for service-set and nat-rule name length, allowed max 63 chars
service_name = service_name[:56]
service_name = service_name[:20]
service_set = etree.SubElement(services_config, "service-set")
etree.SubElement(service_set, "name").text = service_name
rule_count = len(fip_map)
Expand Down

0 comments on commit f61f1e7

Please sign in to comment.