napalm-automation-community / napalm-s350

NAPALM driver for Cisco SMB switches (SF3xx, SF5xx, SG3xx, SG5xx).
Apache License 2.0
16 stars 13 forks source link

get_interfaces_ip invalid output #40

Closed Phill93 closed 3 years ago

Phill93 commented 3 years ago

The interface part of the get_interfaces_ip method is wrong. The VLAN ID is cut off

Example: IP 192.168.1.254 at VLAN 1

{'vlan': {'ipv4': {'192.168.1.254': {'prefix_length': 24}}}}
Phill93 commented 3 years ago

switch output


    IP Address        I/F    I/F Status  Type   Redirect Status
                             admin/oper
------------------ --------- ---------- ------- -------- ------
0.0.0.0/32         vlan 1    UP/UP      DHCP    enable   Not
                                                         receiv
                                                         ed
192.168.1.254/24   vlan 1    UP/UP      Default enable   Valid

  Gateway IP Address        Activity status       Type
----------------------- ----------------------- --------
qaxi commented 3 years ago

It looks like SG500 is "strange" beast ...

May be we would have apply the same attitude as in #39 with detecting field width instead of spliting on " " ...

Phill93 commented 3 years ago

The output is from an SG300-10. We have the problem with all models: