summaryrefslogtreecommitdiff
path: root/bgpd/bgp_community.h
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-01-21 15:03:40 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-01-21 16:00:53 +0200
commit2721dd613f5f456920b76fd1ed6de2422dc73c71 (patch)
tree6b74acea19c4b5609517169e4fbcf1e390f33b90 /bgpd/bgp_community.h
parent7dac521ffbcd3744b9f43ca45c862eac67e148cf (diff)
bgpd: Set NO_ADVERTISE community if blackhole community received
rfc7999: A BGP speaker receiving an announcement tagged with the BLACKHOLE community SHOULD add the NO_ADVERTISE or NO_EXPORT community as defined in [RFC1997], or a similar community, to prevent propagation of the prefix outside the local AS. The community to prevent propagation SHOULD be chosen according to the operator's routing policy. Sent: ``` router bgp 65534 no bgp ebgp-requires-policy neighbor 192.168.0.2 remote-as 65030 ! address-family ipv4 unicast redistribute connected neighbor 192.168.0.2 route-map spine out exit-address-family ! ! ip prefix-list self seq 5 permit 192.168.100.1/32 ! route-map spine permit 10 match ip address prefix-list self set community blackhole ! ``` Received: ``` spine1-debian-9# show ip bgp 192.168.100.1/32 BGP routing table entry for 192.168.100.1/32 Paths: (1 available, best #1, table default, inform peer to blackhole prefix) Not advertised to any peer 65534 192.168.0.1 from 192.168.0.1 (192.168.100.1) Origin incomplete, metric 0, valid, external, best (First path received) Community: blackhole no-advertise Last update: Thu Jan 21 12:56:39 2021 ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'bgpd/bgp_community.h')
-rw-r--r--bgpd/bgp_community.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_community.h b/bgpd/bgp_community.h
index b99f38ab64..2a1fbf526a 100644
--- a/bgpd/bgp_community.h
+++ b/bgpd/bgp_community.h
@@ -88,6 +88,7 @@ extern struct community *community_delete(struct community *,
struct community *);
extern struct community *community_dup(struct community *);
extern bool community_include(struct community *, uint32_t);
+extern void community_add_val(struct community *com, uint32_t val);
extern void community_del_val(struct community *, uint32_t *);
extern unsigned long community_count(void);
extern struct hash *community_hash(void);