]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: add set as-path exclude acl-list command
authorFrancois Dumontet <francois.dumontet@6wind.com>
Tue, 11 Jul 2023 08:03:04 +0000 (10:03 +0200)
committerFrancois Dumontet <francois.dumontet@6wind.com>
Mon, 7 Aug 2023 10:30:34 +0000 (12:30 +0200)
commit958340e935350f840e31a0405b492e6ac7dfe13b
tree7b37d33110cacc7043d811916074d1e13953c5ff
parent529203905b6bbb1c78cf806d1f808eed41a182d7
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>
bgpd/bgp_aspath.c
bgpd/bgp_aspath.h
bgpd/bgp_routemap.c