Configuring AS-path Lists
You can specify an AS-path list filter on BGP routes. Each filter is an access-list (ACL) based on regular expressions.
Example:
Create a BGP AS-path list using a regular expression.
switch# configure terminal
switch(config)# ip as-path access-list AllowAS permit 64510
switch(config)# ip as-path access-list AllowAll permit .*
switch(config)# ip as-path access-list AllowFrom_AS_100 permit ^100_[0-9]*$
switch(config)# router bgp 65000
switch(config-router)# neighbor 192.0.2.1 remote-as 65535
switch(config-router-neighbor)# address-family ipv4 unicast
switch(config-router-neighbor-af)# filter-list AllowAS in
Diagram
Classes
route_control (vxlan.overlay_extensions)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
ip_as_path_access_lists | List | [ip_as_path_access_lists] | No |
ip_as_path_access_lists (vxlan.overlay_extensions.route_control)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
name | String | Regex: ^[A-Za-z0-9-_]{1,63}$ | Yes | |
entries | List | [entries] | Yes |
entries (vxlan.overlay_extensions.route_control.ip_as_path_access_lists)
Name | Type | Constraint | Mandatory | Default Value |
---|---|---|---|---|
seq_number | Integer | min: 1 , max: 4294967294 | Yes | |
operation | Choice | permit , deny | Yes | |
bgp_as_paths_regex | String | Yes |
Examples
Example-1
This example will create an ip as-path named AllowAS
with an entry 10
which permit
BGP routes with the AS number 64510.
This ip AS-path list will be used in the group named ipaspath_RCtrlGrp
. This group is consumed by one switch named netascode-leaf1
.
ip as-path access-list AllowAS seq 10 permit "64510"
---
vxlan:
overlay_extensions:
route_control:
ip_as_path_access_lists:
- name: AllowAS
entries:
- seq_number: 10
operation: permit
bgp_as_paths_regex: '64510'
groups:
- name: ipaspath_RCtrlGrp
ip_as_path_access_lists:
- name: AllowAS
switches:
- name: netascode-leaf1
groups:
- ipaspath_RCtrlGrp
Example-2
This example will create an ip as-path named AllowAll
with an entry 10
which permit
all BGP routes.
This ip AS-path list will be used in the group named ipaspath_RCtrlGrp
. This group is consumed by one switch named netascode-leaf1
ip as-path access-list AllowAll seq 10 permit ".*"
---
vxlan:
overlay_extensions:
route_control:
ip_as_path_access_lists:
- name: AllowAll
entries:
- seq_number: 10
operation: permit
bgp_as_paths_regex: '.*'
groups:
- name: ipaspath_RCtrlGrp
ip_as_path_access_lists:
- name: AllowAll
switches:
- name: netascode-leaf1
groups:
- ipaspath_RCtrlGrp
Example-3
This example will create an ip as-path named AllowFrom_AS_100
with an entry 10
which permit
all BGP routes.
This ip AS-path list will be used in the group named ipaspath_RCtrlGrp
. This group is consumed by one switch named netascode-leaf1
ip as-path access-list AllowFrom_AS_100 seq 10 permit "^100_[0-9]*$"
---
vxlan:
overlay_extensions:
route_control:
ip_as_path_access_lists:
- name: AllowFrom_AS_100
entries:
- seq_number: 10
operation: permit
bgp_as_paths_regex: '^100_[0-9]*$'
groups:
- name: ipaspath_RCtrlGrp
ip_as_path_access_lists:
- name: AllowFrom_AS_100
switches:
- name: netascode-leaf1
groups:
- ipaspath_RCtrlGrp
Note In the ip as-path access-list command, the carat (^) starts the input string and designates AS" The underscore (_) means there is a a null string in the string that comes after AS 100" The [0-9]* specifies that any connected AS with a valid AS number can pass the filter. The advantage with the [0-9]* syntax is that it gives you the flexibility to add any number of ASs without a modification to this command string. For additional information, see AS-Regular Expression.