H3C S5500-SI Series Ethernet Switches Command Manual(V1.01)

HomeSupportSwitchesH3C S5500 Switch SeriesReference GuidesCommand ReferencesH3C S5500-SI Series Ethernet Switches Command Manual(V1.01)
12-IPv4 Routing Commands
Title Size Download
12-IPv4 Routing Commands 163 KB

Table of Contents

Chapter 1 Static Routing Configuration Commands. 1-1

1.1 Static Routing Configuration Commands. 1-1

1.1.1 delete static-routes all 1-1

1.1.2 ip route-static. 1-2

1.1.3 ip route-static default-preference. 1-3

Chapter 2 RIP Configuration Commands. 2-1

2.1 RIP Configuration Commands. 2-1

2.1.1 checkzero. 2-1

2.1.2 default cost 2-2

2.1.3 default-route originate. 2-2

2.1.4 display rip. 2-3

2.1.5 display rip database. 2-5

2.1.6 display rip interface. 2-6

2.1.7 display rip route. 2-7

2.1.8 filter-policy export 2-10

2.1.9 filter-policy import 2-11

2.1.10 host-route. 2-11

2.1.11 import-route. 2-12

2.1.12 network. 2-13

2.1.13 peer 2-14

2.1.14 preference. 2-15

2.1.15 reset rip statistics. 2-15

2.1.16 rip. 2-16

2.1.17 rip authentication-mode. 2-17

2.1.18 rip input 2-18

2.1.19 rip metricin. 2-18

2.1.20 rip metricout 2-19

2.1.21 rip output 2-20

2.1.22 rip poison-reverse. 2-21

2.1.23 rip split-horizon. 2-22

2.1.24 rip summary-address. 2-22

2.1.25 rip version. 2-23

2.1.26 silent-interface. 2-24

2.1.27 summary. 2-25

2.1.28 timers. 2-26

2.1.29 validate-source-address. 2-27

2.1.30 version. 2-28

Chapter 3 Routing Policy Configuration Commands. 3-1

3.1 Routing Policy Common Configuration Commands. 3-1

3.1.1 apply cost 3-1

3.1.2 apply preference. 3-2

3.1.3 apply tag. 3-3

3.1.4 display route-policy. 3-3

3.1.5 if-match cost 3-4

3.1.6 if-match interface. 3-5

3.1.7 if-match tag. 3-6

3.1.8 route-policy. 3-6

3.2 IPv4 Routing Policy Configuration Commands. 3-7

3.2.1 apply ip-address next-hop. 3-7

3.2.2 display ip ip-prefix. 3-8

3.2.3 if-match acl 3-9

3.2.4 if-match ip. 3-10

3.2.5 if-match ip-prefix. 3-11

3.2.6 ip ip-prefix. 3-11

3.2.7 reset ip ip-prefix. 3-13

 


Chapter 1  Static Routing Configuration Commands

 

&  Note:

The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.

 

1.1  Static Routing Configuration Commands

1.1.1  delete static-routes all

Syntax

delete static-routes all

View

System view

Parameters

None

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, 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 reconf

igure all static routes

Are you sure?[Y/N]:Y

1.1.2  ip route-static

Syntax

ip route-static dest-address { mask | mask-length } { next-hop-address [ track track-entry-number ] | interface-type interface-number [ next-hop-address ] } [ 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 ] ] [ preference preference-value ]

View

System view

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 an Ethernet interface, a virtual template or 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.

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.

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

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 configuring a unicast static route, note that:

1)         If the destination IP address and the mask are both 0.0.0.0, the configured route is a default route. If routing table searching fails, the router will use the default route for packet forwarding.

2)         Different route management policies can be implemented for different route preference configurations. For example, specifying the same preference for different routes to the same destination address enables load sharing, while specifying different preferences for these routes enables route backup.

3)         When configuring a static route, you can specify the output interface or the next hop address based on the actual requirement. Note that the next hop address must not be the IP address of the local interface; otherwise, the route configuration will not take effect. For interfaces that support network address to link layer address resolution or point-to-point interfaces, you can specify the output interface or next hop address. When specifying the output interface, note that:

l           For a NULL 0 interface, if the output interface has already been configured, there is no need to configure the next hop address.

l           It is not recommended to specify a broadcast interface (such as VLAN interface) as the output 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.

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

 

&  Note:

l      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.

l      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.

l      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.

 

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

1.1.3  ip route-static default-preference

Syntax

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

undo ip route-static default-preference

View

System view

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.

Note that:

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

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

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

Examples

# Set the default preference of static routes to 120.

<Sysname> system-view

[Sysname] ip route-static default-preference 120

 


Chapter 2  RIP Configuration Commands

 

&  Note:

l      The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.

l      The S5500-SI series only support single RIP process.

 

2.1  RIP Configuration Commands

2.1.1  checkzero

Syntax

checkzero

undo checkzero

View

RIP view

Parameters

None

Description

Use the checkzero command to enable the zero field check on RIPv1 messages.

Use the undo checkzero command to disable the zero field check.

The zero field check is enabled by default.

After the zero field check is enabled, the router discards RIPv1 messages in which zero fields are non-zero. If all messages are trusty, you can disable this feature to spare the processing time of the CPU.

Examples

# Disable the zero field check on RIPv1 messages for RIP process 100.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] undo checkzero

2.1.2  default cost

Syntax

default cost value

undo default cost

View

RIP view

Parameters

value: Default metric of redistributed routes, in the range of 0 to 16.

Description

Use the default cost command to configure the default metric for redistributed routes.

Use the undo default cost command to restore the default.

By default, the default metric of redistributed routes is 0.

When you use the import-route command to redistribute routes from other protocols without specifying a metric, the metric specified by the default cost command applies.

Related command: import-route.

Examples

# Set the default metric for redistributed routes to 3.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] default cost 3

2.1.3  default-route originate

Syntax

default-route originate cost value

undo default-route originate

View

RIP view

Parameters

value: Cost of the default route, in the range of 1 to 15.

Description

Use the default-route originate cost command to advertise a default route with the specified metric to RIP neighbors.

Use the undo default-route originate command to disable the sending of a default route.

By default, no default route is sent to RIP neighbors.

