Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_interface returns -1 for speed if Auto negotiate is used on Juniper #942

Closed
robobeaver6 opened this issue Mar 12, 2019 · 1 comment · Fixed by #967
Closed

get_interface returns -1 for speed if Auto negotiate is used on Juniper #942

robobeaver6 opened this issue Mar 12, 2019 · 1 comment · Fixed by #967

Comments

@robobeaver6
Copy link

reproduced using Nornir to call Napalm get_interface on a Juniper EX4300 running Junos 14.1X53-D47.6

task.run(task=napalm_get,
                       name='Get Interface Details',
                       getters='get_interfaces',
                       severity_level=logging.DEBUG)

The information returned for a single up interface:

{ 'get_interfaces': { 'ge-0/0/2': { 'description': 'Phone: Desk U18 {Floorport '
                                                   '115}',
                                                 'is_enabled': True,
                                                 'is_up': True,
                                                 'last_flapped': 4562584.0,
                                                 'mac_address': 'C0:42:D0:C5:0A:25',
                                                 'speed': -1},
}

I believe napalm is resolving the speed as Auto from the show interface command (or something similar).

rhall@loonaccess52> show interfaces ge-0/0/2 
Physical interface: ge-0/0/2, Enabled, Physical link is Up
  Interface index: 663, SNMP ifIndex: 512
  Description: Phone: Desk U18 {Floorport 115}
  Link-level type: Ethernet, MTU: 1514, MRU: 0, Link-mode: Full-duplex, Speed: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled,
  Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online, Media type: Copper, IEEE 802.3az Energy Efficient Ethernet: Disabled
  Device flags   : Present Running
  Interface flags: SNMP-Traps Internal: 0x0
  Link flags     : None
  CoS queues     : 12 supported, 12 maximum usable queues
  Current address: c0:42:d0:c5:0a:25, Hardware address: c0:42:d0:c5:0a:25
  Last flapped   : 2019-01-18 19:48:05 UTC (7w3d 19:29 ago)
  Input rate     : 0 bps (0 pps)
  Output rate    : 256 bps (1 pps)
  Active alarms  : None
  Active defects : None
  Interface transmit statistics: Disabled

  Logical interface ge-0/0/2.0 (Index 581) (SNMP ifIndex 517)
    Flags: Up SNMP-Traps 0x0 Encapsulation: Ethernet-Bridge
    Input packets : 80784
    Output packets: 167464
    Protocol eth-switch, MTU: 1514

if the command show interface media were used, the response would contain the auto negotiation information, including the speed

rhall@loonaccess52> show interfaces ge-0/0/2 media 
Physical interface: ge-0/0/2, Enabled, Physical link is Up
  Interface index: 663, SNMP ifIndex: 512
  Description: Phone: Desk U18 {Floorport 115}
  Link-level type: Ethernet, MTU: 1514, MRU: 0, Link-mode: Full-duplex, Speed: Auto, BPDU Error: None, MAC-REWRITE Error: None, Loopback: Disabled, Source filtering: Disabled,
  Flow control: Enabled, Auto-negotiation: Enabled, Remote fault: Online, Media type: Copper, IEEE 802.3az Energy Efficient Ethernet: Disabled
  Device flags   : Present Running
  Interface flags: SNMP-Traps Internal: 0x0
  Link flags     : None
  CoS queues     : 12 supported, 12 maximum usable queues
  Current address: c0:42:d0:c5:0a:25, Hardware address: c0:42:d0:c5:0a:25
  Last flapped   : 2019-01-18 19:48:05 UTC (7w3d 19:31 ago)
  Input rate     : 74240 bps (43 pps)
  Output rate    : 45792 bps (29 pps)
  Active alarms  : None
  Active defects : None
  MAC statistics:
    Input bytes: 877854914, Input packets: 4058264, Output bytes: 878718262, Output packets: 6956180
  Autonegotiation information:
    Negotiation status: Complete
    Link partner:
        Link mode: Full-duplex, Flow control: None, Remote fault: OK, Link partner Speed: 100 Mbps
    Local resolution:
        Flow control: None, Remote fault: Link OK, Local link Speed: 100 Mbps, Link mode: Full-duplex
  Interface transmit statistics: Disabled

This issue does not occur on ten gig interface, as the speed does not show as Auto.

@robobeaver6
Copy link
Author

Forgot to say the versions:
napalm 2.3.1
nornir 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants