def _neighbor_create(self, ip_address='192.168.177.32', remote_as=64513): bgp_neighbor = {} bgp_neighbor[neighbors.IP_ADDRESS] = str(ip_address) bgp_neighbor[neighbors.REMOTE_AS] = remote_as call('neighbor.create', **bgp_neighbor) return {}
def _core_start(self, as_number=64512, router_id='10.0.0.1'): common_settings = {} common_settings[LOCAL_AS] = as_number common_settings[ROUTER_ID] = str(router_id) waiter = hub.Event() call('core.start', waiter=waiter, **common_settings) waiter.wait() return {}
def _show_rib(self, family='ipv4'): show = {} show['params'] = ['rib', family] return call('operator.show', **show)
def _neighbors_get(self): return call('neighbors.get')
def _prefix_add(self, prefix='10.20.0.0/24'): networks = {} networks[PREFIX] = str(prefix) call('network.add', **networks) return {}