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/MIP destination with short prefix (e.g. 10.0.0.0/8)
A.B.C.DIP destination with long prefix (e.g. 10.0.0.0 255.0.0.0)
After specifying the destination, choose the following parameters:
INTERFACEThe name of the interface to use as next-hop
A.B.C.DThe IP address to use as next-hop
Null0The 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.
blackholeIt is used silently to discard unwanted or undesirable traffic
rejectCreate 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-vrfAllows to create a leaked route with a nexthop in the specified vrf
tagSet tag for this route. It is a 32-bit value attached to routes. Route tags are used to filter routes and apply administrative policies
onlinkWhen both
INTERFACEandA.B.C.Dare 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 network192.168.2.0/30via theif3and GW does not belong to the connected network on the interface if3, you should specify the commandip 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
summaryshows the total number of routes. There are two planes in the architecture of the router: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
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.