- Table of Contents
-
- 06-Layer 3 - IP Routing Command Reference
- 00-Preface
- 01-Basic IP routing commands
- 02-Static routing commands
- 03-RIP commands
- 04-OSPF commands
- 05-IS-IS commands
- 06-BGP commands
- 07-Policy-based routing commands
- 08-IPv6 static routing commands
- 09-RIPng commands
- 10-OSPFv3 commands
- 11-IPv6 IS-IS commands
- 12-IPv6 policy-based routing commands
- 13-Routing policy commands
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Static routing commands | 74.43 KB |
delete static-routes all
Use delete static-routes all to delete all static routes.
Syntax
delete [ vpn-instance vpn-instance-name ] static-routes all
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
vpn-instance vpn-instance-name: Specifies an MPLS L3VPN by its name, a case-sensitive string of 1 to 31 characters. Without this option, the command deletes all static routes for the public network.
Usage guidelines
When you use this command, the system will prompt you to confirm the operation before deleting all the static routes.
To delete one static route, use the undo ip route-static command. To delete all static routes, including the default route, use the delete static-routes all command.
Examples
# Delete all static routes.
<Sysname> system-view
[Sysname] delete static-routes all
This will erase all IPv4 static routes and their configurations, you must reconf
igure all static routes.
Are you sure?[Y/N]:y
Related commands
ip route-static
ip route-static
Use ip route-static to configure a static route.
Use undo ip route-static to delete a static route.
Syntax
ip route-static dest-address { mask | mask-length } { next-hop-address [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] | interface-type interface-number [ next-hop-address ] [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | bfd { control-packet | echo-packet } | permanent ] | vpn-instance d-vpn-instance-name next-hop-address [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] } [ preference preference-value ] [ tag tag-value ] [ description description-text ]
undo ip route-static dest-address { mask | mask-length } [ next-hop-address | interface-type interface-number [ next-hop-address ] | vpn-instance d-vpn-instance-name next-hop-address ] [ preference preference-value ]
ip route-static vpn-instance s-vpn-instance-name dest-address { mask | mask-length } { next-hop-address [ public ] [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] | interface-type interface-number [ next-hop-address ] [ backup-interface interface-type interface-number [ backup-nexthop backup-nexthop-address ] [ permanent ] | bfd { control-packet | echo-packet } | permanent ] | vpn-instance d-vpn-instance-name next-hop-address [ bfd control-packet bfd-source ip-address | permanent | track track-entry-number ] } [ preference preference-value ] [ tag tag-value ] [ description description-text ]
undo ip route-static vpn-instance s-vpn-instance-name dest-address { mask | mask-length } [ next-hop-address [ public ] | interface-type interface-number [ next-hop-address ] | vpn-instance d-vpn-instance-name next-hop-address ] [ preference preference-value ]
Default
No static route is configured.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
vpn-instance s-vpn-instance-name: Specifies a source MPLS L3VPN by its name, a case-sensitive string of 1 to 31 characters. Each VPN has its own routing table, and the configured static route is installed in the routing tables of the specified VPNs.
dest-address: Specifies the destination IP address of the static route, in dotted decimal notation.
mask: Specifies the mask of the IP address, in dotted decimal notation.
mask-length: Specifies the mask length in the range of 0 to 32.
vpn-instance d-vpn-instance-name: Specifies a destination MPLS L3VPN by its name, a case-sensitive string of 1 to 31 characters. If a destination VPN is specified, packets will search for the output interface in the destination VPN based on the configured next hop address.
next-hop-address: Specifies the IP address of the next hop, in dotted decimal notation.
backup-interface interface-type interface-number: Specifies a backup output interface by its type and number. If the backup output interface is an NBMA interface or broadcast interface (such as an Ethernet interface, a virtual template interface, or a VLAN interface), rather than a P2P interface, you must specify the backup next hop address.
backup-nexthop backup-nexthop-address: Specifies a backup next hop address.
bfd: Enables BFD to detect reachability of the static route's next hop. When the next hop is unreachable, the system immediately switches to the backup route.
control-packet: Specifies the BFD control mode.
bfd-source ip-address: Specifies the source IP address of BFD packets. H3C recommends that you specify the loopback interface address.
permanent: Specifies the route as a permanent static route. If the output interface is down, the permanent static route is still active.
track track-entry-number: Associates the static route with a track entry specified by its number in the range of 1 to 1024. For more information about track, see High Availability Configuration Guide.
echo-packet: Specifies the BFD echo mode.
public: Indicates that the specified next hop address is on the public network.
interface-type interface-number: Specifies an output interface by its type and number. If the output interface is an NBMA interface or broadcast interface (such as an Ethernet interface, a virtual template interface, or a VLAN interface), rather than a P2P interface, the next hop address must be specified.
preference preference-value: Specifies a preference for the static route, in the range of 1 to 255. The default is 60.
tag tag-value: Sets a tag value for marking the static route, in the range of 1 to 4294967295. The default is 0. Tags of routes are used for route control in routing policies. For more information about routing policies, see Layer 3—IP Routing Configuration Guide.
description description-text: Configures a description for the static route, which comprises 1 to 60 characters, including special characters like the space, but excluding the question mark (?).
Usage 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 is used for forwarding a packet matching no entry in the routing table.
Implement different routing policies to configure different route preferences. For example, to enable load sharing for multiple routes to the same destination, assign the same preference to the routes; to enable them to back up one another, assign different preferences to them.
Follow these guidelines when you specify the output interface or the next hop address of the static route:
· If the output interface is a Null 0 interface, no next hop address is required.
· If the output interface is a point-to-point interface (such as a PPP serial interface), you can specify only the output interface. You do not need to change the configuration of the route even if the peer address is changed.
· If the output interface is an NBMA or P2MP interface (such as an X.25 or Frame Relay interface) that need IP address-to-link layer address mappings for successful packet delivery, H3C recommends specifying both the output interface and the next hop address for the route at the same time.
· If the output interface is a broadcast interface (such as an Ethernet interface or a VLAN interface) that might have multiple next hops, you must specify the output interface and the next hop address at the same time.
Follow these guidelines when you configure a static route:
· Enabling BFD for a flapping route could worsen the situation. Therefore, use it with caution. For more information about BFD, see High Availability Configuration Guide.
· If the track module uses NQA to detect the reachability of the private network static route's next hop, the VPN instance ID of the static route's next hop must be identical to that configured for the NQA operation.
· If a static route needs route recursion, the associated track entry must monitor the next hop of the recursive route instead of that of the static route. Otherwise, a valid route might be mistakenly considered invalid.
· Do not specify the permanent keyword together with the bfd or track keyword.
Examples
# Configure a static route, whose destination address is 1.1.1.1/24, next hop address is 2.2.2.2, tag value is 45, and description information is for internet.
<Sysname> system-view
[Sysname] ip route-static 1.1.1.1 24 2.2.2.2 tag 45 description for internet
Related commands
display ip routing-table protocol
ip route-static default-preference
Use ip route-static default-preference to configure a default preference for static routes.
Use undo ip route-static default-preference to restore the default.
Syntax
ip route-static default-preference default-preference-value
undo ip route-static default-preference
Default
The default preference of static routes is 60.
Views
System view
Predefined user roles
network-admin
mdc-admin
Parameters
default-preference-value: Specifies a default preference for static routes, in the range of 1 to 255.
Usage guidelines
If no preference is specified for a static route, the default preference applies.
When the default preference is reconfigured, it applies to only newly added static routes.
Examples
# Set a default preference of 120 for static routes.
<Sysname> system-view
[Sysname] ip route-static default-preference 120
Related commands
display ip routing-table protocol