-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IOS-XE] show ip bgp {address_family} all neighbors {neighbor} received-routes not retreiving prefix without CIDR #878
Comments
Hello @nouser5, Kindly provide the complete raw output for this command as well as kindly share the more light on CIDR notation. Also, it would be great if you can highlight the actual scenario and what should be the ideal scenario. Thank you. |
'show ip bgp vpnv4 all neighbors 10.82.15.252 received-routes' 2024-08-19 09:49:09,443: %UNICON-INFO: +++ temp_git with via 'cli': executing command 'show ip bgp vpnv4 all neighbors 10.82.15.252 received-routes' +++
Route Distinguisher: {RD} (default for vrf WAN_VRF)
Total number of prefixes 3 2024-08-19 09:49:09,834: %UNICON-INFO: +++ temp_git with via 'cli': executing command 'show bgp all neighbors | i BGP neighbor' +++ pprint.pprint(received_routes) As you can see in the received_routes output, the 0.0.0.0 route isn't present. The ideal scenario would be to have this route in the output displayed as 0.0.0.0/0. This scenario occurs for other routes such as 10.0.0.0 which would need to be 10.0.0.0/8 CIDR notation represents an IP address and a suffix that indicates network identifier bits in a specified format. For example, you could express 192.168. 1.0 with a 22-bit network identifier as 192.168. 1.0/22. |
Hello, I understand that first scenario to display |
This is based on IP Classes: https://www.tecmint.com/network-ip-addressing-range/ 10.0.0.0 falls within Class A (1-126) and thus needs a mask of 10.0.0.0/8 I get that adding information that wasn't really parsed isn't great. At least parsing the routes without CIDR and putting them in the output would allow for correcting this outside of the parser |
Hello @nouser5 , I have checked with team as now we are not handling with CIDR.
|
Above changes are merged and changes will reflect you from next pyats version. |
Some prefix in the output may not contain CIDR notation, these are not retrieved by the parser:
0.0.0.0 {neighbor} 0 {path} i
10.0.0.0 {neighbor} 0 {path} i
10.50.1.0/26 {neighbor} 0 {path} ?
10.50.2.0/26 {neighbor} 0 {path} ?
10.64.0.0/16 {neighbor} 0 {path} i
command = "show ip bgp vpnv4 all neighbors {neighbor} received-routes"
received_routes = device.parse(command)
prefixes=received_routes["vrf"]["default"]["neighbor"][neighbor]["address_family"]["vpnv4 RD {rd}"]["received_routes"]
if "0.0.0.0" in prefixes:
... print("parsed")
...
if "0.0.0.0/0" in prefixes:
... print("parsed")
...
if "10.64.0.0/16" in prefixes:
... print("parsed")
...
parsed
The text was updated successfully, but these errors were encountered: