06-Layer 3 - IP Routing Command Reference

HomeSupportRoutersH3C SR8800 Router SeriesReference GuidesCommand ReferencesH3C SR8800 Command Reference-Release3347-6W10306-Layer 3 - IP Routing Command Reference
02-Static Routing Commands
Title Size Download
02-Static Routing Commands 94.47 KB

delete static-routes all

Syntax

delete [ vpn-instance vpn-instance-name ] static-routes all

View

System view

Default level

2: System level

Parameters

vpn-instance vpn-instance-name: Specifies an MPLS L3VPN. vpn-instance-name is a case-sensitive string of 1 to 31 characters. If no VPN is specified, all static routes on the public network are deleted.

Description

Use the delete static-routes all command to delete all static routes.

When you use this command to delete static routes, the system will prompt you to confirm the operation before deleting all the static routes.

Related commands: display ip routing-table and ip route-static.

Examples

# Delete all static routes on the router.

<Sysname> system-view

[Sysname] delete static-routes all

This will erase all ipv4 static routes and their configurations, you must reconfigure all static routes

Are you sure?[Y/N]:Y

ip route-static

Syntax

ip route-static dest-address { mask | mask-length } { next-hop-address [ bfd control-packet [ bfd-source ip-address ] | track track-entry-number ] | interface-type interface-number [ next-hop-address ] [ bfd { control-packet [ bfd-source ip-address ] | echo-packet } ] | vpn-instance d-vpn-instance-name next-hop-address [ track track-entry-number ] } [ preference preference-value ] [ tag tag-value ] [ permanent ] [ 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&<1-6> dest-address { mask | mask-length } { next-hop-address [ public ] [ bfd control-packet [ bfd-source ip-address ] | track track-entry-number ] | interface-type interface-number [ next-hop-address ] [ bfd { control-packet [ bfd-source ip-address ] | echo-packet } ] | vpn-instance d-vpn-instance-name next-hop-address [ track track-entry-number ] } [ preference preference-value ] [ tag tag-value ] [ permanent ] [ description description-text ]

undo ip route-static vpn-instance s-vpn-instance-name&<1-6> 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 ]

View

System view

Default level

2: System level

Parameters

vpn-instance s-vpn-instance-name&<1-6>: Specifies a source MPLS L3VPN. s-vpn-instance-name is a case-sensitive string of 1 to 31 characters. &<1-6> indicates the argument before it can be entered up to 6 times. Each VPN has its own routing table, and the configured static route is installed in the routing tables of the specified VPNs.

dest-address: Destination IP address of the static route, in dotted decimal notation.

mask: Mask 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 outbound interface by its type and number. If the outbound interface is a broadcast interface, such as an Ethernet interface, a virtual template or a VLAN interface, the next hop address must be specified.

vpn-instance d-vpn-instance-name: Specifies a destination MPLS L3VPN. d-vpn-instance-name is a case-sensitive string of 1 to 31 characters. If a destination VPN is specified, the router will search the outbound interface in the destination VPN based on the configured next-hop-address.

next-hop-address public: Indicates that the specified next-hop-address is a public network address, rather than a VPN instance address.

preference preference-value : Specifies the preference of the static route, which is in the range of 1 to 255 and defaults to 60.

tag tag-value: Sets a tag value for the static route from 1 to 4294967295. The default is 0. Tags of routes are used in routing policies to control routing. For more information about routing policies, see the chapter “Routing policy configuration commands.”

permanent: Specifies the route as a permanent static route. If the outgoing interface is down, the permanent static route is still active.

description description-text: Configures a description for the static route, which consists of 1 to 60 characters, including special characters like space, but excluding question marks (?).

bfd: Enable the bidirectional forwarding detection (BFD) function to detect reachability of the static route’s next hop. Once the next hop is unreachable, the system will switch to a backup route.

control-packet: Implements BFD in the control packet mode.

echo-packet: Implements BFD in the echo packet mode.

bfd-source ip-address: Specifies the source address of BFD packets. H3C recommends you to configure loopback interface address.

track track-entry-number: Associates the static route with a track entry. Use the track-entry-number argument to specify a track entry number, in the range 1 to 1024.

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 you configure 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.

·           Implement different routing policies by tuning route preference. For example, to enable multiple routes to the same destination address to share load, assign the same preference for the routes; to enable them to back up one another, assign different preferences for them.

·           Specify the outbound 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 outbound 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 outbound interface is a Null 0 interface, no next hop address is required.

¡  If the outbound interface is a point-to-point interface, a PPP interface for example, you may specify only the outbound interface rather than the peer address or both the outbound interface and peer address. As only the outbound interface is specified, there is no need to change the configuration of the route even if the peer address is changed.

¡  If the outbound interface is an NBMA and P2MP interface, H3C recommends specifying both the interface and the next hop address for the route. This is because such interfaces support point-to-multipoint networks; for them the router must establish IP address-to-link layer address mappings for successful packet delivery.

