MJL85 / natlas

natlas - Network Discovery and Auto-Diagramming
GNU General Public License v2.0
524 stars 114 forks source link

Feature Request: Specify hostname to IP instead of relying on "CDP ne IP" #60

Closed Coleslaw3557 closed 4 years ago

Coleslaw3557 commented 4 years ago

During discovery, the IP address of the next host is learned using the CDP or LLDP neighbor IP advertisement. This is a problem in the Cisco world as "source cdp interface" does not exist on the majority of platforms; thus the lowest interface IP is used. In large environments this IP is very likely not accessible from a management station as most environments will have a management address set.

Since there seems to be no reliable way to set the advertised "source IP" in CDP/LLDP updates on the Cisco platform, it would be incredibly helpful for Natlas to reference the system's /etc/hosts file before the advertised address.

Any pointers on how to accomplish this?

Thanks,

Coleslaw3557 commented 4 years ago

I was able to set myself up with a work around by editing natlas/nodes.py and changing the following line:

link.remote_ip = rip

to

link.remote_ip = val.prettyPrint()

This causes the host names to be looked up via DNS or system host file.