简体   繁体   English

yang model ietf-routing的用法

[英]usage of yang model ietf-routing

I am trying to add config data according to these yang modules:我正在尝试根据这些 yang 模块添加配置数据:

https://github.com/mbj4668/pyang/blob/master/modules/ietf/ietf-routing.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 https://github.com/mbj4668/pyang/blob/master/modules/ietf/ietf-ipv4-unicast-routing.yang

I am getting error sysrepocfg error: libyang: Unknown element "next-hop-list" when trying to use "next-hop-list" with below data.我收到错误sysrepocfg error: libyang: Unknown element "next-hop-list"尝试将"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"
                                            }
                                        ]
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}

Unable to figure out the error, any help?无法找出错误,有什么帮助吗?

I am able to use "simple-next-hop" with below data, that works fine.我可以对以下数据使用"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"
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}

Fixed it.解决它。 'next-hop-list' had to be inside 'next-hop'. '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"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM