Create multicast groups for NDP support
This commit is contained in:
parent
8ca0c7fdf4
commit
6895a6ab34
2 changed files with 27 additions and 0 deletions
|
|
@ -86,6 +86,21 @@ class L2Controller(object):
|
|||
# Now add global address
|
||||
subprocess.call(["mx", host, "ip", "addr", "add", ipaddr, "dev", dev])
|
||||
|
||||
def init_ndp(self):
|
||||
""" initialise neighbor discovery protocol"""
|
||||
|
||||
all_ports = range(1,5)
|
||||
# create multicast nodes
|
||||
for rid in range(1,5):
|
||||
ports = [ x for x in all_ports if not x == rid ]
|
||||
n_handle = self.controller.mc_node_create(rid, ports)
|
||||
log.debug("Creating MC node rid={} ports={} handle={}".format(rid, ports, n_handle))
|
||||
|
||||
g_handle = self.controller.mc_mgrp_create(rid)
|
||||
log.debug("Creating MC group mgrp={} handle={} && associating afterwards".format(rid, g_handle))
|
||||
|
||||
self.controller.mc_node_associate(g_handle, n_handle)
|
||||
|
||||
def init_boilerplate(self, sw_name):
|
||||
self.topo = Topology(db="topology.db")
|
||||
self.sw_name = sw_name
|
||||
|
|
@ -98,6 +113,8 @@ class L2Controller(object):
|
|||
if self.cpu_port:
|
||||
self.controller.mirroring_add(100, self.cpu_port)
|
||||
|
||||
self.init_ndp()
|
||||
|
||||
def config(self):
|
||||
self.fill_tables()
|
||||
self.config_hosts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue