diff options
-rw-r--r-- | cmd/gobgp/cmd/neighbor.go | 15 | ||||
-rw-r--r-- | docs/sources/cli-command-syntax.md | 2 |
2 files changed, 15 insertions, 2 deletions
diff --git a/cmd/gobgp/cmd/neighbor.go b/cmd/gobgp/cmd/neighbor.go index ad946e5b..9b1e96ee 100644 --- a/cmd/gobgp/cmd/neighbor.go +++ b/cmd/gobgp/cmd/neighbor.go @@ -1044,7 +1044,8 @@ func modNeighbor(cmdType string, args []string) error { params["allow-own-as"] = PARAM_SINGLE params["remove-private-as"] = PARAM_SINGLE params["replace-peer-as"] = PARAM_FLAG - usage += " [ family <address-families-list> | vrf <vrf-name> | route-reflector-client [<cluster-id>] | route-server-client | allow-own-as <num> | remove-private-as (all|replace) | replace-peer-as ]" + params["ebgp-multihop-ttl"] = PARAM_SINGLE + usage += " [ family <address-families-list> | vrf <vrf-name> | route-reflector-client [<cluster-id>] | route-server-client | allow-own-as <num> | remove-private-as (all|replace) | replace-peer-as | ebgp-multihop-ttl <ttl>]" } m, err := extractReserved(args, params) @@ -1146,6 +1147,18 @@ func modNeighbor(cmdType string, args []string) error { if _, ok := m["replace-peer-as"]; ok { peer.AsPathOptions.Config.ReplacePeerAs = true } + if len(m["ebgp-multihop-ttl"]) == 1 { + ttl, err := strconv.ParseUint(m["ebgp-multihop-ttl"][0], 10, 32) + if err != nil { + return err + } + peer.EbgpMultihop = config.EbgpMultihop{ + Config: config.EbgpMultihopConfig{ + Enabled: true, + MultihopTtl: uint8(ttl), + }, + } + } return nil } diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md index 232f1577..a6ac362b 100644 --- a/docs/sources/cli-command-syntax.md +++ b/docs/sources/cli-command-syntax.md @@ -126,7 +126,7 @@ Also, refer to the following for the detail syntax of each address family. ```shell # add neighbor -% gobgp neighbor add { <neighbor address> | interface <ifname> } as <as number> [ vrf <vrf-name> | route-reflector-client [<cluster-id>] | route-server-client | allow-own-as <num> | remove-private-as (all|replace) | replace-peer-as ] +% gobgp neighbor add { <neighbor address> | interface <ifname> } as <as number> [ vrf <vrf-name> | route-reflector-client [<cluster-id>] | route-server-client | allow-own-as <num> | remove-private-as (all|replace) | replace-peer-as | ebgp-multihop-ttl <ttl>] # delete neighbor % gobgp neighbor delete { <neighbor address> | interface <ifname> } % gobgp neighbor <neighbor address> softreset [-a <address family>] |