]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: add set as-path exclude acl-list command
authorFrancois Dumontet <francois.dumontet@6wind.com>
Wed, 12 Jul 2023 17:44:02 +0000 (19:44 +0200)
committerFrancois Dumontet <francois.dumontet@6wind.com>
Wed, 19 Jul 2023 08:57:48 +0000 (10:57 +0200)
commit4685db418e3a861205a28f975afeb9869f674337
tree88b1f16aa91218014d377b060449a611fca2e7a6
parent3c7eec962545dbd53a0ada64c349fe2673671e37
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>
bgpd/bgp_aspath.c
bgpd/bgp_aspath.h
bgpd/bgp_filter.c
bgpd/bgp_filter.h
bgpd/bgp_routemap.c