03-16-2024 01:02 AM
Hi All,
I'm trying to pull all interfaces with IPs and subnet masks together, is there anyway we could do that from command line?
e.g. show ip int bri | exclude assi gives me list of interfaces and IPs, but I need to pull subnet mask aganist each IP/Interfaces.
Thanks
Solved! Go to Solution.
03-16-2024 01:25 AM
03-17-2024 04:20 PM - edited 03-17-2024 04:20 PM
For NXOS you will have to use regular regex. For example:
show run | include "(ip address|interface)"
03-16-2024 01:25 AM
show ip interface | in line | add
03-16-2024 03:01 AM
If one of the output suggested not works for you, then you need to use some kind of Python script to pull the information and join back what you looking to report.
there are many example available in git have a look.
03-17-2024 12:54 AM
Hello,
you could also use:
Router#sh run | include interface | ip address
interface GigabitEthernet0/0
ip address 1.1.1.1 255.255.255.0
interface GigabitEthernet0/1
ip address 2.2.2.1 255.255.255.0
03-17-2024 07:21 AM
Thank you so much, this is really beautiful commands,
love Cisco community support!
03-17-2024 03:56 PM
Hi,
This commend doesn't work on NXOS: version 9.3
show run | include interface | include ip address
^
show running-config interface | include address (this command is working fine but it only pull ip with mask, which is good, but not interfaces name)
show run | include interface (this command only brings interfaces not not ips and mask)
show run | include interface | include ip address
^
% Invalid command at '^' marker.
Any suggestions will be apprecaited
Thanks
03-17-2024 04:20 PM - edited 03-17-2024 04:20 PM
For NXOS you will have to use regular regex. For example:
show run | include "(ip address|interface)"
03-17-2024 04:23 PM
Perfectly worked! Thank you
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide