This article describes how to configure or delete a static route and how to configure a static route.
Configure or delete a static route.
[No] ip route ip-address
{Mask | mask-length} {interfacce-name
| Gateway-address} [preference-value] [reject | blackhole]
Parameter description]
Ip-address and mask are destination ip addresses and masks, which are in decimal format. Because '1' in 32-bit masks must be continuous, therefore, the mask in dotted-decimal format can be replaced by the mask length mask-length. The mask length is the number of consecutive '1' bits in the mask.
Interfacce-name specifies the sending Interface name of the route, and gateway-address indicates the next hop IP address of the route in decimal format ).
Preference-value indicates the priority of the route. The value ranges from 0 ~ 255.
Reject indicates that the route is not accessible.
Blackhole indicates a black hole route.
Default condition]
By default, the system can obtain the subnet route to the subnet connected to the router. If priority is not specified When configuring static routing, the default value is 60. If reject or blackhole is not specified, the default value is reachable.
Command mode]
Global Configuration Mode
User Guide]
Note:
When the destination IP address and mask are both 0.0.0.0, the default route is configured. That is, when the route table fails to be searched, packets are forwarded based on the default route.
You can flexibly apply Routing Management Policies for different configurations of priorities. For example, if multiple routes are configured to reach the same destination, load balancing can be implemented if the same priority is specified. If different priorities are specified, you can back up routes.
When configuring static routes, you can specify both the sending interface and the next hop address. which method is used depends on the actual situation: for interfaces or point-to-point interfaces that support network address resolution from the link layer to the link layer, you can specify the sending interface. For NBMA interfaces, such as interfaces that encapsulate X.25 or frame relay and dial-up ports, point-to-point interfaces are supported, in this case, in addition to configuring IP routing, you also need to establish a secondary route on the link layer, that is, the ing between the IP address and the link layer address, such as dialer
Map ip, x.25 map ip, or frame-relay map ip? The sending interface cannot be specified when configuring static routes. The next hop IP address should be configured.
Example]
Configure the next hop of the default route to 129.102.0.2.
Quidway (config) # ip route 0.0.0.0 0.0.0.0 129.102.0.2
Related commands]
Show ip route, show ip route detail, show
Ip route static
Show ip
Route
Displays the route table Summary.
Show ip route
Command mode]
Privileged user mode
User Guide]
The command output displays the route table in a list. Each line represents a route, including:
Destination Address/Mask Length
Protocol
Priority
Metric Value
Next Hop
Output interface
Example]
Quidway # show ip route
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Static 0 0 127.0.0.1 127.0.0.1 (LO0)
127.0.0.1/32 Direct 0 0 127.0.0.1 127.0.0.1 (LO0)
138.102.128.0/17 Direct 0 0 138.102.129.7 138.102.129.7 (EN0)
202.38.165.0/24 Direct 0 0 202.38.165.1 202.38.165.1 (SL1)