The RIP router with this feature configured will not receive any default routes from RIP neighbors.

Examples

# Send a default route with a metric of 2 to RIP neighbors.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] default-route originate cost 2

# Disable default route sending.

[Sysname-rip-100] undo default-route originate

2.1.4  display rip

Syntax

display rip [ process-id ]

View

Any view

Parameters

process-id: RIP process ID, in the range of 1 to 65535.

Description

Use the display rip command to display the current status and configuration information of the specified RIP process.

If process-id is not specified, information about all configured RIP processes is displayed.

Examples

# Display the current status and configuration information of all configured RIP processes.

<Sysname> display rip

 

    RIP process : 1

       RIP version : 1

       Preference : 100

       Checkzero : Enabled

       Default-cost : 0

       Summary : Enabled

       Hostroutes : Enabled

       Maximum number of balanced paths : 1

       Update time   :   30 sec(s)  Timeout time         :  180 sec(s)

       Suppress time :  120 sec(s)  Garbage-collect time :  120 sec(s)

       TRIP retransmit time :    5 sec(s)

       TRIP response packets retransmit count :   36

       Silent interfaces : None

       Default routes : Disabled

       Verify-source : Enabled

       Networks :

           192.168.1.0

       Configured peers : None

       Triggered updates sent : 0

       Number of routes changes : 0

       Number of replies to queries : 0

Table 2-1 Description on the fields of the display rip command

Field

Description

RIP process

RIP process ID

RIP version

RIP version 1 or 2

Preference

RIP route priority

Checkzero

Indicates whether the zero field check is enabled for RIPv1 messages.

Default-cost

Default cost of the redistributed routes

Summary

Indicates whether the routing summarization is enabled

Hostroutes

Indicates whether to receive host routes

Maximum number of balanced paths

Maximum number of load balanced routes

Update time

RIP update interval

Timeout time

RIP timeout time

Suppress time

RIP suppress interval

Garbage-collect time

RIP garbage collection interval

TRIP retransmit time

TRIP retransmit interval for sending update requests and responses.

TRIP response packets retransmit count

Maximum retransmit times for update requests and responses

Silent interfaces

Number of silent interfaces, which do not periodically send updates

Default routes

Indicates whether a default route is sent to RIP neighbors

Verify-source

Indicates whether the source IP address is checked on the received RIP routing updates

Networks

Networks enabled with RIP

Configured peers

Configured neighbors

Triggered updates sent

Number of sent triggered updates

Number of routes changes

Number of changed routes in the database

Number of replies to queries

Number of RIP responses

 

2.1.5  display rip database

Syntax

display rip process-id database

View

Any view

Parameters

process-id: RIP process ID, in the range of 1 to 65535.

Description

Use the display rip database command to display the active routes in the RIP database, which are sent in normal RIP routing updates.

Examples

# Display the active routes in the database of RIP process 100.

<Sysname> display rip 100 database

  10.0.0.0/8, cost 1, ClassfulSumm

  10.0.0.0/24, cost 1, nexthop 10.0.0.1, Rip-interface

  11.0.0.0/8, cost 1, ClassfulSumm

  11.0.0.0/24, cost 1, nexthop 10.0.0.1, Imported

Table 2-2 Description on fields of the display rip database command

Field

Description

X.X.X.X/X

Destination address and subnet mask

cost

Cost of the route

classful-summ

Indicates the route is a RIP summary route.

Nexthop

Address of the next hop

Rip-interface

Routes learnt from a RIP–enabled interface

imported

Routes redistributed from other routing protocols

 

2.1.6  display rip interface

Syntax

display rip process-id interface [ interface-type interface-number ]

View

Any view

Parameters

process-id: RIP process ID, in the range of 1 to 65535.

interface-type interface-number: Specifies an interface.

Description

Use the display rip interface command to display the RIP interface information of the RIP process.

If no interface is specified, information about all RIP interfaces of the RIP process is displayed.

Examples

# Display all the interface information of RIP process 1.

<Sysname> display rip 1 interface

 

 Interface-name: Vlan-interface1

    Address/Mask:192.168.0.154/24    Version:RIPv1

    MetricIn:0                       MetricIn route policy:Not designated

    MetricOut:1                      MetricOut route policy:Not designated

    Split-horizon/Poison-reverse:on/off  Input/Output:on/on

    Current packets number/Maximum packets number:10/2000

Table 2-3 Description on the fields of the display rip interface command

Field

Description

Interface-name

The name of an interface running RIP.

Address/Mask

The IP address and Mask of the interface.

Version

RIP version running on the interface

MetricIn

Additional routing metric added to the incoming routes

MetricIn route policy

Name of the routing policy used to add the additional routing metric for the incoming routes. If no routing policy is referenced, the field displays Not designated.

MetricOut

Additional routing metric added to the outgoing routes

MetricOut route policy

Name of the routing policy used to add the additional routing metric for the outgoing routes. If no routing policy is referenced, the field displays Not designated.

Split-horizon

Indicates whether the split-horizon is enabled (ON: enabled, OFF: disabled).

Poison-reverse

Indicates whether the poison-reverse is enabled (ON: enabled, OFF: disabled)

Input/Output

Indicates if the interface is allowed to receive (Input) or send (Output) RIP messages (on is allowed, off is not allowed).

Current packets number/Maximum packets number

Packets to be sent/Maximum packets that can be sent on the interface

 

2.1.7  display rip route

Syntax

display rip process-id route [ statistics | ip-address { mask | mask-length } | peer ip-address ]

View

Any view

Parameters

process-id: RIP process ID, in the range of 1 to 65535.

statistics: Displays the route statistics, including total number of routes and number of routes of each neighbor.

ip-address { mask | mask-length }: Displays route information about a specified IP address.

peer ip-address: Displays all routing information learned from a specified neighbor.

Description

Use the display rip route command to display the routing information of a specified RIP process.

Examples

# Display all routing information of RIP process 1.

<Sysname> display rip 1 route

 Route Flags: R-RIP, T-TRIP

              P-Permanent, A-Aging, S-Suppressed, G-Garbage-collect

Peer 21.0.0.23 on Vlan-interface1

Destination/Mask    NextHop      Cost     Tag    Flags     Sec

