ip route-static
Syntax
ip route-static dest-address { mask | mask-length } { next-hop-address | interface-type interface-number [ next-hop-address ] } [ preference preference-value ] [ description description-text ]
undo ip route-static dest-address { mask | mask-length } [ next-hop-address | interface-type interface-number [ next-hop-address ] ] [ preference preference-value ]
View
System view
Default level
2: System level
Parameters
dest-address: Destination IP address of the static route, in dotted decimal notation.
mask: Mast of the IP address, in dotted decimal notation.
mask-length: Mask length, in the range 0 to 32.
next-hop-address: IP address of the next hop, in dotted decimal notation.
interface-type interface-number: Specifies the output interface by its type and number. If the output interface is a broadcast interface, such as a VLAN interface, the next hop address must be specified.
preference preference-value : Specifies the preference of the static route, which is in the range of 1 to 255 and defaults to 60.
description description-text: Configures a description for the static route, which consists of 1 to 60 characters, including special characters like space, but excluding ?.
Description
Use the ip route-static command to configure a unicast static route.
Use the undo ip route-static command to delete a unicast static route.
When configuring a unicast static route, follow these guidelines:
If the destination IP address and the mask are both 0.0.0.0 (or 0), the configured route is a default route. The default route will be used for forwarding a packet if no route is available for the packet in the routing table.
Specify the output interface or the next hop address of the static route as needed. The next hop address cannot be the IP address of a local interface; otherwise, the route configuration will not take effect. If the output interface supports network address-to-link layer address resolution or is a point-to-point interface, you may specify only the interface or the next hop address.
If the output interface is a Null 0 interface, no next hop address is required.
If you specify a broadcast interface—such as a VLAN interface—as the output interface for a static route, you must specify the next hop of the interface at the same time.
Related commands: ip route-static default-preference and display ip routing-table.
NOTE: The static route does not take effect if you specify its next hop address first and then configure the address as the IP address of a local interface, such as VLAN interface. | ||
Examples
# Configure a static route, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2, and description information is for internet & intranet.
<Sysname> system-view [Sysname] ip route-static 1.1.1.1 24 2.2.2.2 description for internet & intranet