diff options
| author | Francois Dumontet <francois.dumontet@6wind.com> | 2023-07-11 10:03:04 +0200 |
|---|---|---|
| committer | Francois Dumontet <francois.dumontet@6wind.com> | 2023-08-07 12:30:34 +0200 |
| commit | 958340e935350f840e31a0405b492e6ac7dfe13b (patch) | |
| tree | 7b37d33110cacc7043d811916074d1e13953c5ff /bgpd/bgp_aspath.h | |
| parent | 529203905b6bbb1c78cf806d1f808eed41a182d7 (diff) | |
bgpd: add set as-path exclude acl-list command
A route-map applied on incoming BGP updates is not able
to replace an unwanted as segments by another one.
unwanted as segment are 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 replace as-path-access-list RULE 6000
```
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
6000 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)
```
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 b1a61d5b99..ebfc7d087d 100644 --- a/bgpd/bgp_aspath.h +++ b/bgpd/bgp_aspath.h @@ -107,6 +107,9 @@ extern unsigned int aspath_get_last_as(struct aspath *aspath); extern int aspath_loop_check(struct aspath *aspath, as_t asno); extern int aspath_loop_check_confed(struct aspath *aspath, as_t asno); extern bool aspath_private_as_check(struct aspath *aspath); +extern struct aspath *aspath_replace_regex_asn(struct aspath *aspath, + struct as_list *acl_list, + as_t our_asn); extern struct aspath *aspath_replace_specific_asn(struct aspath *aspath, as_t target_asn, as_t our_asn); |