56.0.0.0/8         21.0.0.23      1         0       RA     102

34.0.0.0/8         21.0.0.23      1         0       RA      23

Peer 21.0.0.12 on Vlan-interface1

Destination/Mask    NextHop      Cost     Tag    Flags     Sec

56.0.0.0/8         21.0.0.12      1         0       RA      34

12.0.0.0/8         21.0.0.12      1         0       RA      12

# Display routing information for network 56.0.0.0/8 of RIP process 1.

<Sysname> display rip 1 route 56.0.0.0 8

Route Flags: R-RIP, T-TRIP

             P-Permanent, A-Aging, S-Suppressed, G-Garbage-collect

Peer 21.0.0.23 on Vlan-interface1

Destination/Mask    NextHop      Cost     Tag    Flags     Sec

56.0.0.0/8         21.0.0.23      1         0       RA     102

Peer 21.0.0.12 on Vlan-interface1

Destination/Mask    NextHop      Cost     Tag    Flags     Sec

56.0.0.0/8         21.0.0.12      1         0       RA      34

# Display RIP process1 routing information learned from the specified neighbor.

<Sysname> display rip 1 route peer 21.0.0.23

Route Flags: R-RIP, T-TRIP

             P-Permanent, A-Aging, S-Suppressed, G-Garbage-collect

Peer 21.0.0.23 on Vlan-interface1

Destination/Mask    NextHop      Cost     Tag    Flags     Sec

56.0.0.0/8         21.0.0.23      1         0       RA        102   

34.0.0.0/8         21.0.0.23      1         0       RA        23 

Table 2-4 Description on the fields of the display rip route command

Field

Description

Route Flags

R — RIP route

T — TRIP route

P — The route never expires

A — The route is aging

S — The route is suppressed

G — The route is in Garbage-collect state

Peer 21.0.0.23 on Vlan-interface1

Routing information learned on a RIP interface from the specified neighbor

Destination/Mask

Destination IP address and subnet mask

Nexthop

Next hop of the route

Cost

Cost of the route

Tag

Route tag

Flags

Indicates the route state

Sec

Remaining time of the timer corresponding to the route state

 

# Display the routing statistics of RIP process 1.

<Sysname> display rip 1 route statistics

Peer         Aging     Permanent    Garbage

21.0.0.23      2          0              3

21.0.0.12      2          0              4

Total          4          0              7

Table 2-5 Description on the fields of the display rip route statistics command

Field

Description

Peer

IP address of a neighbor

Aging

Total number of aging routes learned from the specified neighbor

Permanent

Total number of permanent routes learned from the specified neighbor

Garbage

Total number of routes in the garbage-collection state learned from the specified neighbor

Total

Total number of routes learned from all RIP neighbors

 

2.1.8  filter-policy export

Syntax

filter-policy { acl-number | ip-prefix ip-prefix-name } export [ protocol [ process-id ] | interface-type interface-number ]

undo filter-policy export [ protocol [ process-id ] | interface-type interface-number ]

View

RIP view

Parameters

acl-number: Number of an ACL used to filter outbound routes, in the range of 2000 to 3999.

ip-prefix ip-prefix-name: Name of an IP prefix list used to filter outbound routes, a string of 1 to 19 characters.

protocol: Filters outbound routes redistributed from a specified routing protocol, which can be direct, rip, and static.

process-id: Process ID of the specified routing protocol, in the range of 1 to 65535. You need to specify a process ID when the routing protocol is rip.

interface-type interface-number: Specifies an interface.

Description

Use the filter-policy export command to configure the filtering of RIP outgoing routes. Only routes not filtered out can be advertised.

Use the undo filter-policy export command to remove the filtering.

By default, RIP does not filter outbound routes.

Note that:

l           If protocol is specified, RIP filters only the outgoing routes redistributed from the specified routing protocol. Otherwise, RIP filters all routes to be advertised.

l           If interface-type interface-number is specified, RIP filters only the routes advertised by the specified interface. Otherwise, RIP filters routes advertised by all RIP interfaces.

Related commands: acl, import-route, and ip ip-prefix.

Examples

# Reference ACL 2000 to filter outbound routes.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] filter-policy 2000 export

# Reference IP prefix list abc to filter outbound routes on VLAN-interface 10.

[Sysname-rip-1] filter-policy ip-prefix abc export vlan-interface 10

2.1.9  filter-policy import

Syntax

filter-policy { acl-number | gateway ip-prefix-name | ip-prefix ip-prefix-name [ gateway ip-prefix-name ] } import [ interface-type interface-number ]

undo filter-policy import [ interface-type  interface-number ]

View

RIP view

Parameters

acl-number: Number of the Access Control List (ACL) used for filtering incoming routes, in the range of 2000 to 3999.

ip-prefix ip-prefix-name: References an IP prefix list to filter incoming routes. The ip-prefix-name is a string of 1 to 19 characters.

gateway ip-prefix-name: References an IP prefix list to filter routes from the gateway.

interface-type interface-number: Specifies an interface.

Description

Use the filter-policy import command to filter the incoming routes.

Use the undo filter-policy import command to restore the default.

By default, RIP does not filter incoming routes.

Related commands: acl and ip ip-prefix.

Examples

# Reference ACL 2000 to filter incoming routes.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] filter-policy 2000 import

# Reference IP prefix list abc on VLAN-interface 10 to filter all received RIP routes.

[Sysname-rip-1] filter-policy ip-prefix abc import vlan-interface 10

2.1.10  host-route

Syntax

host-route

undo host-route

View

RIP view

Parameters

None

Description

Use the host-route command to enable host route reception.

Use the undo host-route command to disable host route reception.

By default, receiving host routes is enabled.

In some cases, a router may receive many host routes from the same network segment. These routes are not helpful for routing and occupy a large amount of network resources. You can use the undo host-route command to disable receiving of host routes.

 

&  Note:

RIPv2 can be disabled from receiving host routes, but RIPv1 cannot.

 

Examples

# Disable RIP from receiving host routes.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] undo host-route

2.1.11  import-route

Syntax

import-route protocol [ cost cost | route-policy route-policy-name | tag tag ]*

undo import-route protocol

View

RIP view

Parameters

protocol: Specify a routing protocol from which to redistribute routes, currently including  direct and static.

