summaryrefslogtreecommitdiff
path: root/yang/frr-bgp-route-map.yang
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-04-25 10:34:36 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-04-25 14:05:22 +0300
commit77e3d82167b97a1ff4abe59d6e4f12086a61d9f9 (patch)
tree5c68e86eaa6fd6b9734e40928b6bee1390377299 /yang/frr-bgp-route-map.yang
parentc27892b24d21762f3cd4276fa2cca75c958f9b15 (diff)
bgpd: Add `set as-path replace <any|ASN>` cmd for route-maps
``` route-map tstas permit 10 set as-path replace 1 exit ``` Before: ``` donatas-laptop(config-router-af)# do show ip bgp 10.10.10.10/32 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) Last update: Mon Apr 25 10:39:50 2022 ``` After: ``` donatas-laptop(config-router-af)# 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 65000 65010 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) Last update: Mon Apr 25 10:40:16 2022 ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'yang/frr-bgp-route-map.yang')
-rw-r--r--yang/frr-bgp-route-map.yang15
1 files changed, 15 insertions, 0 deletions
diff --git a/yang/frr-bgp-route-map.yang b/yang/frr-bgp-route-map.yang
index 74008bc078..eaa7891f0c 100644
--- a/yang/frr-bgp-route-map.yang
+++ b/yang/frr-bgp-route-map.yang
@@ -282,6 +282,12 @@ module frr-bgp-route-map {
"Set the BGP AS-path attribute";
}
+ identity as-path-replace {
+ base frr-route-map:rmap-set-type;
+ description
+ "Replace ASNs to local AS number";
+ }
+
identity set-community {
base frr-route-map:rmap-set-type;
description
@@ -793,6 +799,15 @@ module frr-bgp-route-map {
}
}
+ case as-path-replace {
+ when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:as-path-replace')";
+ leaf replace-as-path {
+ type string;
+ description
+ "Replace ASNs to local AS number";
+ }
+ }
+
case community {
when "derived-from-or-self(/frr-route-map:lib/frr-route-map:route-map/frr-route-map:entry/frr-route-map:set-action/frr-route-map:action, 'frr-bgp-route-map:set-community')";
choice community {