Configuration commands
Use these M4500 CLI commands to assign route maps to interfaces, create IPv4 and IPv6 prefix lists, and define match and set clauses.
ip policy route-map
Use this command to identify a route map to use for policy-based routing on an interface specified by <route-map-name>. Policy-based routing is configured on the interface that receives the packets, not on the interface from which the packets are sent. When a route-map applied on the interface is changed, that is, if new statements are added to route-map or match/set terms are added/removed from route-map statement, and also if route-map that is applied on an interface is removed, route-map needs to be removed from interface and added back again in order to have changed route-map configuration to be effective. In order to disable policy based routing from an interface, use no form of this command.
| Default | None |
| Format |
|
| Mode | Interface Config |
| Fields | Definition |
|---|---|
| routename | (Optional) Name of a specific route map. |
ip prefix-list
To create a prefix list or add a prefix list entry, use the ip prefix-list command in Global Configuration mode. Prefix lists allow matching of route prefixes with those specified in the prefix list. Each prefix list includes of a sequence of prefix list entries ordered by their sequence numbers. A router sequentially examines each prefix list entry to determine if the route's prefix matches that of the entry. An empty or nonexistent prefix list permits all prefixes. An implicit deny is assume if a given prefix does not match any entries of a prefix list. Once a match or deny occurs the router does not go through the rest of the list. A prefix list may be used within a route map to match a route's prefix using the command "match ip address" Up to 128 prefix lists may be configured. The maximum number of statements allowed in prefix list is 64. To delete a prefix list or a statement in a prefix list, use the no form of this command. The command no ip prefix-list list-name deletes the entire prefix list. To remove an individual statement from a prefix list, you must specify the statement exactly, with all its options.
| Default | No prefix lists are configured by default. When neither the ge nor the le option is configured, the destination prefix must match the network/length exactly. If the ge option is configured without the le option, any prefix with a network mask greater than or equal to the ge value is considered a match. Similarly, if the le option is configured without the ge option, a prefix with a network mask less than or equal to the le value is considered a match. |
| Format |
|
| Mode | Global Config |
| Fields | Definition |
|---|---|
| list-name | The text name of the prefix list. Up to 32 characters. |
| seq number | (Optional) The sequence number for this prefix list statement. Prefix list statements are ordered from lowest sequence number to highest and applied in that order. If you do not specify a sequence number, the system will automatically select a sequence number five larger than the last sequence number in the list. Two statements may not be configured with the same sequence number. The value ranges from 1 to 4,294,967,294. |
| permit | Permit routes whose destination prefix matches the statement. |
| deny | Deny routes whose destination prefix matches the statement. |
| prefix/length | Specifies the match criteria for routes being compared to the prefix list statement. The network can be any valid IP prefix. The length is any IPv4 prefix length from 0 to 32. |
| ge length | (Optional) If this option is configured, then a prefix is only considered a match if its network mask length is greater than or equal to this value. This value must be longer than the network length and less than or equal to 32. |
| le length | (Optional) If this option is configured, then a prefix is only considered a match if its network mask length is less than or equal to this value. This value must be longer than the ge length and less than or equal to 32. |
| <renumber-interval> <first-statement-number> | (Optional) Provides the option to renumber the sequence numbers of the IP prefix list statements with a given interval starting from a particular sequence number. The valid range for renumber-interval is 1 - 100, and the valid range for first-statement-number is 1 - 1000. |
ip prefix-list description
To apply a text description to a prefix list, use the ip prefix-list description command in Global Configuration mode. To remove the text description, use the no form of this command.
| Default | No description is configured by default. |
| Format |
|
| Mode | Global Config |
| Fields | Definition |
|---|---|
| list-name | The text name of the prefix list. Up to 32 characters. |
| description text | Text description of the prefix list. Up to 80 characters. |
ipv6 prefix-list
To create a IPv6 prefix list or add a prefix list entry, use the ipv6 prefix-list command in Global Configuration mode. An IPv6 prefix list can contain only IPv6 addresses. Prefix lists allow matching of route prefixes with those specified in the prefix list. Each prefix list includes of a sequence of prefix list entries ordered by their sequence numbers. A router sequentially examines each prefix list entry to determine if the route's prefix matches that of the entry. For IPv6 routes, only IPv6 prefix lists are matched. An empty or nonexistent prefix list permits all prefixes. An implicit deny is assume if a given prefix does not match any entries of a prefix list. Once a match or deny occurs the router does not go through the rest of the list. An IPv6 prefix list may be used within a route map to match a route's prefix using the command "match ipv6 address" A route map may contain both IPv4 and IPv6 prefix lists. If a route being matched is an IPv6 route, only the IPv6 prefix lists are matched. Up to 128 prefix lists may be configured. The maximum number of statements allowed in prefix list is 64. These numbers indicate only IPv6 prefix lists. IPv4 prefix lists may be configured in appropriate numbers independently. To delete a IPv6 prefix list or a statement in a prefix list, use the no form of this command. The command no ipv6 prefix-list list-name deletes the entire prefix list. To remove an individual statement from a prefix list, you must specify the statement exactly, with all its options.
| Default | No prefix lists are configured by default. When neither the ge nor the le option is configured, the destination prefix must match the network/length exactly. If the ge option is configured without the le option, any prefix with a network mask greater than or equal to the ge value is considered a match. Similarly, if the le option is configured without the ge option, a prefix with a network mask less than or equal to the le value is considered a match. |
| Format | ipv6 prefix-list <list-name> {[seq <seq number>] {permit | deny} ip6-prefix/prefix-length [ge <length>] [le <length>] | description <text> | renumber [<renumber-interval> [<first-statement-number>]]} no ipv6 prefix-list <list-name> {[seq <seq number>] {permit | deny} ip6-prefix/prefix-length [ge <length>] [le <length>] | description} |
| Mode | Global Config |
| Fields | Definition |
|---|---|
| list-name | The text name of the prefix list. Up to 32 characters. |
| seq number | (Optional) The sequence number for this prefix list statement. Prefix list statements are ordered from lowest sequence number to highest and applied in that order. If you do not specify a sequence number, the system will automatically select a sequence number five larger than the last sequence number in the list. Two statements may not be configured with the same sequence number. The value ranges from 1 to 4,294,967,294. |
| permit | Permit routes whose destination prefix matches the statement. |
| deny | Deny routes whose destination prefix matches the statement. |
| ipv6-prefix/prefix-length | Specifies the match criteria for routes being compared to the prefix list statement. The ipv6-prefix can be any valid IPv6 prefix where the address is specified in hexadecimal using 16-bit values between colons. The prefix-length is the length of the IPv6 prefix, given as a decimal value that indicates how many of the high-order contiguous bits of the address comprise the prefix (the network portion of the address). A slash mark must precede the decimal value. |
| ge length | (Optional) If this option is configured, specifies a prefix length greater than or equal to the ipv6-prefix/prefix-length. It is the lowest value of a range of the length. |
| le length | (Optional) If this option is configured, specifies a prefix length less than or equal to the ipv6-prefix/prefix-length. It is the highest value of a range of the length. |
| <renumber-interval> <first-statement-number> | (Optional) Provides the option to renumber the sequence numbers of the IPv6 prefix list statements with a given interval starting from a particular sequence number. The valid range for renumber-interval is 1 - 100, and the valid range for first-statement-number is 1 - 1000 |
route-map
To create a route map and enter Route Map Configuration mode, use the route-map command in Global Configuration mode. One use of a route map is to limit the redistribution of routes to a specified range of route prefixes. The redistribution command specifies a route map which refers to a prefix list. The prefix list identifies the prefixes that may be redistributed. It accepts up to 64 route maps. To delete a route map or one of its statements, use the no form of this command.
| Default | No route maps are configured by default. If no permit or deny tag is given, permit is the default. |
| Format |
|
| Mode | Global Config |
| Fields | Definition |
|---|---|
| map-tag | Text name of the route map. Route maps with the same name are grouped together in order of their sequence numbers. A route map name may be up to 32 characters long. |
| permit | (Optional) Permit routes that match all of the match conditions in the route map. Not support in the no form. |
| deny | (Optional) Deny routes that match all of the match conditions in the route map. Not support in the no form. |
| sequence-number |
(Optional) An integer used to order the set of route maps with the same name. Route maps are ordered from lowest to greatest sequence number, with lower sequence numbers being considered first. If no sequence number is specified, three cases would happen: If there is no route map existed, a route map with sequence number 10 and permit action will be created. If there is already one route map in system, the existed route map will be edited. If there is already more than one route map in system, need to specify the sequence number. . The range is 0 to 65,535. |
match as-path
This route map match term matches BGP autonomous system paths against an AS path access list. If you enter a new match as-path term in a route map statement that already has a match as-path term, the AS path list numbers in the new term are added to the existing match term, up to the maximum number of lists in a term. A route is considered a match if it matches any one or more of the AS path access lists the match term refers to. To delete the match as-path term that matches BGP autonomous system paths against an AS path access list, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| as-path-list-number | An integer from 1 to 500 identifying the AS path access list to use as match criteria. |
match community
To configure a route map to match based on a BGP community list, use the match community command in Route Map Configuration mode. If the community list returns a permit action, the route is considered a match. If the match statement refers to a community list that is not configured, no routes are considered to match the statement. To delete a match term from a route map, use the no form of this command. The command no match community list exact-match removes the match statement from the route map. (It does not simply remove the exact-match option.) The command no match community removes the match term and all its community lists.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| community-list | The name of a standard community list. Up to eight names may be included in a single match term. |
| exact-match | (Optional) When this option is given, a route is only considered a match if the set of communities on the route is an exact match for the set of communities in one of the statements in the community list. |
match ip address prefix-list
To configure a route map to match based on a destination prefix, use the match ip address command in Route Map Configuration mode. If you specify multiple prefix lists in one statement, then a match occurs if a prefix matches any one of the prefix lists. If you configure a match ip address statement within a route map section that already has a match ip address statement, the new prefix lists are added to the existing set of prefix lists, and a match occurs if any prefix list in the combined set matches the prefix. To delete a match statement from a route map, use the no form of this command.
| Default | No match criteria are defined by default |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| list-name | The name of a prefix list used to identify the set of matching routes. Up to eight prefix lists may be specified. |
match ip address <acl-id | acl-name>
Use this command to configure a route map in order to match based on the match criteria configured in an IP access-list. Note that an IP ACL must be configured before it is linked to a route-map. Actions present in an IP ACL configuration are applied with other actions involved in route-map. If an IP ACL referenced by a route-map is removed or rules are added or deleted from that ACL, the configuration is rejected. If there are a list of IP access-lists specified in this command and the packet matches at least one of these access-list match criteria, the corresponding set of actions in route-map are applied to packet. If there are duplicate IP access-list numbers/names in this command, the duplicate configuration is ignored. To delete a match statement from a route map, use the no form of this command.
| Default | No match criteria are defined by default |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| acl-id | The access-list number that identifies an access-list configured through access-list CLI configuration commands. This number is 1 to 99 for standard access list number. This number is 100 to 199 for extended access list number. |
| acl-name | The access-list name that identifies named IP ACLs. Access-list name can be up to 31 characters in length. A maximum of 16 ACLs can be specified in this 'match' clause. |
match ipv6 address
To configure a route map to match based on a destination prefix, use the match ip address command in Route Map Configuration mode. prefix-list <prefix-list-name> identifies the name of an IPv6 prefix list used to identifythe set of matching routes. Up to eight prefix lists may be specified. If you specify multiple prefix lists in one statement, then a match occurs if a prefix matches any one of the prefix lists. If you configure a match ipv6 address statement within a route map section that already has a match ipv6 address statement, the new prefix lists are added to the existing set of prefix lists, and a match occurs if any prefix list in the combined set matches the prefix. To delete a match statement from a route map, use the no form of this command.
| Default | No match criteria are defined by default |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| list-name | The name of a prefix list used to identify the set of matching routes. Up to eight prefix lists may be specified. |
match length
Use this command to configure a route map to match based on the Layer 3 packet length between specified minimum and maximum values. min specifies the packet’s minimum Layer 3 length, inclusive, allowed for a match. max specifies the packet’s maximum Layer 3 length, inclusive, allowed for a match. Each route-map statement can contain one ‘match’ statement on packet length range. To delete a match statement from a route map, use the no form of this command.
| Default | No match criteria are defined by default |
| Format |
|
| Mode | Route Map Config |
match mac-list
Use this command to configure a route map in order to match based on the match criteria configured in an MAC access-list. A MAC ACL is configured before it is linked to a route-map. Actions present in MAC ACL configuration are applied with other actions involved in route-map. When a MAC ACL referenced by a route-map is removed, the route-map rule is also removed and the corresponding rule is not effective. When a MAC ACL referenced by a route-map is removed or rules are added or deleted from that ACL, the configuration is rejected. To delete a match statement from a route map, use the no form of this command.
| Default | No match criteria are defined by default |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| mac-list-name | The mac-list name that identifies MAC ACLs. MAC Access-list name can be up to 31 characters in length. |
set as-path
To prepend one or more AS numbers to the AS path in a BGP route, use the set as-path command in Route Map Configuration mode. This command is normally used to insert one or more instances of the local AS number at the beginning of the AS_PATH attribute of a BGP route. Doing so increases the AS path length of the route. The AS path length has a strong influence on BGP route selection. Changing the AS path length can influence route selection on the local router or on routers to which the route is advertised. When prepending an inbound route, if the first segment in the AS_PATH of the received route is an AS_SEQUENCE, as-path-string is inserted at the beginning of the sequence. If the first segment is an AS_SET, as-path-string is added as a new segment with type AS_SEQUENCE at the beginning of the AS path. When prepending an outbound route to an external peer, as-path-string follows the local AS number, which is always the first ASN. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| as-path-string | A list of AS path numbers to insert at the beginning of the AS_PATH attribute of matching BGP routes. To prepend more than one AS number, separate the ASNs with a space and enclose the string in quotes. Up to ten AS numbers may be prepended. |
set comm-list delete
To remove BGP communities from an inbound or outbound UPDATE message, use the set comm-list delete command in Route Map Configuration mode. A route map with this set command can be used to remove selected communities from inbound and outbound routes. When a community list is applied to a route for this purpose, each of the route's communities is submitted to the community list one at a time. Communities permitted by the list are removed from the route. Because communities are processed individually, a community list used to remove communities should not include the exact-match option on statements with multiple communities. Such statements can never match an individual community. When a route map statement includes both set community and set comm-list delete terms, the set comm-list delete term is processed first, and then the set community term (meaning that, communities are first removed, and then communities are added). To delete the set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| community-list-name | A standard community list name. |
set community
To modify the communities attribute of matching routes, use the set community command in Route Map Configuration mode. The set community command can be used to assign communities to routes originated through BGP's network and redistribute commands, and to set communities on routes received from a specific neighbor or advertised to a specific neighbor. It can also be used to remove all communities from a route. To remove a subset of the communities on a route, use the command "set comm-list delete". To remove a set term from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| community-number | One to sixteen community numbers, either as a 32-bit integers or in AA:NN format. Communities are separated by spaces. The well-known communities no advertise and no-export are also accepted. |
| additive | (Optional) Communities are added to those already attached to the route. |
| no-advertise | Matching route not to be advertised to any BGP peer. |
| no-export | Matching route not to be advertised to external BGP peer |
| none | Removes all communities from matching routes |
set interface
If network administrator does not want to revert to normal forwarding but instead want to drop a packet that does not match the specified criteria, a set statement needs to be configured to route the packets to interface null 0 as the last entry in the route-map. set interface null0 needs to be configured in a separate statement. It should not be added along with any other statement having other match/set terms. A route-map statement that is used for PBR is configured as permit or deny. If the statement is marked as deny, traditional destination-based routing is performed on the packet meeting the match criteria. If the statement is marked as permit, and if the packet meets all the match criteria, then set commands in the route-map statement are applied. If no match is found in the route-map, the packet is not dropped; instead the packet is forwarded using the routing decision taken by performing destination-based routing. To remove a set term from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| null0 | Specify the destination interface to be null interface . |
set ip next-hop
Use this command to specify the adjacent next-hop router in the path toward the destination to which the packets should be forwarded. If more than one IP address is specified, the ECMP rule is used to route the packets. This command affects all incoming packet types and is always used if configured. If configured next-hop is not present in the routing table, an ARP request is sent from the router. In a route-map statement, 'set ip next-hop' and 'set ip default next-hop' terms are mutually exclusive. However, a 'set ip default next-hop' can be configured in a separate route-map statement. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| next-hop-address | The IP address of the next hop to which packets are output. It must be the address of an adjacent router. A maximum of 16 next-hop IP addresses can be specified in this 'set' clause. |
set ip default next-hop
Use this command to set a list of default next-hop IP addresses. If more than one IP address is specified, the ECMP rule is used. A packet is routed to the next hop specified by this command only if there is no explicit route for the packet's destination address in the routing table. A default route in the routing table is not considered an explicit route for an unknown destination address. In a route-map statement, 'set ip next-hop' and 'set ip default next-hop' terms are mutually exclusive. However, a 'set ip next-hop' can be configured in a separate route-map statement. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| next-hop-address | The IP address of the next hop to which packets are output. It must be the address of an adjacent router. A maximum of 16 next-hop IP addresses can be specified in this 'set' clause. |
set ip precedence
Use this command to set the three IP precedence bits in the IP packet header. With three bits, you have eight possible values for the IP precedence; values 0 through 7 are defined. This command is used when implementing QoS and can be used by other QoS services, such as weighted fair queuing (WFQ) and weighted random early detection (WRED).
To reset the three IP precedence bits in the IP packet header to the default, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| 0 | Sets the routine precedence. |
| 1 | Sets the priority precedence. |
| 2 | Sets the immediate precedence. |
| 3 | Sets the Flash precedence. |
| 4 | Sets the Flash override precedence. |
| 5 | Sets the critical precedence. |
| 6 | Sets the internetwork control precedence. |
| 7 | Sets the network control precedence. |
set ipv6 next-hop
Use this command to set the IPv6 next hop of a route. When used in a route map applied to UPDATE messages received from a neighbor, the command sets the next hop address for matching IPv6 routes received from the neighbor. When used in a route map applied to UPDATE messages sent to a neighbor, the command sets the next hop address for matching IPv6 routes sent to the neighbor. If the address is a link local address, the address is assumed to be on the interface where UPDATE is received or sent. If the command specifies a global IPv6 address, the address is not required to be on a local subnet. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| Next-hop-ipv6-address | The IPv6 address set as the Network Address of Next Hop field in the MP_NLRI attribute of an UPDATE message. |
set local-preference
To set the local preference of specific BGP routes, use the set local-preference command in Route Map Configuration mode. The local preference is the first attribute used to compare BGP routes. Setting the local preference can influence which route BGP selects as the best route. When used in conjunction with a 'match as-path' or 'match ip address' command, this command can be used to prefer routes that transit certain ASs or to make the local router a more preferred exit point to certain destinations. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| value | A local preference value, from 0 to 4,294,967,295 (any 32-bit integer). |
set metric
To set the metric of a route, use the set metric command in Route Map Configuration mode. This command sets the Multi Exit Discriminator (MED) when used in a BGP context. When there are multiple peering points between two autonomous systems (AS), setting the MED on routes advertised by one router can influence the other AS to send traffic through a specific peer. To remove a set command from a route map, use the no form of this command.
| Default | None |
| Format |
|
| Mode | Route Map Config |
| Fields | Definition |
|---|---|
| value | A metric value, from 0 to 4,294,967,295 (any 32-bit integer). |
clear ip prefix-list
To reset IP prefix-list counters, use the clear ip prefix-list command in Privileged EXEC mode. This command is used to clear prefix-list hit counters. The hit count is a value indicating the number of matches to a specific prefix list entry.
| Default | None |
| Format | clear ip prefix-list [[list-name] [prefix/length]] |
| Mode | Privileged Exec |
| Fields | Definition |
|---|---|
| list-name | (Optional) Name of the prefix list from which the hit count is to be cleared. |
| prefix/length | (Optional) Network number and length (in bits) of the network mask. If this option is specified, hit counters are only cleared for the matching statement. |
clear ipv6 prefix-list
To reset IPv6 prefix-list counters, use the clear ipv6 prefix-list command in Privileged EXEC mode. This command is used to clear IPv6 prefix-list hit counters. The hit count is a value indicating the number of matches to a specific prefix list entry.
| Default | None |
| Format | clear ipv6 prefix-list [[list-name] [ipv6-prefix/prefix-length]] |
| Mode | Privileged Exec |
| Fields | Definition |
|---|---|
| list-name | (Optional) Name of the prefix list from which the hit count is to be cleared. |
| ipv6-prefix/prefix-length | (Optional) IPv6 prefix number and length (in bits) of the network mask. If this option is specified, hit counters are only cleared for the matching statement. |