cost: Cost for redistributed routes, in the range of 0 to 16. If cost is not specified, the default cost specified by the default cost command applies.

tag: Tag marking redistributed routes, in the range of 0 to 65,535. The default is 0.

route-policy route-policy-name: Specifies a routing policy with 1 to 19 characters.

Description

Use the import-route command to enable route redistribution from another routing protocol.

Use the undo import-route command to disable route redistribution.

By default, RIP does not redistribute routes from other routing protocols.

l           You can specify a routing policy using keyword route-policy to redistribute only the specified routes.

l           You can configure a cost for redistributed routes using keyword cost.

l           You can configure a tag value for redistributed routes using keyword tag.

Related commands: default cost.

Examples

# Redistribute static routes, and set the cost to 4.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] import-route static cost 4

# Set the default cost for redistributed routes to 3.

[Sysname-rip-1] default cost 3

2.1.12  network

Syntax

network network-address

undo network network-address

View

RIP view

Parameters

network-address: IP address of a network segment, which can be the IP network address of any interface.

Description

Use the network command to enable RIP on the interface attached to the specified network.

Use the undo network command to disable RIP on the interface attached to the specified network.

RIP runs only on the interfaces attached to the specified network. For an interface not on the specified network, RIP neither receives/sends routes on it nor forwards interface route through it. Therefore, you need to specify the network after enabling RIP to validate RIP on a specific interface.

Use the network 0.0.0.0 command to enable RIP on all interfaces.

RIP is disabled on an interface by default.

Examples

# Enable RIP on the interface attached to the network 129.102.0.0.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] network 129.102.0.0

2.1.13  peer

Syntax

peer ip-address

undo peer ip-address

View

RIP view

Parameters

ip-address: IP address of a RIP neighbor, in dotted decimal format.

Description

Use the peer command to specify the IP address of a neighbor in the non-broadcast multi-access (NBMA) network, where routing updates destined to the peer are unicast, rather than multicast or broadcast.

Use the undo peer command to remove the IP address of a neighbor.

By default, no neighbor is specified.

Note: you need not use the peer ip-address command when the neighbor is directly connected; otherwise the neighbor may receive both the unicast and multicast (or broadcast) of the same routing information.

Examples

# Specify to send unicast updates to peer 202.38.165.1.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] peer 202.38.165.1

2.1.14  preference

Syntax

preference [ route-policy route-policy-name ] value

undo preference [ route-policy ]

View

RIP view

Parameters

route-policy-name: Routing policy name with 1 to 19 characters.

value: Priority for RIP route, in the range of 1 to 255. The smaller the value, the higher the priority.

Description

Use the preference command to specify the RIP route priority.

Use the undo preference route-policy command to restore the default.

By default, the priority of RIP route is 100.

You can specify a routing policy using keyword route-policy to set the specified priority to routes matching the routing policy.

l           If a priority is set for matched routes in the routing policy, the priority applies to these routes. The priority of other routes is the one set by the preference command.

l           If no priority is set for matched routes in the routing policy, the priority of all routes is the one set by the preference command.

Examples

# Set the RIP route priority to 120.

<Sysname> system-view

[Sysname] rip 1

[Sysname-rip-1] preference 120

2.1.15  reset rip statistics

Syntax

reset rip process-id statistics

View

User view

Parameters

process-id: RIP process ID, in the range of 1 to 65535.

Description

Use the reset rip statistics command to clear the statistics of the specified RIP process.

Examples

# Clear statistics in RIP process 100.

<Sysname> reset rip 100 statistics

2.1.16  rip

Syntax

rip [ process-id ]

undo rip [ process-id ]

View

System view

Parameters

process-id: RIP process ID, in the range of 1 to 65535. The default is 1.

Description

Use the rip command to create a RIP process and enter RIP view.

Use the undo rip command to disable a RIP process.

By default, no RIP process runs.

Note that:

l           You must enable the RIP process before configuring the global parameters. This limitation is not for configuration of interface parameters.

l           The configured interface parameters become invalid after you disable the RIP process.

Examples

# Create a RIP process and enter RIP process view.

<Sysname> system-view

[Sysname] rip

[Sysname-rip-1]

2.1.17  rip authentication-mode

Syntax

rip authentication-mode { md5 { rfc2082 key-string key-id | rfc2453 key-string } | simple password }

undo rip authentication-mode

View

Interface view

Parameters

md5: MD5 authentication mode.

rfc2453: Uses the message format defined in RFC 2453 (IETF standard).

rfc2082: Uses the message format defined in RFC 2082.

key-id: MD5 key number, in the range of 1 to 255.

key-string: MD5 key string with 1 to 16 characters in plain text format, or 24 characters in cipher text format. When the display current-configuration command is used to display system information, a 24-character cipher string is displayed as the MD5 key string.

simple: Plain text authentication mode.

password: Plain text authentication string with 1 to 16 characters.

Description

Use the rip authentication-mode command to configure RIPv2 authentication mode and parameters.

Use the undo rip authentication-mode command to cancel authentication.

Note that the key string you configured can overwrite the old one if there is any.

Related commands: rip version.

Examples

# Configure MD5 authentication on VLAN-interface 10 with the key string being rose in the format defined in RFC 2453.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip version 2

[Sysname-Vlan-interface10] rip authentication-mode md5 rfc2453 rose

2.1.18  rip input

Syntax

rip input

undo rip input

View

Interface view

Parameters

None

Description

Use the rip input command to enable the interface to receive RIP messages.

Use the undo rip input command to disable the interface from receiving RIP messages.

By default, an interface is enabled to receive RIP messages.

Related commands: rip output.

Examples

# Disable VLAN-interface 10 from receiving RIP messages.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] undo rip input

2.1.19  rip metricin

Syntax

rip metricin [ route-policy route-policy-name ] value

undo rip metricin

View

Interface view

Parameters

route-policy route-policy-name: Specifies the name of a routing policy used to add an additional metric for the routes matching it. The name is a string of 1 to 19 characters.

value: Additional metric added to received routes, in the range of 0 to 16.

Description

Use the rip metricin command to add a metric to the received routes.

Use the undo rip metricin command to restore the default.

By default, the additional metric of a received route is 0.

