7.2. Static Routing

NFWare vCGNAT can be used as a router if NAT is not configured on interfaces. You can add static routes for your purposes, for example, to define a default route, for routing redistribution, etc. To configure the static route, use the command in configuration mode:

ip route

with the following keys:

Keys

Description

A.B.C.D/M

IP destination with short prefix (e.g. 10.0.0.0/8)

A.B.C.D

IP destination with long prefix (e.g. 10.0.0.0 255.0.0.0)

After specifying the destination, choose the following parameters:

INTERFACE

The name of the interface to use as next-hop

A.B.C.D

The IP address to use as next-hop

Null0

The purpose of configuring a static summary route to null0 is to ensure that traffic will be dropped on the local router if a more specific route does not exist.

blackhole

It is used silently to discard unwanted or undesirable traffic

reject

Create an unreachable route that rejects traffic with ICMP “Destination Unreachable” messages

After specifying the obligatory parameters, you can use additional keys:

(1-255)

Distance value for this route – is a metric used by routers to choose the best path. If you want the dynamic route to override the static one, specify this distance greater than for the dynamic route

nexthop-vrf

Allows to create a leaked route with a nexthop in the specified vrf

tag

Set tag for this route. It is a 32-bit value attached to routes. Route tags are used to filter routes and apply administrative policies

onlink

When both INTERFACE and A.B.C.D are specified, it binds the route to the specified interface. In this case, it is also possible to specify onlink to force the routing subsystem to consider the next-hop as “on link” on the given interface. For example, if you want to add a route to the network 192.168.2.0/30 via the if3 and GW does not belong to the connected network on the interface if3, you should specify the command ip route 192.168.2.0/30 1.1.1.1 if3 onlink

To add a static route in the specified VRF, first enter it via the command vrf NAME and then use ip route.

show <ip|ipv6> route fib [summary] [vrf NAME]

Display Forwarding Information Base table. If VRF is configured, you can specify its name. Specifying the key summary shows the total number of routes. There are two planes in the architecture of the router:

  1. RIB (Routing Information Base) – receives all routes from all routing protocols. Routes are assigned different Administrative Distances using special algorithms, and the route with the smallest Administrative Distance is considered the best and stored in FIB

  2. FIB (Forwarding Information Base) – is used for forwarding IP packets. Here, the route with the longest prefix matching the destination address in the IP packet is considered the best.

show <ip|ipv6> route

Display IP routing table.