show ip route
Use this command to display the IP routing table for a protocol or from a particular table.
When multiple entries are available for the same prefix, NSM uses an internal route selection mechanism based on protocol administrative distance and metric values to choose the best route. All best routes are entered into the FIB and can be viewed using this command. To display all routes (selected and not selected), use the show ip route database command.
Use this command to see all subnets of a specified network if they are present in the routing table. Use this command with mask information.
Command Syntax
show ip route A.B.C.D
show ip route (database|)
show ip route (database|) (bgp|connected|database|isis|fast-reroute|interface|isis|kernel|mbgp|mstatic|next-hop|ospf|rip|static)
show ip route summary
show ip route vrf all summary
show ip route vrf WORD (database|)
show ip route vrf WORD (database|) (bgp|connected|isis|kernel|ospf|rip|static|summary)
show ip route mpls (summary|)
Parameters
A.B.C.D
Network in the IP routing table.
A.B.C.D/M
IP prefix <network>/<length>, for example, 35.0.0.0/8.
bgp
Border Gateway Protocol
connected
Connected (directly attached) routes.
database
Routing table database.
fast-reroute
Fast reroute repair paths.
interface
Routes learned or tied to a specific interface.
isis
IS-IS routing-protocol routes.
kernel
Kernel (local OS) routes.
mbgp
Multiprotocol BGP (e.g., VPN or EVPN) routes.
mstatic
Multicast static routes.
next-hop
Routes based on a specific next-hop address.
ospf
Open Shortest Path First routing-protocol routes.
rip
Routing Information Protocol routing-protocol routes.
static
Static routes
summary
Summarize all routes
vrf WORD
Routes for a specific Virtual Routing and Forwarding (VRF) instance named WORD.
vrf all
Routes for all VRF instances.
mpls
Shows the routing table entries resolved through MPLS next-hops (NHLFE).
mpls summary
Shows the summary of MPLS-resolved routes in the routing table.
Default
None
Command Mode
Execution mode and Privileged execution mode
Applicability
Introduced before OcNOS version 1.3.
Added mpls summary parameter and Total number of IPv4 routes (All VRFs) field in the show ip route vrf all summary command in the OcNOS version 7.0.0.
Example
Displays all routes in the IP routing table database.
The recursive via MPLS FTN-ID <ID>, nhlfe-ix <INDEX> field specifies the MPLS next-hop used for recursive resolution.
OcNOS#show ip route database
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
> - selected route, * - FIB route, p - stale info
IP Route Table for VRF "default"
C *> 1.1.1.1/32 is directly connected, lo, installed 00:04:51, last update 00:04:51 ago
O 1.1.1.1/32 [110/1] is directly connected, lo, installed 00:04:51, last update 00:04:51 ago
C *> 1.2.0.0/24 is directly connected, xe5, installed 00:04:51, last update 00:04:51 ago
O 1.2.0.0/24 [110/1] is directly connected, xe5, installed 00:04:51, last update 00:04:51 ago
O *> 2.2.2.2/32 [110/2] via 1.2.0.2, xe5, installed 00:04:24, last update 00:04:24 ago
B *> 9.9.9.9/32 [20/0] via 2.2.2.2 (recursive via 1.2.0.2), installed 00:02:51, last update 00:02:51 ago
*> [20/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1)
B *> 10.10.10.10/32 [20/0] via 2.2.2.2 (recursive via 1.2.0.2), installed 00:02:51, last update 00:02:51 ago
*> [20/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1)
S *> 11.11.11.11/32 [1/0] via 2.2.2.2 (recursive via 1.2.0.2), installed 00:04:24, last update 00:04:51 ago
*> [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1)
S *> 12.12.12.12/32 [1/0] via 2.2.2.2 (recursive via 1.2.0.2), installed 00:04:24, last update 00:04:51 ago
*> [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1)
S *> 13.13.13.13/32 [1/0] via 2.2.2.2 (recursive via 1.2.0.2), installed 00:04:24, last update 00:04:51 ago
*> [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1)
C *> 127.0.0.0/8 is directly connected, lo, installed 00:05:45, last update 00:20:53 ago
Total number of IPv4 routes 16
Gateway of last resort is not set
OcNOS#show ip route mpls
IP Route Table for VRF "default"
B 9.9.9.9/32 [20/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1), installed 00:02:22, last update 00:02:22 ago
B 10.10.10.10/32 [20/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1), installed 00:02:22, last update 00:02:22 ago
S 11.11.11.11/32 [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1), installed 00:03:55, last update 00:04:22 ago
S 12.12.12.12/32 [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1), installed 00:03:55, last update 00:04:22 ago
S 13.13.13.13/32 [1/0] via 2.2.2.2 (recursive via MPLS FTN-ID 1, nhlfe-ix 1), installed 00:03:55, last update 00:04:22 ago
Gateway of last resort is not set
The Total number of routes nhlfe field shows all recursive routes resolved via MPLS next-hops.
The FIB count field confirms how many MPLS-resolved routes are installed in hardware forwarding tables.
OcNOS#show ip route mpls summary
-----------------------------------------------
IP routing table name is Default-IP-Routing-Table(0)
-----------------------------------------------
MPLS maximum-paths : 1
Total number of IPv4 MPLS routes : 5
Total number of routes nhlfe : 5
Pending routes (due to route max reached): 0
Route Source Networks
static 3
bgp 2
Total 5
FIB 5
Here are the explanations for the show command output fields.
| Field | Description |
|---|---|
| MPLS maximum-paths | Maximum number of ECMP paths supported for MPLS recursive routes. |
| Total number of IPv4 MPLS routes | Total IPv4 routes using MPLS recursive resolution. |
| Total number of routes nhlfe | Total routes resolved through MPLS next-hops (NHLFE). |
| Pending routes | Routes awaiting installation due to resource or configuration limits. |
| Route Source | Distribution of routes by protocol (static, BGP, etc.). |
| FIB | Number of MPLS-resolved routes installed in hardware forwarding tables. |
OcNOS#show ip route vrf all summary
-----------------------------------------------
IP routing table name is Default-IP-Routing-Table(0)
-----------------------------------------------
IP routing table maximum-paths : 8
Total number of IPv4 routes : 1
Total number of IPv4 paths : 1
Pending routes (due to route max reached): 0
Route Source Networks
connected 1
Total 1
FIB 1
ECMP statistics (active in ASIC):
Total number of IPv4 ECMP routes : 0
Total number of IPv4 ECMP paths : 0
-----------------------------------------------
IP routing table name is management(1)
-----------------------------------------------
IP routing table maximum-paths : 8
Total number of IPv4 routes : 2
Total number of IPv4 paths : 2
Pending routes (due to route max reached): 0
Route Source Networks
connected 2
Total 2
FIB 2
ECMP statistics (active in ASIC):
Total number of IPv4 ECMP routes : 0
Total number of IPv4 ECMP paths : 0
-----------------------------------------------
IP routing table name is red(2)
-----------------------------------------------
IP routing table maximum-paths : 8
Total number of IPv4 routes : 2
Total number of IPv4 paths : 2
Pending routes (due to route max reached): 0
Route Source Networks
connected 2
Total 2
FIB 2
ECMP statistics (active in ASIC):
Total number of IPv4 ECMP routes : 0
Total number of IPv4 ECMP paths : 0
VRF FIB Route Limits:
Configured Route Limit : 1000
Utilization Percentage : 0 %
Action upon reaching limit: stop-install
Warning Threshold : 80 %
Exceeds Threshold : No
Total number of IPv4 routes (All VRFs) : 5