Commit 311add2
authored
Add FRR failed route check in route_check.py (#4119)
What I did
It supports to detect the route with offload False or without offload, which can capture queued route, because queued route doesn’t have offload, but for rejected route, the offload is True. It can’t detect the rejected route.
So, we add a new detection check for the value of key failed for route entries, which can cover both rejected and queued routes.
It will help to detect rejected route and queued route on device.
How I did it
Append failed route prefix into failed list, if it's not empty, script will print error message into syslog
# Check for failed state
if entry.get('failed', False):
failed_rt.append(route_prefix)
How to verify it
For rejected route:
The output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16
Failure results: {{
"": {
"failed_FRR_routes": [
"0.0.0.0/0",
"192.168.128.0/25",
"192.168.128.128/25",
"192.168.136.0/25",
"192.168.136.128/25",
"192.168.144.0/25",
"192.168.144.128/25",
"192.168.152.0/25",
"192.168.152.128/25",
"192.168.160.0/25",
"192.168.160.128/25",
"192.168.168.0/25",
"192.168.168.128/25",
"192.168.176.0/25",
"192.168.176.128/25",
"192.168.184.0/25",
"192.168.184.128/25",
"192.168.192.0/25",
"192.168.192.128/25",
"192.168.200.0/25",
"192.168.200.128/25",
"192.168.208.0/25",
"192.168.208.128/25",
"192.168.216.0/25",
"192.168.216.128/25",
"192.168.224.0/25",
"192.168.224.128/25",
"192.168.232.0/25",
"192.168.232
Failed. Look at reported mismatches above
For rejected route:
the output of route_check.py
Some routes have failed state in FRR : ['0.0.0.0/0', '192.168.128.0/25', '192.168.128.128/25', '192.168.136.0/25', '192.168.136.128/25', '192.168.144.0/25', '192.168.144.128/25', '192.168.152.0/25', '192.168.152.128/25', '192.168.160.0/25', '192.168.160.128/25', '192.168.168.0/25', '192.168.168.128/25', '192.168.176.0/25', '192.168.176.128/25', '192.168.184.0/25', '192.168.184.128/25', '192.168.192.0/25', '192.168.192.128/25', '192.168.200.0/25', '192.168.200.128/25', '192.168.208.0/25', '192.168.208.128/25', '192.168.216.0/25', '192.168.216.128/25', '192.168.224.0/25', '192.168.224.128/25', '192.168.232.0/25', '192.168.232.128/25', '192.168.240.0/25', '192.168.240.128/25', '192.168.248.0/25', '192.168.248.128/25', '192.169.0.0/25', '192.169.0.128/25', '192.169.104.0/25', '192.169.104.128/25', '192.169.112.0/25', '192.169.112.128/25', '192.169.120.0/25', '192.169.120.128/25', '192.169.128.0/25', '192.169.128.128/25', '192.169.136.0/25', '192.169.136.128/25', '192.169.144.0/25', '192.16
Failure results: {{
"": {
"missed_FRR_routes": [
{
"destSelected": true,
"distance": 20,
"failed": true,
"installedNexthopGroupId": 39146,
"internalFlags": 8,
"internalNextHopActiveNum": 4,
"internalNextHopNum": 4,
"internalStatus": 168,
"metric": 0,
"nexthopGroupId": 39146,
"nexthops": [
{
"active": true,
"afi": "ipv4",
"fib": true,
"flags": 3,
"interfaceIndex": 6,
"interfaceName": "PortChannel102",
"ip": "10.0.0.1",
"rmapSource": "10.1.0.32",
"weight": 1
},
{
"active": true,
Failed. Look at reported mismatches above1 parent 0282c25 commit 311add2
2 files changed
+367
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
| 679 | + | |
679 | 680 | | |
680 | 681 | | |
681 | | - | |
| 682 | + | |
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
| |||
695 | 696 | | |
696 | 697 | | |
697 | 698 | | |
698 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
699 | 703 | | |
700 | 704 | | |
701 | 705 | | |
702 | | - | |
703 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
704 | 709 | | |
705 | 710 | | |
706 | 711 | | |
| |||
837 | 842 | | |
838 | 843 | | |
839 | 844 | | |
| 845 | + | |
840 | 846 | | |
841 | 847 | | |
842 | 848 | | |
| |||
890 | 896 | | |
891 | 897 | | |
892 | 898 | | |
893 | | - | |
| 899 | + | |
894 | 900 | | |
895 | 901 | | |
896 | 902 | | |
897 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
898 | 907 | | |
899 | 908 | | |
900 | 909 | | |
901 | 910 | | |
902 | 911 | | |
903 | 912 | | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
904 | 916 | | |
905 | 917 | | |
906 | 918 | | |
| |||
0 commit comments