Skip to content

Commit

Permalink
Minor improvement to get_arp processing on NXOS SSH (#639)
Browse files Browse the repository at this point in the history
* Minor improvement to get_arp processing on NXOS SSH
  • Loading branch information
ktbyers committed Feb 2, 2018
1 parent 68c1861 commit de9457a
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
4 changes: 3 additions & 1 deletion napalm/nxos_ssh/nxos_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,9 @@ def get_arp_table(self):
arp_entries = arp_list[1].strip()
for line in arp_entries.splitlines():
if len(line.split()) >= 4:
address, age, mac, interface = line.split()[:4]
# Search for extra characters to strip, currently strip '*', '+', '#', 'D'
line = re.sub(r"\s+[\*\+\#D]{1,4}\s*$", "", line, flags=re.M)
address, age, mac, interface = line.split()
else:
raise ValueError("Unexpected output from: {}".format(line.split()))

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
[
{
"interface": "Ethernet3/36",
"mac": "F4:CF:E2:E0:CF:41",
"ip": "172.20.10.82",
"age": 123.0
},
{
"interface": "Ethernet1/5",
"mac": "00:2C:C8:7D:74:3F",
"ip": "172.16.252.10",
"age": 344.0
},
{
"interface": "Ethernet1/7",
"mac": "2C:5A:0F:F0:45:7F",
"ip": "172.16.253.2",
"age": 174.0
},
{
"interface": "Ethernet1/9",
"mac": "00:2C:C8:7D:75:7F",
"ip": "172.20.110.6",
"age": 551.0
},
{
"interface": "Ethernet1/11",
"mac": "70:DF:2F:07:20:E4",
"ip": "172.16.200.46",
"age": 8.0
},
{
"interface": "Vlan10",
"mac": "00:00:0C:07:AC:0A",
"ip": "192.32.10.1",
"age": 443.0
},
{
"interface": "Vlan10",
"mac": "40:55:39:22:CC:C1",
"ip": "192.32.10.3",
"age": 935.0
},
{
"interface": "Vlan125",
"mac": "00:E0:86:02:A5:E9",
"ip": "192.6.125.22",
"age": 692.0
},
{
"interface": "Vlan125",
"mac": "00:E0:86:02:C3:D0",
"ip": "192.6.125.23",
"age": 579.0
},
{
"interface": "Vlan125",
"mac": "00:1B:D5:02:A7:44",
"ip": "192.6.125.25",
"age": 361.0
},
{
"interface": "Vlan125",
"mac": "00:50:56:9A:79:DD",
"ip": "192.6.125.32",
"age": 290.0
},
{
"interface": "Vlan125",
"mac": "00:24:81:E1:E5:12",
"ip": "192.6.125.36",
"age": 26.0
},
{
"interface": "Vlan125",
"mac": "00:25:B3:23:F3:5E",
"ip": "192.6.125.37",
"age": 3.0
},
{
"interface": "Vlan125",
"mac": "00:50:56:B2:00:3F",
"ip": "192.6.125.44",
"age": 391.0
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Flags: * - Adjacencies learnt on non-active FHRP router
+ - Adjacencies synced via CFSoE
# - Adjacencies Throttled for Glean
D - Static Adjacencies attached to down interface

IP ARP Table for context default
Total number of entries: 2302
Address Age MAC Address Interface
172.20.10.82 00:02:03 f4cf.e2e0.cf41 Ethernet3/36
172.16.252.10 00:05:44 002c.c87d.743f Ethernet1/5
172.16.253.2 00:02:54 2c5a.0ff0.457f Ethernet1/7
172.20.110.6 00:09:11 002c.c87d.757f Ethernet1/9
172.16.200.46 00:00:08 70df.2f07.20e4 Ethernet1/11
192.32.10.1 00:07:23 0000.0c07.ac0a Vlan10
192.32.10.3 00:15:35 4055.3922.ccc1 Vlan10
192.6.125.22 00:11:32 00e0.8602.a5e9 Vlan125
192.6.125.23 00:09:39 00e0.8602.c3d0 Vlan125
192.6.125.25 00:06:01 001b.d502.a744 Vlan125
192.6.125.32 00:04:50 0050.569a.79dd Vlan125 *
192.6.125.36 00:00:26 0024.81e1.e512 Vlan125 *
192.6.125.37 00:00:03 0025.b323.f35e Vlan125 *
192.6.125.44 00:06:31 0050.56b2.003f Vlan125

0 comments on commit de9457a

Please sign in to comment.