When a valid RIP route is received, the system adds a metric to it and then installs it into the routing table. Therefore, the metric of routes received on the configured interface is increased.

If a routing policy is referenced with the route-policy keyword:

l           Routes matching the policy is added with the metric specified in the apply cost command configured in the policy, while routes not matching it is added with the metric specified in the rip metricout command. Note that, the rip metricout command does not support the + or – keyword (used to add or reduce a metric) specified in the apply cost command. For details about the apply cost command, refer to Routing Policy Commands .

l           If the apply cost command is not configured in the policy, all the advertised routes is added with the metric specified in the rip metricout command.

Related commands: rip metricout.

Examples

# Configure VLAN-interface 10 to add a metric of 6 for incoming route 1.0.0.0/8 and to add a metric of 2 for other incoming routes.

<Sysname> system-view

[Sysname] ip ip-prefix 123 permit 1.0.0.0 8

[Sysname] route-policy abc permit node 0

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

[Sysname-route-policy] apply cost 6

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip metricin route-policy abc 2

2.1.20  rip metricout

Syntax

rip metricout [ route-policy route-policy-name ] value

undo rip metricout

View

Interface view

Parameters

route-policy route-policy-name: Specifies the name of a routing policy used to add an additional metric for the routes matching it. The name is a string of 1 to 19 characters.

value: Additional metric of sent routes, in the range of 1 to 16.

Description

Use the rip metricout command to add a metric to a sent route.

Use the undo rip metricout command to restore the default.

By default, the additional metric for sent routes is 1.

Before a RIP route is sent, a metric will be added to it. Therefore, when the metric is configured on an interface, the metric of RIP routes sent on the interface will be increased.

If a routing policy is referenced with the route-policy keyword:

l           Routes matching the policy is added with the metric specified in the apply cost command configured in the policy, while routes not matching it is added with the metric specified in the rip metricout command. Note that, the rip metricout command does not support the + or – keyword (used to add or reduce a metric) specified in the apply cost command. For details about the apply cost command, refer to Routing Policy Commands.

l           If the apply cost command is not configured in the policy, all the advertised routes is added with the metric specified in the rip metricout command.

Related commands: rip metricin.

Examples

#  Configure VLAN-interface 10 to add a metric of 6 for the outgoing route 1.0.0.0/8 and to add a metric of 2 for other outgoing routes.

<Sysname> system-view

[Sysname] ip ip-prefix 123 permit 1.0.0.0 8

[Sysname] route-policy abc permit node 0

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

[Sysname-route-policy] apply cost 6

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip metricout route-policy abc 2

2.1.21  rip output

Syntax

rip output

undo rip output

View

Interface view

Parameters

None

Description

Use the rip output command to enable the interface to send RIP messages.

Use the undo rip output command to disable the interface from sending RIP messages.

Sending RIP messages is enabled on an interface by default.

Related commands: rip input.

Examples

# Disable VLAN-interface 10 from receiving RIP messages.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] undo rip output

2.1.22  rip poison-reverse

Syntax

rip poison-reverse

undo rip poison-reverse

View

Interface view

Parameters

None

Description

Use the rip poison-reverse command to enable the poison reverse function.

Use the undo rip poison-reverse command to disable the poison reverse function.

By default, the poison reverse function is disabled.

Examples

# Enable the poison reverse function for RIP routing updates on VLAN-interface 10.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip poison-reverse

2.1.23  rip split-horizon

Syntax

rip split-horizon

undo rip split-horizon

View

Interface view

Parameters

None

Description

Use the rip split-horizon command to enable the split horizon function.

Use the undo rip split-horizon command to disable the split horizon function.

The split horizon function is enabled by default.

l           The split horizon function is necessary for preventing routing loops. Therefore, you are not recommended to disable it.

l           In special cases, make sure it is necessary to disable the split horizon function.

 

&  Note:

Only the poison reverse function takes effect if both the split horizon and poison reverse functions are enabled.

 

Examples

# Enable the split horizon function on VLAN-interface 10.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip split-horizon

2.1.24  rip summary-address

Syntax

rip summary-address ip-address { mask | mask-length }

undo rip summary-address ip-address { mask | mask-length }

View

Interface view

Parameters

ip-address: Summary IP address.

mask: Subnet mask in dotted decimal format.

mask-length: Subnet mask length.

Description

Use the rip summary-address command to configure RIPv2 to advertise a summary route through the interface.

Use the undo rip summary-address command to remove the configuration.

Note that the summary address is valid only when the automatic summarization is disabled.

Related commands: summary.

Examples

# Advertise a local summary address on VLAN-interface 10.

<Sysname> system-view

[Sysname] interface vlan-interface 10

[Sysname-Vlan-interface10] rip summary-address 10.0.0.0 255.255.255.0

2.1.25  rip version

Syntax

rip version { 1 | 2 [ broadcast | multicast ] }

undo rip version

View

Interface view

Parameters

1: RIP version 1.

2: RIP version 2.

broadcast: Sends RIPv2 messages in broadcast mode.

multicast: Sends RIPv2 messages in multicast mode.

Description

Use the rip version command to specify a RIP version for the interface.

Use the undo rip version command to remove the specified RIP version.

By default, no RIP version is configured for an interface, which uses the global RIP version. If the global RIP version is not configured, the interface can only send RIPv1 broadcasts and can receive RIPv1 broadcasts and unicasts, and RIPv2 broadcasts, multicasts and unicasts.

If RIPv2 is specified with no sending mode configured, RIPv2 messages will be sent in multicast mode.

When RIPv1 runs on an interface, the interface will:

l           Send RIPv1 broadcast messages

l           Receive RIPv1 broadcast messages

l           Receive RIPv1 unicast messages

When RIPv2 runs on the interface in broadcast mode, the interface will:

l           Send RIPv2 broadcast messages

l           Receive RIPv1 broadcast messages

l           Receive RIPv1 unicast messages

l           Receive RIPv2 broadcast messages

l           Receive RIPv2 multicast messages

l           Receive RIPv2 unicast messages

When RIPv2 runs on the interface in multicast mode, the interface will:

l           Send RIPv2 multicast messages

l           Receive RIPv2 broadcast messages

l           Receive RIPv2 multicast messages

