02-05-2015 06:46 AM - edited 03-05-2019 12:43 AM
Does anyone know of a tool that will reformat a cut+paste of a bgp forwarding table correctly. Maybe an excel sheet with formula embedded or something similar that will create a single line per subnet route.
I'm trying to compare 3 VRF routing tables to find duplicates. The largest is 80,000 lines.
Due to the CLI column widths on the output of 'sh ip bgp' the longer subnets cause a line break in the output. This means when I come to cut and paste into excel and then try and use the 'Text to columns' tool it does not work correctly. If I copy to Word or notepad first I have hundreds of lines to manually edit.
Surely other people out there have hit this frustrating problem ? Previously I've just bitten the bullet and fixed the formatting manually but these large routing tables will take too long to fix and possible introduce errors in the process.
Any advice ?
Thanks
02-05-2015 09:41 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
What you might be able to do is inform your telnet emulator to use a wider line, wide enough to take your bgp table without wrapping lines.
I run my emulator at 120 characters, which precludes much line wrapping vs. the common 80.
10-26-2022 04:03 AM
What you mean is this, right?
Instead of looking like:
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 10.254.254.1:32777 (L2VNI 55555)
*>l[2]:[0]:[0]:[48]:[0050.7966.6804]:[0]:[0.0.0.0]/216
10.253.253.1 100 32768 i
*>i[2]:[0]:[0]:[48]:[0050.7966.6805]:[0]:[0.0.0.0]/216
10.253.253.2 100 0 i
it would be nice to have it like this:
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup, 2 - best2
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 10.254.254.1:32777 (L2VNI 55555)
*>l[2]:[0]:[0]:[48]:[0050.7966.6804]:[0]:[0.0.0.0]/216 10.253.253.1 100 32768 i
*>i[2]:[0]:[0]:[48]:[0050.7966.6805]:[0]:[0.0.0.0]/216 10.253.253.2 100 0 i
I would love to see that, too.
05-22-2023 05:16 AM
Hello Folks,
A few options and some ideas I have used in the past to address this issue:
Option 1. You can try the programmatic method, export to a file and proceed to use a script(to be written) to format the data.
Option 2. Export the output of the data using xml, then use Excel to import the data into a worksheet. This has worked well for me in NXOS. Not sure if IOS supports this option.
The command output for <sh vlan> import in Excel looks like this:
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