¡  H3C does not recommend specifying a broadcast interface (such as an Ethernet interface or a VLAN interface) as the outbound interface for a static route, because a broadcast interface may have multiple next hops. If you have to do so, you must specify the corresponding next hop of the interface at the same time.

¡  To implement BFD with the control-packet mode, the remote end must create a BFD session; otherwise the BFD function cannot work. To implement BFD with the echo-packet mode, the BFD function can work without the remote end needing to create any BFD session.

¡  To configure a static route and enable BFD control packet mode for it, specify an outbound interface and a direct next hop—BFD establishes a direct session, or specify an indirect next hop and a specific BFD packet source address—BFD establishes an indirect session—for the static route.

Related commands: display ip routing-table and ip route-static default-preference.

 

 

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 an Ethernet interface and VLAN interface.

·       If route oscillation occurs, enabling BFD may worsen it. Be cautious when using BFD. For more information about BFD, see High Availability Configuration Guide.

·       To configure track monitoring for an existing static route, simply associate the static route with a track entry. For a non-existent static route, configure it and associate it with a track entry.

·       If the track module uses NQA to detect the reachability of the private network static route's nexthop, the VPN instance number of the static route's nexthop must be identical to that configured in the NQA test group.

·       If a static route needs route recursion, the associated track entry must monitor the nexthop of the recursive route instead of that of the static route. Otherwise, a valid route may 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 & intranet.

<Sysname> system-view

[Sysname] ip route-static 1.1.1.1 24 2.2.2.2 tag 45 description for internet & intranet

# Configure a static route for a VPN instance named vpn1: the destination address is 1.1.1.1/16 and the next hop address is 1.1.1.2, which is the address of this VPN instance.

<Sysname> system-view

[Sysname] ip route-static vpn-instance vpn1 1.1.1.1 16 vpn-instance vpn1 1.1.1.2

# Configure a static route: the destination address is 1.1.1.1/24, the outbound interface is GigabitEthernet 3/1/1, and the next hop address is 2.2.2.2, and enable BFD with the echo packet mode.

<Sysname> system-view

[Sysname] ip route-static 1.1.1.1 24 GigabitEthernet 3/1/1 2.2.2.2 bfd echo-packet

ip route-static default-preference

Syntax

ip route-static default-preference default-preference-value

undo ip route-static default-preference

View

System view

Default level

2: System level

Parameters

default-preference-value: Default preference for static routes, which is in the range of 1 to 255.

Description

Use the ip route-static default-preference command to configure the default preference for static routes.

Use the undo ip route-static default-preference command to restore the default.

By default, the default preference of static routes is 60.

If no preference is specified when configuring a static route, the default preference is used.

When the default preference is re-configured, it applies to newly added static routes only.

Related commands: display ip routing-table and ip route-static.

Examples

# Set the default preference of static routes to 120.

<Sysname> system-view

[Sysname] ip route-static default-preference 120

ip route-static fast-reroute

Syntax

ip route-static [ vpn-instance vpn-instance-name ] fast-reroute route-policy route-policy-name

undo ip route-static [ vpn-instance vpn-instance-name ] fast-reroute

View

System view

Default level

2: System level

Parameters

vpn-instance vpn-instance-name: Specifies an MPLS L3VPN to configure FRR for all matching static routes in it. vpn-instance-name is a case-sensitive string of 1 to 31 characters. If no VPN is specified, FRR is configured for all static routes on the public network.

route-policy route-policy-name: References a routing policy. The route-policy-name argument is a case-sensitive string of 1 to 63 characters.

Description

Use the ip route-static fast-reroute command to configure static route fast reroute (FRR).

Use the undo ip route-static fast-reroute command to restore the default.

By default, static route FRR is not configured.

 

 

NOTE:

·       Configuring static route FRR needs to reference a routing policy, which specifies a backup next hop with the apply fast-reroute backup-interface command. For more information about the command and routing policy configurations, see Layer 3 – IP Routing Configuration Guide.

·       Static route FRR takes effect only for static routes that have both the outbound interface and next hop specified.

·       Do not use static route FRR and BFD (for static route) at the same time.

 

Example

# Enable static route FRR to designate a backup next hop using routing policy frr.

<Sysname> system-view

[Sysname] bfd echo-source-ip 1.1.1.1

[Sysname] ip ip-prefix abc index 10 permit 100.1.1.0 24

[Sysname] route-policy frr permit node 10

[Sysname-route-policy] if-match ip-prefix abc

[Sysname-route-policy]  apply fast-reroute backup-interface GigabitEthernet 3/1/1 backup-nexthop 193.1.1.8

[Sysname-route-policy] quit

[Sysname] ip route-static fast-reroute route-policy frr

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网