IPv6静态路由管理
本章节介绍IPv6静态路由管理的配置模型,以及配置的XML报文举例说明。
数据模型
IPv6静态路由管理的对应配置模型文件名为ietf-routing.yang、ietf-ipv6-unicast-routing.yang和huawei-ipv6-static-route.yang。
节点 |
说明 |
取值范围 |
备注 |
---|---|---|---|
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/huawei-ipv6-static-route:ipv6/route/destination-prefix |
指定目的IPv6地址和前缀长度。 |
格式为dest-ipv6-address/prefix-length:
|
NA |
/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/simple-next-hop |
指定下一跳出接口。 |
字符串形式,格式为interface-typeinterface-number,其中interface-type表示接口类型,interface-number表示接口编号。 |
NA |
/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/special-next-hop |
指定特殊下一跳。 |
当前仅支持黑洞类型:blackhole。 |
NA |
/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/next-hop-address |
指定下一跳IPv6地址。 |
点分十进制格式。 |
NA |
/ietf-ipv6-unicast-routing:ipv6/route/next-hop/next-hop-options/description |
指定IPv6静态路由描述信息。 |
字符串形式,支持空格,长度范围是1~80,不支持问号。 |
NA |
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/huawei-ipv6-static-route:ipv6/route/next-hop-options/multiple-path/ipv6-address-nexthop |
指定IPv6静态路由的下一跳IPv6地址信息,通过该节点的子节点进行相应配置:
|
各子节点取值如下:
|
NA |
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/huawei-ipv6-static-route:ipv6/route/next-hop-options/multiple-path/egress-interface-ipv6-nexthop |
指定IPv6静态路由的下一跳出接口和下一跳IPv6地址信息,通过该节点的子节点进行相应配置:
|
各子节点取值如下:
|
NA |
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/huawei-ipv6-static-route:ipv6/route/next-hop-options/multiple-path/egress-routing-instance-ipv6-nexthop |
指定IPv6静态路由的目的VPN和下一跳IPv6地址信息,通过该节点的子节点进行相应配置:
|
各子节点取值如下:
|
NA |
/ietf-routing:routing/routing-instance/routing-protocols/routing-protocol/static-routes/huawei-ipv6-static-route:ipv6/route/next-hop-options/multiple-path/egress-routing-instance-nexthop |
指定IPv6静态路由的目的VPN信息,且不指定下一跳IPv6地址,通过该节点的子节点进行相应配置:
|
各子节点取值如下:
|
NA |
配置IPv6静态路由示例
本章节主要介绍通过edit-config方法配置IPv6静态路由。
操作 |
XPATH |
---|---|
edit-config |
|
数据需求
项目 |
数据 |
描述 |
---|---|---|
指定目的IPv6地址和前缀长度 |
fc00:0:0:2001::1/64 |
- |
指定目的VPN实例 |
test2 |
- |
指定下一跳IPv6地址 |
fc00:0:0:2002::2 |
- |
指定IPv6静态路由的优先级 |
100 |
- |
指定IPv6静态路由的tag属性值 |
100 |
- |
请求示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing"> <rt:routing-instance xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="create"> <rt:name>default-routing-instance</rt:name> <rt:routing-protocols> <rt:routing-protocol> <rt:type>static</rt:type> <rt:name>test1</rt:name> <rt:static-routes> <hw-v6sr:ipv6 xmlns:hw-v6sr="urn:huawei:params:xml:ns:yang:hw-ipv6-static-route"> <hw-v6sr:route> <hw-v6sr:destination-prefix>fc00:0:0:2001::1/64</hw-v6sr:destination-prefix> <hw-v6sr:egress-routing-instance-ipv6-nexthop> <hw-v6sr:dest-routing-instance>test2</hw-v6sr:dest-routing-instance> <hw-v6sr:next-hop-address>fc00:0:0:2002::2</hw-v6sr:next-hop-address> <hw-v6sr:preference>100</hw-v6sr:preference> <hw-v6sr:tag>100</hw-v6sr:tag> </hw-v6sr:egress-routing-instance-ipv6-nexthop> </hw-v6sr:route> </hw-v6sr:ipv6> </rt:static-routes> </rt:routing-protocol> </rt:routing-protocols> </rt:routing-instance> </rt:routing> </config> </edit-config> </rpc>
删除示例
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <rt:routing xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing"> <rt:routing-instance xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="delete"> <rt:name>default-routing-instance</rt:name> <rt:routing-protocols> <rt:routing-protocol> <rt:type>static</rt:type> <rt:name>test1</rt:name> <rt:static-routes> <hw-v6sr:ipv6 xmlns:hw-v6sr="urn:huawei:params:xml:ns:yang:hw-ipv6-static-route"> <hw-v6sr:route> <hw-v6sr:destination-prefix>fc00:0:0:2001::1/64</hw-v6sr:destination-prefix> <hw-v6sr:egress-routing-instance-ipv6-nexthop> <hw-v6sr:dest-routing-instance>test2</hw-v6sr:dest-routing-instance> <hw-v6sr:next-hop-address>fc00:0:0:2002::2</hw-v6sr:next-hop-address> <hw-v6sr:preference>100</hw-v6sr:preference> <hw-v6sr:tag>100</hw-v6sr:tag> </hw-v6sr:egress-routing-instance-ipv6-nexthop> </hw-v6sr:route> </hw-v6sr:ipv6> </rt:static-routes> </rt:routing-protocol> </rt:routing-protocols> </rt:routing-instance> </rt:routing> </config> </edit-config> </rpc>
响应示例
# 配置成功响应示例
##### Ok Reply or Operation Successful ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
# 配置失败响应示例
##### Error Reply or Operation Failed ##### <?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message> The specified IPv6 VPN instance does not exist.</error-message> <error-info>Error on node /ietf-routing:routing/routing-instance[name="default-routing-insta"]/routing-protocols/routing-protocol[type="ietf-routing:static",name="test1"]/static-routes/huawei-ipv6-static-route:ipv6/route[destination-prefix="fc00:0:0:2001::1/64"]/egress-routing-instance-ipv6-nexthop[dest-routing-instance="test2",next-hop-address="fc00:0:0:2002::2"]</error-info> </rpc-error>