17

In Junos when you use a show route it displays the routing tables , starting with inet.0 ( global routing table) and then listing each VRF in alphabetic order.

I am after a similar command , for the following reason , new WAN deployment: remote engineer to verify VRF connectivity without plugging in the LAN, therefore I want to list the mandatory routes that are mandatory in each VRF ( e.g. 0/0 ).

I know I can achieve this with show ip bgp vpnv4 all but this does not display the global routing table , and that is currently used for management.

in Junos I would run show route 0/0 which would display all occurrences of the specified route in every VRF across the device including inet.0

iank@r1> show route 0/0 exact terse 

vrf1.inet.0: 99 destinations, 105 routes (99 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop        AS path
* 0.0.0.0/0          B 170        100          0 >172.31.30.2     64512 I

vrf2.inet.0: 362 destinations, 408 routes (362 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop        AS path
* 0.0.0.0/0          B 170        100            >172.31.7.2      64999 I

vrf3.inet.0: 658 destinations, 711 routes (658 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop        AS path
* 0.0.0.0/0          B 170        100            >172.31.12.2     64999 I

vrf4.inet.0: 377 destinations, 423 routes (377 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

A Destination        P Prf   Metric 1   Metric 2  Next hop        AS path
* 0.0.0.0/0          B 170        100            >172.31.3.2      64999 I

am I missing a really obvious way of achieving this ?

2 Answers 2

16

show ip route vrf * displays the global routing table plus all the VRF instances.

sh ip route vrf * 0.0.0.0 displays the default route for each VRF.

This shows the default route for each VRF, including the default VRF. As this IOS 12.4 doesn't show the VRF name when displaying a matching route, a route tag was added on the static routes to help identify their VRF.

r1#show ip route vrf * 0.0.0.0

Routing entry for 0.0.0.0/0, supernet
  Known via "static", distance 1, metric 0, candidate default path
  Tag 100
  Routing Descriptor Blocks:
  * 192.0.2.2
      Route metric is 0, traffic share count is 1
      Route tag 100

Routing entry for 0.0.0.0/0, supernet
  Known via "static", distance 1, metric 0, candidate default path
  Tag 200
  Routing Descriptor Blocks:
  * 192.0.2.2
      Route metric is 0, traffic share count is 1
      Route tag 200

Showing longer-prefixes on your matching route will show the VRF names. `sh ip route vrf * 192.0.2.0 longer-prefixes'.

1
  • in 12.2(33)SRD and 15.1(2)T VRF name is shown with the route, except 'Default' is omitted. Not sure exactly when it was added, but I'd guess 12.2(33)SRA (about 8 years ago).
    – ytti
    Jul 5, 2013 at 7:51
3

show ip route for the IPv4 FIB.

show ipv6 route for the IPv6 FIB.

VRF routes:

show <ip/ipv6> route vrf <*/vrfName>

of course, * shows all VRFs.

2
  • "show ip route" does not actually display any VRF routes
    – DrBru
    Jul 4, 2013 at 22:46
  • ah, he wants VRF routes. I'll update it.
    – Olipro
    Jul 4, 2013 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.