diff options
author | Francois Dumontet <francois.dumontet@6wind.com> | 2023-07-12 19:44:02 +0200 |
---|---|---|
committer | Francois Dumontet <francois.dumontet@6wind.com> | 2023-07-19 10:57:48 +0200 |
commit | 4685db418e3a861205a28f975afeb9869f674337 (patch) | |
tree | 88b1f16aa91218014d377b060449a611fca2e7a6 /bgpd/bgp_aspath.h | |
parent | Merge pull request #10136 from idryzhov/frr-reload-exit (diff) | |
download | frr-4685db418e3a861205a28f975afeb9869f674337.tar.xz frr-4685db418e3a861205a28f975afeb9869f674337.zip |
bgpd: add set as-path exclude acl-list command
A route-map applied on incoming BGP updates is not able
to exclude the unwanted as segments, based on an AS path
access-list.
The below configuration illustrates the case:
router bgp 65001
address-family ipv4 unicast
neighbor 192.168.1.2 route-map rule_2 in
exit-address-family
bgp as-path access-list RULE permit ^65
route-map rule_2 permit 10
set as-path exclude as-path-access-list RULE
```
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
Advertised to non peer-group peers:
192.168.10.65
65000 1 2 3 123
192.168.10.65 from 192.168.10.65 (10.10.10.11)
Origin IGP, metric 0, valid, external, best (First path received)
```
After:
```
do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
Paths: (1 available, best #1, table default)
Advertised to non peer-group peers:
192.168.10.65
2 3 123
192.168.10.65 from 192.168.10.65 (10.10.10.11)
Origin IGP, metric 0, valid, external, best (First path
received)
```
Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Diffstat (limited to 'bgpd/bgp_aspath.h')
-rw-r--r-- | bgpd/bgp_aspath.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h index a3aae14f8..b1a61d5b9 100644 --- a/bgpd/bgp_aspath.h +++ b/bgpd/bgp_aspath.h @@ -8,6 +8,7 @@ #include "lib/json.h" #include "bgpd/bgp_route.h" +#include "bgpd/bgp_filter.h" /* AS path segment type. */ #define AS_SET 1 @@ -77,6 +78,8 @@ extern struct aspath *aspath_prepend(struct aspath *as1, struct aspath *as2); extern struct aspath *aspath_filter_exclude(struct aspath *source, struct aspath *exclude_list); extern struct aspath *aspath_filter_exclude_all(struct aspath *source); +extern struct aspath *aspath_filter_exclude_acl(struct aspath *source, + struct as_list *acl_list); extern struct aspath *aspath_add_seq_n(struct aspath *aspath, as_t asno, unsigned num); extern struct aspath *aspath_add_seq(struct aspath *aspath, as_t asno); |