Thanks a lot, I am able to add route correctly.
One additional change I had to make in the postman request was to
change the "control-plane-protocol" from "test-routing-protocol-1" to
"learned-protocol-0"
"control-plane-protocol": [
{
"type": "static",
"name": "learned-protocol-0",
"description":"Test routing protocol",
"vpp-protocol-attributes": {
"primary-vrf": "0"
},
I did that to correct this error:
Caused by: java.lang.IllegalStateException: An attempt to assign
protocol test-routing-protocol-1 to table id 0. Table id already
assigned to protocol learned-protocol-0
Once that is done, I was able to add routing entry and its working
fine, but could not figure out what control-plane-protocol is and why
its default value is learned-protocol-0
Thanks and Regards,
Raj
On Wed, Jan 16, 2019 at 3:18 PM Michal Cmarada -X (mcmarada - PANTHEON
TECHNOLOGIES at Cisco) <mcmarada@...> wrote:
Hi,
In routing the primary VRF is the VRF id for both IPv4 and Ipv6. You should be able to add new tables using put (this will add vrf 0 and 1 for both IPV4 and IPV6):
http://localhost:8183/restconf/config/vpp-fib-table-management:fib-table-management/fib-tables/
{
"fib-tables": {
"table": [
{
"table-id": 0,
"address-family": "vpp-fib-table-management:ipv4",
"name": "ipv4-VRF:0"
},
{
"table-id": 0,
"address-family": "vpp-fib-table-management:ipv6",
"name": "ipv6-VRF:0"
},
{
"table-id": 1,
"address-family": "vpp-fib-table-management:ipv4",
"name": "ipv4-VRF:1"
},
{
"table-id": 1,
"address-family": "vpp-fib-table-management:ipv6",
"name": "ipv6-VRF:1"
}
]
}
}
Fib tables in Honeycomb are equivalent to "vppctl ip table add" and "vppctl ip6 table add" commands.
After that you should be able to add static routes for specified vrf (equivalent of "vppctl ip route add ..." command).
classify-table is used to set index for classify table (classify-idx) for this route. I believe you can omit this for your use case. You would need to set up classify tables first. You should remove the whole "vpp-ipv4-route" from your request.
Michal
-----Original Message-----
From: hc2vpp@... <hc2vpp@...> On Behalf Of Raj
Sent: Tuesday, January 15, 2019 9:39 AM
To: hc2vpp@...
Subject: [hc2vpp] Adding a static route
Hello all,
I am trying to setup a simple router, by assigning IP to two interfaces, LAN and WAN, and then adding a default route out via WAN interface. I am able to do this via debug command line, and now testing using netconf API.
These are the two commands I am using to set default route (not sure if its the correct usage)
ip route add 0.0.0.0/0 via abc.abc.abc.abc TenGigabitEthernet82/0/1 ip route add ::/0 via 2001:xx:xxx:10d::1 TenGigabitEthernet82/0/1
Checking the postman collection, I found an example which is used to set static routes:
POST to restconf/config/hc2vpp-ietf-routing:routing/ with:
{
"routing": {
"control-plane-protocols": {
"control-plane-protocol": [
{
"type": "static",
"name": "test-routing-protocol-1",
"description":"Test routing protocol",
"vpp-protocol-attributes": {
"primary-vrf": "1"
},
"static-routes":{
"ipv4":{
"route":[
{
"description":"Test static route single hop ipv4",
"destination-prefix":"192.168.2.3/32",
"next-hop": {
"next-hop-address" : "192.168.2.8",
"outgoing-interface": "local0"
},
"vpp-ipv4-route":{
"classify-table":"1"
}
}
]
}
}
}
]
}
}
}
In this example what is the meaning of "primary-vrf": "1" and "classify-table":"1"?
In the system I have only "ipv4-VRF:0" and "ipv6-VRF:0" setup.
Thanks and Regards,
Raj