Skip to content

Commit

Permalink
feat: add interpret-communities option
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Dec 16, 2021
1 parent 7ab4779 commit dba40d5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 28 deletions.
2 changes: 1 addition & 1 deletion docs/docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: About
sidebar_position: 1
---

<img src="https://pathvector.io/img/black-border.svg" height="200" />
<img alt="Pathvector Logo" src="https://pathvector.io/img/black-border.svg" height="200" />

Pathvector is a declarative edge routing platform that automates route optimization and control plane configuration with secure and repeatable routing policy.

Expand Down
8 changes: 8 additions & 0 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,14 @@ RFC 5082 Generalized TTL Security Mechanism
|------|---------|------------|
| bool | false | |

### `interpret-communities`

Should well-known BGP communities be interpreted by their intended action?

| Type | Default | Validation |
|------|---------|------------|
| bool | true | |

### `import-communities`

List of communities to add to all imported routes
Expand Down
1 change: 1 addition & 0 deletions internal/embed/templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $af }} {
{{ if BoolDeref $peer.AllowLocalAS }}allow local as ASN;{{ end }}
{{ if BoolDeref $peer.TTLSecurity }}ttl security on;{{ end }}
{{ if BoolDeref $peer.ConfederationMember }}confederation member yes;{{ end }}
{{ if not (BoolDeref $peer.InterpretCommunities) }}interpret communities off;{{ end }}
{{ if IntDeref $peer.Confederation }}confederation {{ IntDeref $peer.Confederation }};{{ end }}
{{ StrDeref $peer.SessionGlobal }}
{{ $protocols := MakeSlice }}
Expand Down
55 changes: 28 additions & 27 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,34 @@ type Peer struct {
Disabled *bool `yaml:"disabled" description:"Should the sessions be disabled?" default:"false"`

// BGP Attributes
ASN *int `yaml:"asn" description:"Local ASN" validate:"required" default:"0"`
NeighborIPs *[]string `yaml:"neighbors" description:"List of neighbor IPs" validate:"required,ip" default:"-"`
Prepends *int `yaml:"prepends" description:"Number of times to prepend local AS on export" default:"0"`
LocalPref *int `yaml:"local-pref" description:"BGP local preference" default:"100"`
Multihop *bool `yaml:"multihop" description:"Should BGP multihop be enabled? (255 max hops)" default:"false"`
Listen4 *string `yaml:"listen4" description:"IPv4 BGP listen address" default:"-"`
Listen6 *string `yaml:"listen6" description:"IPv6 BGP listen address" default:"-"`
LocalASN *int `yaml:"local-asn" description:"Local ASN as defined in the global ASN field" default:"-"`
LocalPort *int `yaml:"local-port" description:"Local TCP port" default:"179"`
NeighborPort *int `yaml:"neighbor-port" description:"Neighbor TCP port" default:"179"`
Passive *bool `yaml:"passive" description:"Should we listen passively?" default:"false"`
Direct *bool `yaml:"direct" description:"Specify that the neighbor is directly connected" default:"false"`
NextHopSelf *bool `yaml:"next-hop-self" description:"Should BGP next-hop-self be enabled?" default:"false"`
BFD *bool `yaml:"bfd" description:"Should BFD be enabled?" default:"false"`
Password *string `yaml:"password" description:"BGP MD5 password" default:"-"`
RSClient *bool `yaml:"rs-client" description:"Should this peer be a route server client?" default:"false"`
RRClient *bool `yaml:"rr-client" description:"Should this peer be a route reflector client?" default:"false"`
RemovePrivateASNs *bool `yaml:"remove-private-asns" description:"Should private ASNs be removed from path before exporting?" default:"true"`
MPUnicast46 *bool `yaml:"mp-unicast-46" description:"Should this peer be configured with multiprotocol IPv4 and IPv6 unicast?" default:"false"`
AllowLocalAS *bool `yaml:"allow-local-as" description:"Should routes originated by the local ASN be accepted?" default:"false"`
AddPathTx *bool `yaml:"add-path-tx" description:"Enable BGP additional paths on export?" default:"false"`
AddPathRx *bool `yaml:"add-path-rx" description:"Enable BGP additional paths on import?" default:"false"`
ImportNextHop *string `yaml:"import-next-hop" description:"Rewrite the BGP next hop before importing routes learned from this peer" default:"-"`
ExportNextHop *string `yaml:"export-next-hop" description:"Rewrite the BGP next hop before announcing routes to this peer" default:"-"`
Confederation *int `yaml:"confederation" description:"BGP confederation (RFC 5065)" default:"-"`
ConfederationMember *bool `yaml:"confederation-member" description:"Should this peer be a member of the local confederation?" default:"false"`
TTLSecurity *bool `yaml:"ttl-security" description:"RFC 5082 Generalized TTL Security Mechanism" default:"false"`
ASN *int `yaml:"asn" description:"Local ASN" validate:"required" default:"0"`
NeighborIPs *[]string `yaml:"neighbors" description:"List of neighbor IPs" validate:"required,ip" default:"-"`
Prepends *int `yaml:"prepends" description:"Number of times to prepend local AS on export" default:"0"`
LocalPref *int `yaml:"local-pref" description:"BGP local preference" default:"100"`
Multihop *bool `yaml:"multihop" description:"Should BGP multihop be enabled? (255 max hops)" default:"false"`
Listen4 *string `yaml:"listen4" description:"IPv4 BGP listen address" default:"-"`
Listen6 *string `yaml:"listen6" description:"IPv6 BGP listen address" default:"-"`
LocalASN *int `yaml:"local-asn" description:"Local ASN as defined in the global ASN field" default:"-"`
LocalPort *int `yaml:"local-port" description:"Local TCP port" default:"179"`
NeighborPort *int `yaml:"neighbor-port" description:"Neighbor TCP port" default:"179"`
Passive *bool `yaml:"passive" description:"Should we listen passively?" default:"false"`
Direct *bool `yaml:"direct" description:"Specify that the neighbor is directly connected" default:"false"`
NextHopSelf *bool `yaml:"next-hop-self" description:"Should BGP next-hop-self be enabled?" default:"false"`
BFD *bool `yaml:"bfd" description:"Should BFD be enabled?" default:"false"`
Password *string `yaml:"password" description:"BGP MD5 password" default:"-"`
RSClient *bool `yaml:"rs-client" description:"Should this peer be a route server client?" default:"false"`
RRClient *bool `yaml:"rr-client" description:"Should this peer be a route reflector client?" default:"false"`
RemovePrivateASNs *bool `yaml:"remove-private-asns" description:"Should private ASNs be removed from path before exporting?" default:"true"`
MPUnicast46 *bool `yaml:"mp-unicast-46" description:"Should this peer be configured with multiprotocol IPv4 and IPv6 unicast?" default:"false"`
AllowLocalAS *bool `yaml:"allow-local-as" description:"Should routes originated by the local ASN be accepted?" default:"false"`
AddPathTx *bool `yaml:"add-path-tx" description:"Enable BGP additional paths on export?" default:"false"`
AddPathRx *bool `yaml:"add-path-rx" description:"Enable BGP additional paths on import?" default:"false"`
ImportNextHop *string `yaml:"import-next-hop" description:"Rewrite the BGP next hop before importing routes learned from this peer" default:"-"`
ExportNextHop *string `yaml:"export-next-hop" description:"Rewrite the BGP next hop before announcing routes to this peer" default:"-"`
Confederation *int `yaml:"confederation" description:"BGP confederation (RFC 5065)" default:"-"`
ConfederationMember *bool `yaml:"confederation-member" description:"Should this peer be a member of the local confederation?" default:"false"`
TTLSecurity *bool `yaml:"ttl-security" description:"RFC 5082 Generalized TTL Security Mechanism" default:"false"`
InterpretCommunities *bool `yaml:"interpret-communities" description:"Should well-known BGP communities be interpreted by their intended action?" default:"true"`

ImportCommunities *[]string `yaml:"import-communities" description:"List of communities to add to all imported routes" default:"-"`
ExportCommunities *[]string `yaml:"export-communities" description:"List of communities to add to all exported routes" default:"-"`
Expand Down

0 comments on commit dba40d5

Please sign in to comment.