# 4b. deploy E-LAN links
base = 10
for link in elan_fwd_links:
+
+ elan=[]
+
# generate lan ip address
ip = 1
for intf in link["connection_points_reference"]:
if vnf_id in self.sap_identifiers:
src_docker_name = "{0}_{1}".format(vnf_id, intf_name)
vnf_id = src_docker_name
+ else:
+ src_docker_name = vnf_id
vnf_name = vnf_id2vnf_name[vnf_id]
LOG.debug(
"Setting up E-LAN link. %s(%s:%s) -> %s" % (
self._vnf_reconfigure_network(vnfi, intf_name, ip_address)
# increase for the next ip address on this E-LAN
ip += 1
+
+ # add this vnf and interface to the E-LAN for tagging
+ network = self.vnfds[vnf_name].get("dc").net # there should be a cleaner way to find the DCNetwork
+ elan.append({'name':src_docker_name,'interface':intf_name})
+
+
+ # install the VLAN tags for this E-LAN
+ print(elan)
+ network.setLAN(elan)
# increase the base ip address for the next E-LAN
base += 1
def create_topology1():
# create topology
- net = DCNetwork(controller=RemoteController, monitor=True, enable_learning=False)
+ net = DCNetwork(controller=RemoteController, monitor=True, enable_learning=True)
dc1 = net.addDatacenter("dc1")
dc2 = net.addDatacenter("dc2")
s1 = net.addSwitch("s1")