usage of yang model ietf-routing

249 views Asked by At

I am trying to add config data according to these yang modules:

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

I am getting error sysrepocfg error: libyang: Unknown element "next-hop-list" when trying to use "next-hop-list" with below data.

   {
    "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.

{
    "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"
                                    }
                                }
                            ]
                        }
                    }
                }
            ]
        }
    }
}
1

There are 1 answers

0
m.divya.mohan On BEST ANSWER

Fixed it! 'next-hop-list' had to be inside '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"
                        }
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}