summaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorchenhaiq@yunify.com <chenhaiq@yunify.com>2018-07-09 22:05:04 +0800
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-07-14 15:27:53 +0900
commit179824221b5fd135375c82c6291a2bcf1008902f (patch)
treee8bbd095173c373f69c243aaefaf6d41aaa5c9b8 /cmd
parentdd735314ce065cd5b170052fa0f8341ca5bf123f (diff)
cmd: implement ebgp-multihop-ttl option when add neighbor
Signed-off-by: Chen Haiquan <oc@yunify.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/gobgp/cmd/neighbor.go15
1 files changed, 14 insertions, 1 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
}