Router中使用routers字段表示路由表,这是一个数组,每个元组的类型是[desnination,nexthop],其中destination表示目的网段(cidr),nexthop表示下一跳的IP,举例如下:
“routes”:[
{
“destination”:”10.50.10.0/24”
“nexthop”:”10.50.10.1”
}
{
“destination”:”10.60.10.0/24”
“nexthop”:”10.60.10.1”
}
]
首先要明确,这里的nexthop指的是“外部”路由的接口IP,如下图所示:
nexthop指的就是图中Port2的IP:10.50.10.1
我们再看看外部网关信息(external_gateway_info)图。
该图中,在Router上对应端口(Port1),Neutron会自动创建,但是这里,如第一张图对应的端口(Port1),Neutron却不会主动创建,需要通过调用接口add_router_interface显示创建。这是为什么呢?这要从两者的模型(或者说参数)说起,如下表所示。