Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop' of https://github.com/wolcomm/napalm-ios into …
Browse files Browse the repository at this point in the history
…get_bgp_neighbors_pr
  • Loading branch information
ktbyers committed May 25, 2017
2 parents 094a60d + 9490319 commit b87b526
Show file tree
Hide file tree
Showing 28 changed files with 2,165 additions and 139 deletions.
35 changes: 35 additions & 0 deletions napalm_ios/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Helper functions for the NAPALM base."""

# Python3 support
from __future__ import print_function
from __future__ import unicode_literals

# third party libs
from netaddr import IPAddress

# local modules
from napalm_base.utils import py23_compat


def ip(addr, version=None):
"""
Converts a raw string to a valid IP address. This function replaces napalm_base.helpers.ip() \
to provide support for IP version checking.
Motivation: the groups of the IP addreses may contain leading zeros. IPv6 addresses can \
contain sometimes uppercase characters. E.g.: 2001:0dB8:85a3:0000:0000:8A2e:0370:7334 has \
the same logical value as 2001:db8:85a3::8a2e:370:7334. However, their values as strings are \
not the same.
:param addr: the raw string containing the value of the IP Address
:param version: (optional) insist on a specific IP address version.
:type version: int.
:return: a string containing the IP Address in a standard format (no leading zeros, \
zeros-grouping, lowercase)
Example:
.. code-block:: python
>>> ip('2001:0dB8:85a3:0000:0000:8A2e:0370:7334')
u'2001:db8:85a3::8a2e:370:7334'
"""
obj = IPAddress(addr)
if version and obj.version != version:
raise ValueError("%s is not an ipv%d address" % (addr, version))
return py23_compat.text_type(obj)
389 changes: 275 additions & 114 deletions napalm_ios/ios.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1,39 @@
{"global": {"router_id": "192.168.0.1", "peers": {"192.168.0.2": {"is_enabled": true, "uptime": -1, "remote_as": 65001, "description": "", "remote_id": "0.0.0.0", "local_as": 65000, "is_up": false, "address_family": {"ipv4": {"sent_prefixes": 0, "accepted_prefixes": 0, "received_prefixes": 0} }}, "192.168.0.3": {"is_enabled": true, "uptime": -1, "remote_as": 65010, "description": "", "remote_id": "192.168.0.3", "local_as": 65000, "is_up": false, "address_family": {"ipv4": {"sent_prefixes": 0, "accepted_prefixes": 0, "received_prefixes": 0} }}}}}
{
"global": {
"router_id": "192.168.0.1",
"peers": {
"192.168.0.2": {
"is_enabled": true,
"uptime": -1,
"remote_as": 65001,
"description": "",
"remote_id": "0.0.0.0",
"local_as": 65000,
"is_up": false,
"address_family": {
"ipv4": {
"sent_prefixes": 0,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"192.168.0.3": {
"is_enabled": true,
"uptime": -1,
"remote_as": 65010,
"description": "",
"remote_id": "192.168.0.3",
"local_as": 65000,
"is_up": false,
"address_family": {
"ipv4": {
"sent_prefixes": 0,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
For address family: IPv4 Unicast
BGP router identifier 192.168.0.1, local AS number 65000
BGP table version is 1, main routing table version 1

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BGP neighbor is 192.168.0.2, remote AS 65001, internal link
Inherits from template iBGP for session parameters
BGP version 4, remote router ID 0.0.0.0

For address family: IPv4 Unicast
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 0 0

Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Total: 0 0

BGP neighbor is 192.168.0.3, remote AS 65010, internal link
Inherits from template iBGP for session parameters
BGP version 4, remote router ID 192.168.0.3

For address family: IPv4 Unicast
Sent Rcvd
Prefix activity: ---- ----
Prefixes Current: 0 0

Outbound Inbound
Local Policy Denied Prefixes: -------- -------
Total: 0 0

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"global": {
"router_id": "10.0.1.1",
"peers": {
"10.0.0.2": {
"is_enabled": true,
"uptime": 4838400,
"remote_as": 65000,
"description": "internal-2",
"remote_id": "10.0.1.2",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv4": {
"sent_prefixes": 637213,
"accepted_prefixes": 3142,
"received_prefixes": 3142
},
"ipv6": {
"sent_prefixes": 36714,
"accepted_prefixes": 148,
"received_prefixes": 148
}
}
},
"10.0.0.3": {
"is_enabled": true,
"uptime": 133200,
"remote_as": 65000,
"description": "internal-3",
"remote_id": "10.0.1.3",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv4": {
"sent_prefixes": 966,
"accepted_prefixes": 1,
"received_prefixes": 1
},
"ipv6": {
"sent_prefixes": 105,
"accepted_prefixes": 2,
"received_prefixes": 2
}
}
},
"192.168.0.1": {
"is_enabled": true,
"uptime": 3888000,
"remote_as": 65001,
"description": "external-1",
"remote_id": "192.168.1.1",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv4": {
"sent_prefixes": 709,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"192.168.0.2": {
"is_enabled": true,
"uptime": -1,
"remote_as": 65002,
"description": "external-2",
"remote_id": "0.0.0.0",
"local_as": 65000,
"is_up": false,
"address_family": {
"ipv4": {
"sent_prefixes": 0,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"192.168.0.3": {
"is_enabled": false,
"uptime": -1,
"remote_as": 65003,
"description": "external-3",
"remote_id": "0.0.0.0",
"local_as": 65000,
"is_up": false,
"address_family": {
"ipv4": {
"sent_prefixes": 0,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"192.168.0.4": {
"is_enabled": true,
"uptime": 16243200,
"remote_as": 65004,
"description": "external-4",
"remote_id": "192.168.1.4",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv4": {
"sent_prefixes": 213,
"accepted_prefixes": 629700,
"received_prefixes": 629700
}
}
},
"2001:db8::1": {
"is_enabled": true,
"uptime": 3456000,
"remote_as": 65001,
"description": "external-1",
"remote_id": "192.168.1.1",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv6": {
"sent_prefixes": 35,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"2001:db8::2": {
"is_enabled": true,
"uptime": 10713600,
"remote_as": 65002,
"description": "external-2",
"remote_id": "192.168.1.2",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv6": {
"sent_prefixes": 36,
"accepted_prefixes": 1,
"received_prefixes": 1
}
}
},
"2001:db8::3": {
"is_enabled": false,
"uptime": -1,
"remote_as": 65003,
"description": "external-3",
"remote_id": "0.0.0.0",
"local_as": 65000,
"is_up": false,
"address_family": {
"ipv6": {
"sent_prefixes": 0,
"accepted_prefixes": 0,
"received_prefixes": 0
}
}
},
"2001:db8::4": {
"is_enabled": true,
"uptime": 16243200,
"remote_as": 65004,
"description": "external-4",
"remote_id": "192.168.1.4",
"local_as": 65000,
"is_up": true,
"address_family": {
"ipv6": {
"sent_prefixes": 29,
"accepted_prefixes": 36387,
"received_prefixes": 36387
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
For address family: IPv4 Unicast
BGP router identifier 10.0.1.1, local AS number 65000
BGP table version is 1011343585, main routing table version 1011343585
647707 network entries using 160631336 bytes of memory
5657305 path entries using 678876600 bytes of memory
80471 multipath network entries and 160942 multipath paths
1000955/108586 BGP path/bestpath attribute entries using 248236840 bytes of memory
70 BGP rrinfo entries using 2800 bytes of memory
699319 BGP AS-PATH entries using 33422320 bytes of memory
53834 BGP community entries using 10873404 bytes of memory
212 BGP extended community entries using 7834 bytes of memory
6267 BGP route-map cache entries using 401088 bytes of memory
236 BGP filter-list cache entries using 7552 bytes of memory
BGP using 1132459774 total bytes of memory
13548 received paths for inbound soft reconfiguration
BGP activity 8526435/7841854 prefixes, 408323088/402326018 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.0.0.2 4 65000 1336020 64337701 1011343614 0 0 8w0d 3143
192.168.0.1 4 65001 71798 138808 1011343239 0 0 6w3d 0
192.168.0.2 4 65002 0 0 1 0 0 never Active
192.168.0.3 4 65003 0 0 1 0 0 never Idle (Admin)
10.0.0.3 4 65000 2497 4399 1011343631 0 0 1d13h 1
192.168.0.4 4 65004 46122421 675536 1011343239 0 0 26w6d 629783

For address family: IPv6 Unicast
BGP router identifier 10.0.1.1, local AS number 65000
BGP table version is 155362951, main routing table version 155362951
36697 network entries using 9981584 bytes of memory
339404 path entries using 48874176 bytes of memory
17496 multipath network entries and 34992 multipath paths
150389/17120 BGP path/bestpath attribute entries using 37296472 bytes of memory
70 BGP rrinfo entries using 2800 bytes of memory
699320 BGP AS-PATH entries using 33422380 bytes of memory
53834 BGP community entries using 10873404 bytes of memory
212 BGP extended community entries using 7834 bytes of memory
6274 BGP route-map cache entries using 401536 bytes of memory
236 BGP filter-list cache entries using 7552 bytes of memory
BGP using 140867738 total bytes of memory
718 received paths for inbound soft reconfiguration
BGP activity 8526435/7841854 prefixes, 408323098/402326025 paths, scan interval 60 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:DB8::4
4 65004 9900690 612449 155362939 0 0 26w6d 36391
2001:DB8::1
4 65001 63768 71032 155362939 0 0 5w5d 0
2001:DB8::2
4 65002 197924 214323 155362939 0 0 17w5d 1
2001:DB8::3
4 65003 0 0 1 0 0 never Idle (Admin)
10.0.0.2 4 65000 1336020 64337708 155362951 0 0 8w0d 148
10.0.0.3 4 65000 2497 4399 155362952 0 0 1d13h 2
Loading

0 comments on commit b87b526

Please sign in to comment.