Configuring Static Routes


vRouters forward packets using either routing information from manually configured route tables or routing information calculated using dynamic routing algorithms.


Static routes define explicit paths between two vRouters and are not automatically updated. When network changes occur, you have to reconfigure static routes. Static routes use less bandwidth than dynamic routes.

 

 


Figure 5-2 Configuring a Static Route

 

In this example, you configure a static route on vRouter1 by using the command vrouter-static-route-add.


CLI (network-admin@switch) > vrouter-static-route-add


vrouter-name name-string

Specify the name of the vRouter service.

network ip-address

Specify the IP subnet of the network that you want to add a static route.

netmask netmask

Specify the netmask of the IP subnet.

gateway-ip ip-address

Specify the IP address of the gateway that you want to route packets destined for the network IP address to.

drop

Specify to drop traffic matching this route.


Note: This option is mutually exclusive with gateway-ip parameter.

bfd-dst-ip ip-address

Specify the destination IP address for BFD monitoring.

distance number

Specify the administrative distance as a number between 0 and 255.


  • 0  — Connected interface
  • 1 — Static route
  • 110 — OSPF
  • 120 — RIP
  • 200 — Internal BGP

interface vrouter-interface-nic

Specify the vRouter interface for the static route, if the gateway-ip is a link-local IPv6 address.

vrf vrf

Specify the name of the VRF.


To create a static route on vRouter1 for the network 172.16.10.10/24 with a gateway IP address of 172.16.20.1, use the command:


CLI (network-admin@switch) > vrouter-static-route-add vrouter-name vRouter1 network 172.16.10.10/24 gateway-ip 172.16.20.1


To modify the configuration, use the command vrouter-static-route-modify.


CLI (network-admin@switch) > vrouter-static-route-modify vrouter-name vRouter1 network 172.16.10.10/24 gateway-ip 172.16.20.1 distance 20


Note: The administrative distance is the only parameter that can be modified using the vrouter-static-route-modify command. You must supply other parameters including network and gateway-ip correctly to make the modification.


To view the details of the configuration, use the command:


CLI (network-admin@switch) > vrouter-static-route-show


switch    vrouter-name network        gateway-ip  bfd-dst-ip distance interface vrf 

--------- ------------ -------------- ----------- ---------- -------- --------- ---

switch1   vRouter1     172.16.10.0/24 172.16.20.1 ::         20                     


To remove the static route, use the command vrouter-static-route-remove. For example:


CLI (network-admin@switch) > vrouter-static-route-remove vrouter-name vRouter1 network 172.16.10.10/24


Adding IPv6 Link-Local Addresses for Static Routing


IPv6 link-local addresses have a specific prefix fe80::/10 and are relevant only on the local link. This makes it possible to have the same link-local address on multiple IPv6 interfaces. If you add a static route reachable through a link-local address, you must specify the outgoing interface.


For example, use the command below to specify the interface for a static route with an IPv6 link-local address as gateway-ip:


CLI (network-admin@switch) > vrouter-static-route-add vrouter-name vr1 network 6666::/64 gateway-ip fe80::640e:94ff:fe6f:8521 interface eth0.4092


To view the details, use the command:


CLI (network-admin@switch) > vrouter-static-route-show


switch vrouter-name network   gateway-ip                bfd-dst-ip distance interface

------ ------------ --------- ------------------------- ---------- -------- ---------

Leaf1   vr1         6666::/64 fe80::640e:94ff:fe6f:8521   ::         1       eth0.4092


 

north
    keyboard_arrow_up
    keyboard_arrow_down
    description
    print
    feedback
    support
    business
    rss_feed
    south