【问题标题】:usage of yang model ietf-routingyang模型ietf-routing的使用
【发布时间】:2021-03-28 08:43:16
【问题描述】:

我正在尝试根据这些 yang 模块添加配置数据:

https://github.com/mbj4668/pyang/blob/master/modules/ietf/ietf-routing.yang

https://github.com/mbj4668/pyang/blob/master/modules/ietf/ietf-ipv4-unicast-routing.yang

尝试将"next-hop-list" 与以下数据一起使用时,我收到错误sysrepocfg error: libyang: Unknown element "next-hop-list"

   {
    "ietf-routing:routing": {
        "control-plane-protocols": {
            "control-plane-protocol": [
                {
                    "type": "static",
                    "name": "static-routing-protocol",
                    "static-routes": {
                        "ietf-ipv4-unicast-routing:ipv4": {
                            "route": [
                                {
                                    "destination-prefix": "0.0.0.0/0",
                                    "next-hop-list": {
                                        "next-hop": [
                                            {
                                                "index": "1",
                                                "next-hop-address": "192.0.2.2"
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}

无法找出错误,有什么帮助吗?

我可以将"simple-next-hop" 与以下数据一起使用,效果很好。

{
    "ietf-routing:routing": {
        "control-plane-protocols": {
            "control-plane-protocol": [
                {
                    "type": "static",
                    "name": "static-routing-protocol",
                    "static-routes": {
                        "ietf-ipv4-unicast-routing:ipv4": {
                            "route": [
                                {
                                    "destination-prefix": "0.0.0.0/0",
                                    "next-hop": {
                                        "next-hop-address": "192.0.2.2"
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}

【问题讨论】:

    标签: json routes ietf-netmod-yang ietf-netconf yang


    【解决方案1】:

    修好了! 'next-hop-list' 必须在 'next-hop' 内。

    {
      "ietf-routing:routing": {
        "control-plane-protocols": {
          "control-plane-protocol": [
            {
              "type": "static",
              "name": "static-routing-protocol",
              "static-routes": {
                "ietf-ipv4-unicast-routing:ipv4": {
                  "route": [
                    {
                      "destination-prefix": "0.0.0.0/0",
                      "next-hop": {
                        "next-hop-list": {
                          "next-hop": [
                            {
                              "index": "1",
                              "next-hop-address": "192.0.2.2"
                            },
                            {
                              "index": "2",
                              "next-hop-address": "192.0.2.3"
                            }
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          ]
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-14
      • 2020-02-19
      • 2020-07-04
      • 1970-01-01
      相关资源
      最近更新 更多