Skip to content

Commit

Permalink
feat: add set-local-pref option
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Dec 17, 2021
1 parent dba40d5 commit d8df210
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,14 @@ BGP local preference
|------|---------|------------|
| int | 100 | |

### `set-local-pref`

Should an explicit local pref be set?

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

### `multihop`

Should BGP multihop be enabled? (255 max hops)
Expand Down
2 changes: 1 addition & 1 deletion internal/embed/templates/peer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protocol bgp {{ UniqueProtocolName $peer.ProtocolName $af }} {

{{ if BoolDeref $peer.AllowBlackholeCommunity }}process_blackholes();{{ end }}

bgp_local_pref = {{ $peer.LocalPref }}; # pathvector:localpref
{{ if BoolDeref $peer.SetLocalPref }}bgp_local_pref = {{ $peer.LocalPref }}; # pathvector:localpref{{ end }}

{{ if BoolDeref $peer.HonorGracefulShutdown }}honor_graceful_shutdown();{{ end }}

Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Peer struct {
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"`
SetLocalPref *bool `yaml:"set-local-pref" description:"Should an explicit local pref be set?" default:"true"`
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:"-"`
Expand Down

0 comments on commit d8df210

Please sign in to comment.