l           Receive RIPv2 unicast messages

Examples

# Configure VLAN-interface 10 to broadcast RIPv2 messages.

<Sysname> system-view

[Sysname] interface Vlan-interface 10

[Sysname-Vlan-interface10] rip version 2 broadcast

2.1.26  silent-interface

Syntax

silent-interface { all | interface-type interface-number }

undo silent-interface { all | interface-type interface-number }

View

RIP view

Parameters

all: Silents all interfaces.

interface-type interface-number: Specifies an interface by its type and number.

Description

Use the silent-interface command to disable an interface or all interfaces from sending routing updates. That is, the interface only receives but does not send RIP messages.

Use the undo silent-interface command to restore the default.

By default, all interfaces are allowed to send routing updates.

Examples

# Configure all VLAN interfaces to work in the silent state, and activate VLAN-interface 10.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] silent-interface all

[Sysname-rip-100] undo silent-interface vlan-interface 10

[Sysname-rip-100] network 131.108.0.0

2.1.27  summary

Syntax

summary

undo summary

View

RIP view

Parameters

None

Description

Use the summary command to enable automatic RIPv2 summarization. Natural masks are used to advertise summary routes so as to reduce the size of routing tables.

Use the undo summary command to disable automatic RIPv2 summarization so that all subnet routes can be broadcast.

By default, automatic RIPv2 summarization is enabled.

Enabling automatic RIPv2 summarization can reduce the size of the routing table to enhance the scalability and efficiency of large networks.

Related commands: rip version.

Examples

# Enable RIPv2 automatic summarization.

<Sysname> system-view

[Sysname] rip

[Sysname-rip-1] summary

2.1.28  timers

Syntax

timers { garbage-collect garbage-collect-value | suppress suppress-value | timeout timeout-value | update update-value }*

undo timers { garbage-collect | suppress | timeout | update } *

View

RIP view

Parameters

garbage-collect-value: Garbage-collect timer time in seconds, in the range of 1 to 3600.

suppress-value: Suppress timer time in seconds, in the range of 0 to 3600.

timeout-value: Timeout timer time in seconds, in the range of 1 to 3600.

update-value: Update timer time in seconds, in the range of 1 to 3600.

Description

Use the timers command to configure RIP timers. By adjusting RIP timers, you can improve network performance.

Use the undo timers command to restore the default.

By default, the garbage-collect timer is 120 seconds, the suppress timer 120 seconds, the timeout timer 180 seconds, and the update timer 30 seconds.

RIP is controlled by the above four timers.

l           The update timer defines the interval between routing updates.

l           The timeout timer defines the route aging time. If no routing update related to a route is received after the aging time, the metric of the route is set to 16 in the routing table.

l           The suppress timer defines how long a RIP route stays in the suppressed state. When the metric of a route is 16, the route enters the suppressed state. In the suppressed state, only routes which come from the same neighbor and whose metric is less than 16 will be received by the router to replace unreachable routes.

l           The garbage-collect timer defines the interval from when the metric of a route becomes 16 to when it is deleted from the routing table. During the Garbage-Collect timer length, RIP advertises the route with the routing metric set to 16. If no routing update is announced for that route after the Garbage-Collect timer expires, the route will be deleted from the routing table.

Note that:

l           Generally, you are not recommended to change the default values of these timers.

l           The time lengths of these timers must be kept consistent on all routers and access servers in the network.

Examples

# Specifies the update, timeout, suppress, and garbage-collect timers as 5, 15, 15 and 30 respectively.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] timers update 5

[Sysname-rip-100] timers timeout 15

[Sysname-rip-100] timers suppress 15

[Sysname-rip-100] timers garbage-collect 30

2.1.29  validate-source-address

Syntax

validate-source-address

undo validate-source-address

View

RIP view

Parameters

None

Description

Use the validate-source-address command to enable the source IP address validation on incoming RIP routing updates.

Use the undo validate-source-address command to disable the source IP address validation.

The source IP address validation is enabled by default.

Generally, disabling the validation is not recommended.

Examples

# Enable the source IP address validation on incoming messages.

<Sysname> system-view

[Sysname-rip] rip 100

[Sysname-rip-100] validate-source-address

2.1.30  version

Syntax

version { 1 | 2 }

undo version

View

RIP view

Parameters

1: Specifies the RIP version as RIPv1.

2: Specifies the RIP version as RIPv2. RIPv2 messages are multicast.

Description

Use the version command to specify a global RIP version.

Use the undo version command to remove the configured global RIP version.

By default, if an interface has a RIP version specified, the RIP version takes effect; if it has no RIP version specified, it can send RIPv1 broadcasts, and receive RIPv1 broadcasts, RIPv1 unicasts, RIPv2 broadcasts, RIPv2 multicasts, and RIPv2 unicasts. 

Note that:

l           If an interface has an RIP version specified, the RIP version takes precedence over the global RIP version.

l           If no RIP version is specified for the interface and the global version is RIPv1, the interface inherits RIPv1, and it can send RIPv1 broadcasts, and receive RIPv1 broadcasts and unicasts.

l           If no RIP version is specified for the interface and the global version is RIPv2, the interface operates in the RIPv2 muticast mode, and it can send RIPv2 multicasts, and receive RIPv2 broadcasts, multicasts and unicasts.

Examples

# Specify RIPv2 as the global RIP version.

<Sysname> system-view

[Sysname] rip 100

[Sysname-rip-100] version 2


Chapter 3  Routing Policy Configuration Commands

 

&  Note:

l      The term “router” in this document refers to a generic router or a Layer 3 switch running routing protocols.

l      Routing policy common configuration commands are applicable to both IPv4 and IPv6.

 

3.1  Routing Policy Common Configuration Commands

3.1.1  apply cost

Syntax

apply cost [ + | - ] value

undo apply cost

View

Routing policy view

Parameters

+: Increases cost value.

+: Decreases cost value.

cost: Specifies a cost from 0 to 4294967295.

Description

Use the apply cost command to set a cost for routing information.

Use the undo apply cost command to remove the clause configuration.

No cost is set for routing information by default.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply tag.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. If a route matches the outbound interface VLAN-interface 10, set the cost for the route to 120.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match interface vlan-interface 10

