Commands For Static Route

8.2 Commands for Static Route

8.2.1 ip route

Command: ip route {<ip-prefix> <mask> | <ip-prefix/prefix-length>} {<gateway-address> | <gateway-interface>} [<distance>] no ip route {<ip-prefix> <mask> | <ip-prefix>/<prefix-length>} [<gateway-address> | <gatewayinterface>][<distance>] Function: Configure the static route. The no command deletes the static route.
Parameters:

  • <ip-prefix> <mask>: destination IP address and subnet mask, shown in dotted decimal notation.
  • <ip-prefix/prefix-length>: destination IP address and the length of the prefix.
  • <gateway-address>: the next-hop IP address shown in dotted decimal notation.
  • <gateway-interface>: the next-hop interface.
  • <distance>: the route management distance, ranging between 1-255.

Command mode: Global Mode
Default: The management distance of static routing is defaulted to 1.
Usage guide: When configuring the static routing next-hop, specify the next-hop IP address of the route data packet and the exit interface. The default distance values of each route type in the Layer 3 active500EM are listed below:

Route Type Distance Value
Direct Route 0
Static Route 1
OSPF 110
RIP 120
IBGP 200
EBGP 20

The direct route has the highest priority when each route management distance value remains unchanged and followed by a static, EBGP, OSPF, RIP, or IBGP route.
Examples: Add a static route.

active500EM(config)#ip route 1.1.1.0 255.255.255.0 2.1.1.1

Add default route

active500EM(config)#ip route 0.0.0.0 0.0.0.0 2.2.2.1

 

8.2.2 show ip route

Command: show ip route [<destination>|<destination/length>|connected | static | rip| ospf | bgp | isis| kernel| statistics| database [connected | static | rip| ospf | bgp | isis| kernel] ] Function: Show the route table.
Parameters:

  • <destination>: the destination network address.
  • <destination/length>: the destination network address plus the length of prefix .
  • connected: direct route.
  • static: static route.
  • rip: RIP route.
  • ospf: OSPF route.
  • bgp: BGP route.
  • isis: ISIS route.
  • kernel: kernel route.
  • statistics: shows the number of routes.
  • database: route database.

Command mode: All Modes
Default: None.
Usage guide: Shows the contents in the routing table including: route type, destination network, mask, next-hop address, and interface.
Example: Show the route table for the active500EM.

active500EM#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
   O - OSPF, IA - OSPF inter area
   N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
   E1 - OSPF external type 1, E2 - OSPF external type 2
   i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
   * - candidate default
Gateway of last resort is 210.0.0.3 to network 0.0.0.0
S*     0.0.0.0/0 [1/0] via 210.0.0.3, Vlan1
C      127.0.0.0/8 is directly connected, Loopback
O IA   172.16.11.0/24 [110/40] via 210.14.0.1, Vlan3014, 00:00:47
O IA   172.16.12.0/24 [110/40] via 210.14.0.1, Vlan3014, 00:00:47
O IA   172.16.13.0/24 [110/40] via 210.14.0.1, Vlan3014, 00:00:47
O IA   172.16.14.0/24 [110/40] via 210.14.0.1, Vlan3014, 00:00:47
O IA   172.16.15.0/24 [110/50] via 210.14.0.1, Vlan3014, 00:00:47
O E2   172.16.100.0/24 [110/0] via 210.14.0.1, Vlan3014, 00:00:46
Displayed information Explanation
C ?connected Direct route, namely the segment directly connected with the layer 3 switch
S ?static Static route, the route manually configured by users
R – RIP derived RIP route, acquired by layer 3 switch through the RIP protocol
O – OSPF derived OSPF route, acquired by layer 3 switch through the OSPF protocol
A- OSPF ASE Route introduced by OSPF
B- BGP derived BGP route, acquired by the BGP protocol
Destination Target network
Mask Target network mask
Nexthop Next-hop IP address
Interface Next-hop pass-by Layer 3 switch interfaces
Preference Route priority. If other types of route to the target network exists, the kernel route will only show those with high priority

 

8.2.3 show ip route fib

Command: show ip route fib [statistics| vrf ] Function: To display all forwarding information base (FIB) information.
Parameters:

  • statistics: Routing table statistics
  • vrf: Virtual routing forwarder

Command mode: Admin Mode and other Configuration Mode
Default: Disable.
Usage Guide: This command is used to display forwarding information for all the routes
Example: Shows all forwarding information base statistics.

active500EM#show ip route fib statistics
        Total routes are : 1 item(s)
        Total unspec routes are : 0 item(s)
        Total boot routes are : 0 item(s)
        Total kernel routes are : 1 item(s)
        Total connected routes are : 0 item(s)
        Total static routes are : 0 item(s)
        Total rip routes are : 0 item(s)
        Total bgp routes are : 0 item(s)
        Total ospf routes are : 0 item(s)
        Total ospf external routes are : 0 item(s)
        Total dvmrp routes are : 0 item(s)
        Total unknown routes are : 0 item(s)

 


Return to Controller Wired CLI Table of Contents