Skip to main content
added 220 characters in body
Source Link

If you wantedwant to get information about interface IPs from switches/ routers information about its IPs in a format similar to a host file you may use my bash script. I wanted to have actual information about all IP addresses of network devices in our network. All devices are reachable through SNMP. I was not able to find a tool or script that can do it so I decided to write it myself. Output can be simple add to the host file. Interface description or a prefix is written as a comment so it will be shown for example in traceroute output while you can search the host file for interface description.

Output is in this format:

A.B.C.D Device_hostname-Interface_name #/Prefix #Interface description

10.1.1.1 router_R01-Gi1/0/2 #28

10.5.1.22 Beijing-router01-WAN-Tu611 #24 # Port to internet

192.168.24.254 firewall2-eth5 #24

The script is available from http://network-linux.webnode.cz/news/bash-script-for-gathering-ip-addresses-of-interfaces-through-snmp.

If you wanted to get from switches/ routers information about its IPs in a format similar to a host file you may use my bash script. I wanted to have actual information about all IP addresses of network devices in our network. All devices are reachable through SNMP. I was not able to find a tool or script that can do it so I decided to write it myself.

Output is in this format:

A.B.C.D Device_hostname-Interface_name #/Prefix #Interface description

10.1.1.1 router_R01-Gi1/0/2 #28

10.5.1.22 Beijing-router01-WAN-Tu611 #24 # Port to internet

192.168.24.254 firewall2-eth5 #24

The script is available from http://network-linux.webnode.cz/news/bash-script-for-gathering-ip-addresses-of-interfaces-through-snmp.

If you want to get information about interface IPs from switches/ routers in a format similar to a host file you may use my bash script. I wanted to have actual information about all IP addresses of network devices in our network. All devices are reachable through SNMP. I was not able to find a tool or script that can do it so I decided to write it myself. Output can be simple add to the host file. Interface description or a prefix is written as a comment so it will be shown for example in traceroute output while you can search the host file for interface description.

Output is in this format:

A.B.C.D Device_hostname-Interface_name #/Prefix #Interface description

10.1.1.1 router_R01-Gi1/0/2 #28

10.5.1.22 Beijing-router01-WAN-Tu611 #24 # Port to internet

192.168.24.254 firewall2-eth5 #24

The script is available from http://network-linux.webnode.cz/news/bash-script-for-gathering-ip-addresses-of-interfaces-through-snmp.

Source Link

If you wanted to get from switches/ routers information about its IPs in a format similar to a host file you may use my bash script. I wanted to have actual information about all IP addresses of network devices in our network. All devices are reachable through SNMP. I was not able to find a tool or script that can do it so I decided to write it myself.

Output is in this format:

A.B.C.D Device_hostname-Interface_name #/Prefix #Interface description

10.1.1.1 router_R01-Gi1/0/2 #28

10.5.1.22 Beijing-router01-WAN-Tu611 #24 # Port to internet

192.168.24.254 firewall2-eth5 #24

The script is available from http://network-linux.webnode.cz/news/bash-script-for-gathering-ip-addresses-of-interfaces-through-snmp.