Skip to content
Snippets Groups Projects
Commit 9e2854d9 authored by Erik Reid's avatar Erik Reid
Browse files

generate list of ix public peer (v4 & v6)

parent e2c41d19
No related branches found
No related tags found
No related merge requests found
...@@ -252,6 +252,30 @@ def list_bgp_routes(netconf_config): ...@@ -252,6 +252,30 @@ def list_bgp_routes(netconf_config):
} }
} }
def ix_public_peers(netconf_config):
for r in netconf_config.xpath(
'//configuration/routing-instances/'
'instance[name/text()="IAS"]/protocols/bgp/'
'group[starts-with(name/text(), "GEANT-IX")]/'
'neighbor'):
name = r.find('name')
description = r.find('description')
local_as = r.find('local-as')
if local_as is not None:
local_as = local_as.find('as-number')
peer_as = r.find('peer-as')
yield {
'name': ipaddress.ip_address(name.text),
'description': description.text,
'as': {
'local': int(local_as.text),
'peer': int(peer_as.text)
}
}
# note for enabling vrr data parsing ... # note for enabling vrr data parsing ...
# def fetch_vrr_config(hostname, ssh_params): # def fetch_vrr_config(hostname, ssh_params):
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment