This section provides a sample of configuring an IPv6 static route using the edit-config method.
Operation |
XPATH |
|---|---|
edit-config |
|
Item |
Data |
Description |
|---|---|---|
Destination IPv6 address and prefix length |
fc00:0:0:2001::1/64 |
- |
Destination VPN instance |
test2 |
- |
Next-hop IPv6 address |
fc00:0:0:2002::2 |
- |
Priority of an IPv6 static route |
100 |
- |
Tag value of an IPv6 static route |
100 |
- |
Request Example
<?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>
Deletion Example
<?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>
Response Example
# Sample of successful response
##### 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>
# Sample of failed response
##### 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>