[Sysname-route-policy] apply cost 120

3.1.2  apply preference

Syntax

apply preference preference

undo apply preference

View

Routing policy view

Parameters

preference: Routing preference, in the range of 1 to 255.

Description

Use the apply preference command to set a preference for a routing protocol.

Use the undo apply preference command to remove the clause configuration.

No preference is set for a routing protocol by default.

If you set preferences for routing protocols with the preference command, using the apply preference command will set a new preference for a matched routing protocol. Other routing protocols not satisfying criteria still use the preferences set by the preference command.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. If a route matches existing ACL 2000, set the preference for the routing protocol to 90.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match acl 2000

[Sysname-route-policy] apply preference 90

3.1.3  apply tag

Syntax

apply tag value

undo apply tag

View

Routing policy view

Parameters

value: Tag value, in the range 0 to 4294967295.

Description

Use the apply tag command to set a specified tag value for RIP routing information.

Use the undo apply tag command to remove the clause configuration.

No routing tag is set for RIP routing information by default.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, , apply cost.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. If a route matches exsting ACL 2000, set the tag of the route to 100.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match acl 2000

[Sysname-route-policy]apply tag 100

3.1.4  display route-policy

Syntax

display route-policy [ route-policy-name ]

View

Any view

Parameters

route-policy-name: Routing policy name, a string of 1 to 19 characters.

Description

Use the display route-policy command to display routing policy information.

All routing policy information will be displayed if no route-policy-name is specified.

Related commands: route-policy.

Examples

# Display the information of routing policy 1.

<Sysname> display route-policy policy1

Route-policy : policy1

  permit : 10

        if-match ip-prefix abc

        apply cost 120

Table 3-1 Description on the fields of the display route-policy command.

Field

Description

Route-policy

Routing policy name

Permit

permit mode: permit, deny

if-match ip-prefix abc

Match criterion

apply cost 120

If the match criterion is satisfied, set the route cost to 120.

 

3.1.5  if-match cost

Syntax

if-match cost value

undo if-match cost

View

Routing policy view

Parameters

cost: Specifies the cost to match, ranging from 0 to 4294967295.

Description

Use the if-match cost command to specify a cost for matching against the cost of a route.

Use the undo if-match cost command to remove the match criterion.

The match criterion is not configured by default.

This command is one of the if-match clauses of routing policy, used for matching routes with the specified route cost.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match tag, route-policy, apply ip-address next-hop, apply cost, , apply tag.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit routing information with a cost of 8.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match cost 8

3.1.6  if-match interface

Syntax

if-match interface { interface-type interface-number }&<1-16>

undo if-match interface [ interface-type interface-number ]&<1-16>

View

Routing policy view

Parameters

interface-type: Interface type

interface-number: Interface number

&<1-16>: Indicates the argument before it can be entered up to 16 times.

Description

Use the if-match interface command to specify interface(s) for matching against the outbound interfaces of routing information.

Use the undo if-match interface command to remove the match criterion.

The match criterion is not configured by default.

Related commands: if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost,, apply tag.

Examples

# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to permit the routing information with the outbound interface as VLAN-interface 1.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match interface vlan-interface 1

3.1.7  if-match tag

Syntax

if-match tag value

undo if-match tag

View

Routing policy view

Parameters

value: Specifies a tag value, ranging from 0 to 4294967295.

Description

Use the if-match tag command to match routing information having the specified tag.

Use the undo if-match tag command to remove the match criterion.

The match criterion is not configured by default.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, route-policy, apply ip-address next-hop, apply cost,, apply tag.

Examples

# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to permit RIP routing information with the tag as 8.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match tag 8

3.1.8  route-policy

Syntax

route-policy route-policy-name { permit | deny } node node-number

undo route-policy route-policy-name [ node node-number ]

View

System view

Parameters

route-policy-name: Routing policy name, a string of 1 to 19 characters.

permit: Specifies the matching mode of the routing policy node as permit. If a route satisfies all the if-match clauses of the node, it passes through the filtering of the node and then is executed with the apply clauses of the node. If not, it goes to the next node of the routing policy.

deny: Specifies the matching mode of the routing policy node as deny. If a route satisfies all the if-match clauses of the node, it does not pass the filtering of the node and will not go to the next node.

node node-number: Node number, in the range 0 to 65535. The node with a smaller node-number will be tested first when the routing policy is used for filtering routing information.

Description

Use the route-policy command to create a routing policy and enter its view.

Use the undo route-policy command to remove a routing policy.

No routing policy is created by default.

A routing policy is used for routing information filtering or policy routing. It contains several nodes and each node comprises some if-match and apply clauses. The if-match clauses define the matching criteria of the node and the apply clauses define the actions performed after a packet passes the filtering of the node. The relation among the if-match clauses of a node is logic AND, namely all the if-match clauses must be satisfied. The filter relation among different route-policy nodes is logic OR, namely a packet passing a node passes the routing policy.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, apply ip-address next-hop, apply cost, apply tag.

Examples

# Create routing policy 1 with node 10 and matching mode as permit, and then enter routing policy view.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy]

3.2  IPv4 Routing Policy Configuration Commands

3.2.1  apply ip-address next-hop

Syntax

apply ip-address next-hop ip-address

undo apply ip-address next-hop

View

Routing policy view

Parameters

ip-address: IP address of the next hop.

Description

Use the apply ip-address next-hop command to set a next hop for IPv4 routing information.

Use the undo apply ip-address next-hop command to remove the clause configuration.

No next hop address is set for IPv4 routing information by default.

It is invalid to use the apply ip-address next-hop command to set a next hop when redistributing routes.

Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply cost apply tag.

Examples

# Create routing policy policy1 with node 10, matching mode permit. If matching exsting ACL 2000, a route‘s next hop is set to 193.1.1.8.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match acl 2000

[Sysname-route-policy] apply ip-address next-hop 193.1.1.8

3.2.2  display ip ip-prefix

Syntax

display ip ip-prefix [ ip-prefix-name ]

View

Any view

Parameters

ip-prefix-name: IP prefix list name, a string of 1 to 19 characters.

Description

Use the display ip ip-prefix command to display the statistics of an IPv4 prefix list. If no ip-prefix-name is specified, statistics for all IPv4 prefix lists will be displayed.

