match (bgp-route-map)

Configures the match criteria associated with this deny or permit BGP route map

Supported in the following platforms:

Syntax

match [as-path|community|extcommunity|ip-address|ip-next-hop|ip-route-source|metric|origin|tag]
match [as-path <AS-PATH-LIST-NAME>|community <COMMUNITY-LIST-NAME> {exact-match}|
extcommunity <EXTCOMMUNITY-LIST-NAME>]
match [ip-address|ip-next-hop|ip-route-source] [BGP-IP-ACCESS-LIST <BGP-ACL-NAME>|prefix-list <PREFIX-LIST-NAME>]
match metric <0-4294967295>
match origin [egp|igp|incomplete]
match tag <0-65535>

Parameters

match [as-path <AS-PATH-LIST-NAME>|community <COMMUNITY-LIST-NAME> {exact-match}|
extcommunity <EXTCOMMUNITY-LIST-NAME>]
as-path <AS-PATH-LIST-NAME> Configures a BGP AS path list to match
An AS path is a list of ASs a packet traverses to reach its destination.
  • <AS-PATH-LIST-NAME> – Specify the AS path list name (should be existing and configured)
community <COMMUNITY-LIST-NAME> {exact-match} Configures the AS community list string to match
  • <COMMUNITY-LIST-NAME> – Specify the AS community list name (should be existing and configured).
    • exact-match – Optional. Does an exact match when matching the specified AS community string. This option is disabled by default.
extcommunity <EXTCOMMUNITY-LIST-NAME> Configures the external community list string to match
  • <EXTCOMMUNITY-LIST-NAME> – Specify the external community list name (should be existing and configured).
match [ip-address|ip-next-hop|ip-route-source] [BGP-IP-ACCESS-LIST <BGP-ACL-NAME>|
prefix-list <PREFIX-LIST-NAME>]
match Configures match criteria used to filter BGP routes when forwarding packets
ip-address [BGP-IP-ACCESS-LIST <BGP-ACL-NAME>| prefix-list <PREFIX-LIST-NAME>] Configures a string of IP addresses, in the route, to match
The IP Address is a list of IP addresses in the route used to filter the route. Use one of the following options to provide a list of IP addresses:
  • BGP-IP-ACCESS-LIST <BGP-ACL-NAME> – Associates an existing BGP ACL with this BGP route map. Specify the BGP ACL name (should be existing and configured).
  • prefix-list <PREFIX-LIST-NAME> – Associates an existing IP address prefix list with this BGP route map. The IP Address Prefix List is a list of prefixes in the route used to filter route. Specify the prefix list name (should be existing and configured).
ip-next-hop [BGP-IP-ACCESS-LIST <BGP-ACL-NAME>| prefix-list <PREFIX-LIST-NAME>] Configures the next-hop‘s IP address to match
The IP Next Hop is a list of IP addresses used to filter routes based on the IP address of the next-hop in the route. Use one of the following options to provide next-hop‘s IP addresses:
  • BGP-IP-ACCESS-LIST <BGP-ACL-NAME> – Associates an existing BGP ACL with this BGP route map. Specify the BGP ACL name (should be existing and configured).
  • prefix-list <PREFIX-LIST-NAME> – Associates an existing IP next-hop prefix list with this BGP route map. The IP Next Hop Prefix List is a list of prefixes for the route‘s next-hop determining how the route is filtered. Specify the prefix list name (should be existing and configured).
ip-route-source [BGP-IP-ACCESS-LIST <BGP-ACL-NAME>| prefix-list <PREFIX-LIST-NAME>]

Configures the advertised route source IP address to match

The IP Route Source is a list of IP addresses used to filter routes based on the advertised IP address of the source. Use one of the following options to provide route-source IP addresses:
  • BGP-IP-ACCESS-LIST <BGP-ACL-NAME> – Associates an existing BGP ACL with this BGP route map. Specify the BGP ACL name (should be existing and configured).
  • prefix-list <PREFIX-LIST-NAME> – Associates an existing IP route source prefix list with this BGP route map. The IP Route Source Prefix List is a list of prefixes used to filter routes based on the prefix list used for the source. Specify the prefix list name (should be existing and configured).
match metric <0-4294967295>
match metric <0-4294967295> Defines the exterior metric, used for route map distribution, to match
BGP uses a route table managed by the external metric defined. Setting a metric provides a dynamic way to load balance between routes of equal cost.
  • <0-4294967295> – Specify the external metric value from 0 - 4294967295.
match origin [egp|igp|incomplete]
match origin [egp|igp|incomplete] Configures the source of the BGP route to match. Options include:
  • egp – Matches if the origin of the route is from the eBGP. eBGP exchanges routing table information between hosts outside an autonomous system.
  • igp – Matches if the origin of the route is from the iBGP. iBGP exchanges routing table information between routers within an autonomous system.
  • incomplete – Matches if the origin of the route is not identifiable
match tag <0-65535>
match tag <0-65535> Configures the BGP route tag to match
The Tag is a way to preserve a route‘s AS path information for routers in iBGP. This option is disabled by default.
  • <0-65535> – Specify the iBGP route‘s tag from 0 - 65535.

Examples

The following examples show the configuration of match criteria for the deny route-map rule 1:

nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-1)#match as-path Filter List_01
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-1)#match ip-route-source prefix-list PrefixList_01
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-1)#show context
 deny route-map 1
  description "This is a deny route map rule"
  match as-path FilterList_01
  match ip-route-source prefix-list PrefixList_01
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-1)#
A permit route-map rule 2 is added to the BGP route-map “test”.
nx9500-6C8809(config-dr-route-map-test)#permit route-map 2
A match criteria is added for the permit route-map rule 2.
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-2)#match ip-next-hop DL_01
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-2)#show context
 permit route-map 2
  match ip-next-hop DL_01
nx9500-6C8809(config-dr-route-map-test-dr-route-map-rule-2)#
The following example displays the BGP route-map “test” settings:
nx9500-6C8809(config-dr-route-map-test)#show context
route-map test
 deny route-map 1
  description "This is a deny route map rule"
  match as-path FilterList_01
  match ip-route-source prefix-list PrefixList_01
 permit route-map 2
  match ip-next-hop DL_01
nx9500-6C8809(config-dr-route-map-test)#

Related Commands

no (bgp-route-map) Removes match criteria associated with a deny or permit route-map rule