ip route

This command configures a static route in a specified virtual router instance (vrf vrf-name). The ipaddr parameter is a valid IP address, and subnetmask is a valid subnet mask. The nexthopip parameter is a valid IP address of the next hop router. Specifying Null0 as nexthop parameter adds a static reject route. The optional preferenceparameter is an integer value from 1 to 255) that allows you to specify the preference value sometimes called "administrative distance") of an individual static route. Among routes to the same destination, the route with the lowest preference value is the route entered into the forwarding database. By specifying the preference of a static route, you control whether a static route is more or less preferred than routes from dynamic routing protocols. The preference also controls whether a static route is more or less preferred than other static routes to the same destination. A route with a preference of 255 cannot be used to forward traffic.

The description parameter allows a description of the route to be entered.

Use the track object-number to specify that the static route is installed only if the configured track object is up. When the track object is down the static route is removed from the Route Table. Use the no form of this command to delete the tracked static route. The object-number parameter is the object number representing the object to be tracked. The range is from 1 to 128. Only one track object can be associated with a specific static route. If you configure a different track object, the previously configured track object is replaced by the newly configured track object. To display the IPv4 static routes that being tracked by track objects, use the show ip route track-table command.

For the static routes to be visible, you must perform the following steps:

Default preference-1
Format ip route [vrf vrf-name] ipaddr subnetmask { nexthopip | Null0 | interface {unit/slot/ port | vlan-id}} [preference] [description description] [track object-number]
Mode Global Config

Example:

Subnetwork 9.0.0.0/24 is a connected subnetwork in global table and subnet 56.6.6.0/24 is reachable via a gateway 9.0.0.2 in the global table.

Subnet S.0.0.0/24 is a connected subnetwork in virtual router Red.

Now we leak the 2 routes from global route table into the virtual router Red and leak the connected subnet S.0.0.0/24 from Red to global table.

When leaking connected route in the global routing table to a virtual router, the /32 host route for the leaked host is added in the virtual router instance's route table.

Also we add a non-leaked static route for 66.6.6.0/24 subnetwork scoped to the domain of virtual router Red below.

(Router) (Config)#ip routing
(Router) (Config)#ip vrf Red
(Router) (Config)#interface 0/27
(Router) (Interface 0/27)#routing
(Router) (Interface 0/27)#ip vrf forwarding Red
(Router) (Interface 0/27)#ip address 8.0.0.1 /24

(Router) (Interface 0/27)#interface 0/26
(Router) (Interface 0/26)#routing
(Router) (Interface 0/26)#ip address 9.0.0.1 /24
(Router) (Interface 0/26)#exit

(Router) (Config)#ip route 56.6.6.0 /24 9.0.0.2
Routes leaked from global routing table to VRF’s route table are :
(Router) (Config)#ip route vrf Red 9.0.0.2 255.255.255.255 9.0.0.2 0/26
(Router) (Config)#ip route vrf Red 56.6.6.0 255.255.255.0 9.0.0.2 0/26

Route leaked from VRF’s route table to global routing table is :
(Router) (Config)#ip route 8.0.0.2 255.255.255.255 0/27

Route (non-leaked) internal to VRF’s route table is :
(Router) (Config)#ip route vrf Red 66.6.6.0 255.255.255.0 8.0.0.2

www.lancom-systems.com

LANCOM Systems GmbH | A Rohde & Schwarz Company | Adenauerstr. 20/B2 | 52146 Wuerselen | Germany | E‑Mail info@lancom.de

LANCOM Logo