Related commands: ip ip-prefix.

Examples

# Display the statistics of IPv4 prefix list abc.

<Sysname> display ip ip-prefix abc

Prefix-list abc

Permitted 0

Denied 0

        index: 10               permit  1.0.0.0/11              ge  22  le  32

Table 3-2 Description on the fields of the display ip ip-prefix command.

Field

Description

Prefix-list

Name of the IPv4 prefix list

Permitted

Number of routes satisfying the match criterion

Denied

Number of routes not satisfying the match criterion

index

Internal serial number of the IPv4 prefix list

permit

Matching mode: permit or deny

1.0.0.0/11

Match IP address and mask

ge

greater-equal, the lower limit mask

le

less-equal, the upper limit mask

 

3.2.3  if-match acl

Syntax

if-match acl acl-number

undo if-match acl

View

Routing policy view

Parameters

acl-number: ACL number from 2000 to 3999.

Description

Use the if-match acl command to configure an ACL match criterion.

Use the undo if-match acl command to remove the match criterion.

No ACL match criterion is configured by default.

Related commands: if-match interface, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply tag.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit routes matching ACL 2000.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match acl 2000

3.2.4  if-match ip

Syntax

if-match ip { next-hop | route-source } { acl acl-number | ip-prefix ip-prefix-name }

undo if-match ip { next-hop | route-source } [ acl | ip-prefix ]

View

Routing policy view

Parameters

next-hop: Matches next hop.

route-source: Matches source address.

acl acl-number: Matches an ACL with a number from 2000 to 2999.

ip-prefix ip-prefix-name: Matches an IP prefix list with a name being a string of 1 to 19 characters.

Description

Use the if-match ip command to configure a next hop or source address match criterion for IPv4 routes.

Use the undo if-match ip command to remove the match criterion.

The match criterion is not configured by default.

Related commands: route-policy.

Examples

# Create routing policy policy1 with node 10, matching mode permit. Define an if-match clause to permit routing information whose next hop address matches IP prefix list p1.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

[Sysname-route-policy] if-match ip next-hop ip-prefix p1

3.2.5  if-match ip-prefix

Syntax

if-match ip-prefix ip-prefix-name

undo if-match ip-prefix

View

Routing policy view

Parameters

ip-prefix-name: Matches an IP prefix list with a name being a string of 1 to 19 characters.

Description

Use the if-match ip-prefix command to configure an IP prefix list based match criterion.

Use the undo if-match ip-prefix command to remove the match criterion.

No IP prefix list based match criterion is configured by default.

Related commands: if-match interface, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply tag.

Examples

# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit a route whose destination address matches IP prefix list p1.

<Sysname> system-view

[Sysname] route-policy policy1 permit node 10

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

3.2.6  ip ip-prefix

Syntax

ip ip-prefix ip-prefix-name [ index index-number ] { permit | deny } ip-address mask-length [ greater-equal min-mask-length ] [ less-equal max-mask-length ]

undo ip ip-prefix ip-prefix-name [ index index-number ]

View

System view

Parameters

ip-prefix-name: IPv4 prefix list name, a string of 1 to 19 characters.

index-number: Index number, in the range 1 to 65535, for uniquely specifying an item of the IPv4 prefix list. The index with a smaller number is tested first.

permit: Specifies the matching mode for the IPv4 prefix list as permit, that is, when a route to be filtered is in the range of the IPv4 prefix list, the route passes the IPv4 prefix list without needing to enter the next item for testing. If the route to be filtered is not in the prefix range, it will enter the next item test.

deny: Specifies the matching mode for the IPv4 prefix list as deny, that is, when a route to be filtered is in the IPv4 prefix list range, the route neither passes the filter nor enters the next node for testing. If not in the range, the route will enter the next item test.

ip-address mask-length: Specifies an IPv4 address prefix and mask length. The mask-length is in the range 0 to 32.

min-mask-length, max-mask-length: Specifies the range for prefix if the IPv4 address and prefix length are matched. greater-equal means “greater than or equal to” and less-equal means “less than or equal to”. The range relation is mask-length <= min-mask-length <= max-mask-length <= 32. If only min-mask-length is specified, the prefix length range is [ min-mask-length, 32 ]. If only max-mask-length is specified, the prefix length range is [mask-length, max-mask-length ]. If both min-mask-length and max-mask-length are specified, the prefix length range is [ min-mask-length, max-mask-length ].

Description

Use the ip ip-prefix command to configure an IPv4 prefix list item.

Use the undo ip ip-prefix command to remove an IPv4 prefix list or an item.

No IPv4 prefix list is configured by default.

An IPv4 prefix list is used to filter IPv4 addresses. It may have multiple items, each of which specifies a range of IPv4 prefix. The filtering relation among items is logic OR, namely, passing any item means the IPv4 prefix list is passed. If no item is passed, the IP prefix list cannot be passed.

The IP prefix range is determined by mask-length and [ min-mask-length, max-mask-length ]. If both mask-length and [ min-mask-length, max-mask-length ] are specified, then the IP address to be filtered must satisfy both of them.

If ip-address mask-length is specified as 0.0.0.0 0, then only the default route is matched.

With the keyword and argument combination ip-address mask-length less-equal specified as 0.0.0.0 less-equal 32, the command matches all the routes.

Examples

# Create a routing policy named policy1 with node 10, matching mode as permit. Define an IP prefix list named p1 to permit only the routes in the network segment 10.0.192.0/8 and with mask length 17 or 18.

<Sysname> system-view

[Sysname] ip ip-prefix p1 permit 10.0.192.0 8 greater-equal 17 less-equal 18

3.2.7  reset ip ip-prefix

Syntax

reset ip ip-prefix [ ip-prefix-name ]

View

User view

Parameters

ip-prefix-name: IP prefix list name, a string of 1 to 19 characters.

Description

Use the reset ip ip-prefix command to clear the statistics of a specified IPv4 prefix list. If no ip-prefix-name is specified, the statistics of all the IPv4 prefix lists will be cleared.

Examples

# Clear the statistics of IPv4 prefix list abc.

<Sysname> reset ip ip-prefix abc

 

  • 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
新华三官网