Skip to content

Commit

Permalink
add no export to upstream community
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Dec 4, 2020
1 parent fa25af8 commit 2674cec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ bcg *should* have reasonable single-stack peering support but is not fully teste
#### BGP Communities
bcg uses RFC 8092 BGP Large Communities
| Large | Meaning |
|-----------|-------------------------|
| ASN,0,100 | Originated |
| ASN,0,101 | Learned from upstream |
| ASN,0,102 | Learned from peer |
| ASN,0,103 | Learned from downstream |
| Large | Meaning |
|-----------|---------------------------|
| ASN,0,100 | Originated |
| ASN,0,101 | Learned from upstream |
| ASN,0,102 | Learned from peer |
| ASN,0,103 | Learned from downstream |
| ASN,0,200 | Don't export to upstreams |
#### Global Configuration Options
Expand Down
1 change: 1 addition & 0 deletions templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ protocol bgp {{ $peer.Name }}v{{ $af }}_{{ $i }} {
accept_local(); # Originated
{{ end -}}
{{ if eq $peer.Type "upstream" -}}
if ((ASN,0,200) ~ bgp_large_community) then reject; # Don't export to upstreams
if ((ASN,0,103) ~ bgp_large_community) then accept; # Downstream
{{ else if or (eq $peer.Type "peer") (eq $peer.Type "import-valid") -}}
if ((ASN,0,103) ~ bgp_large_community) then accept; # Downstream
Expand Down

0 comments on commit 2674cec

Please sign in to comment.