This section provides a sample of configuring the IPv6 ND Router Advertisement (RA) function using the rpc method.
Operation |
XPATH |
|---|---|
edit-config:merge |
|
Operation |
XPATH |
|---|---|
get |
/huawei-device:device-state/upstream-interfaces/interface/IPv6 |
Item |
Data |
Description |
|---|---|---|
Enabling the function that sends RA messages |
send-advertisements |
Enable the function that sends RA messages. |
Configuring the maximum interval for sending RA messages |
max-rtr-adv-interval |
Configure the maximum interval for sending RA messages. |
Configuring the minimum interval for sending RA messages |
min-rtr-adv-interval |
Configure the minimum interval for sending RA messages. |
Configuring the M flag of stateful address autoconfiguration in an RA message |
managed-flag |
Configure the M flag of stateful address autoconfiguration in an RA message. |
Configuring the other-config flag of stateful address autoconfiguration in an RA message |
other-config-flag |
Configure the other-config flag of stateful address autoconfiguration in an RA message. |
Configuring the IPv6 neighbor reachable time |
reachable-time |
Configure the IPv6 neighbor reachable time. |
Configuring the interval for sending Neighbor Solicitation (NS) messages |
retrans-timer |
Configure the interval for sending NS messages. |
Configuring the hop limit of RA messages |
cur-hop-limit |
Configure the hop limit of RA messages. |
Configuring the lifetime of RA messages |
default-lifetime |
Configure the lifetime of RA messages. |
Configuring RA messages not to carry the default prefix generated by an interface IPv6 address |
no-advertise |
Configure RA messages not to carry the default prefix generated by an interface IPv6 address. |
Configuring the valid lifetime of prefixes |
valid-lifetime |
Configure the valid lifetime of prefixes. |
Configuring the O-Flag |
on-link-flag |
Configure the O-Flag. If this parameter is specified, the prefix carried in the RA message cannot be allocated to the local link. |
Configuring the preferred lifetime of prefixes |
preferred-lifetime |
Configure the preferred lifetime of prefixes. The preferred lifetime cannot be larger than the valid lifetime. |
Removing the A-Flag |
autonomous-flag |
Remove the A-Flag. If this parameter is specified, the configured prefix cannot be used in stateless address auto-configuration. The A-Flag indicates the autonomous address configuration in the prefix option of RA messages. |
# Configure IPv6 ND RA.
<?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>
<if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>Vlanif10</if:name>
<if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual </if:type>
<ip:ipv6 xmlns:ip="urn:ietf:params:xml:ns:yang:ietf-ip">
<ip:enabled>true</ip:enabled>
<v6ur:ipv6-router-advertisements xmlns:v6ur="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
<v6ur:send-advertisements>true</v6ur:send-advertisements>
<v6ur:managed-flag>true</v6ur:managed-flag>
<v6ur:other-config-flag>true</v6ur:other-config-flag>
<v6ur:reachable-time>10</v6ur:reachable-time>
<v6ur:retrans-timer>1000</v6ur:retrans-timer>
<v6ur:cur-hop-limit>10</v6ur:cur-hop-limit>
<v6ur:default-lifetime>2222</v6ur:default-lifetime>
<v6ur:prefix-list>
<v6ur:prefix>
<v6ur:prefix-spec>111::1/64</v6ur:prefix-spec>
<v6ur:valid-lifetime>1000</v6ur:valid-lifetime>
<v6ur:on-link-flag>true</v6ur:on-link-flag>
<v6ur:preferred-lifetime>111</v6ur:preferred-lifetime>
</v6ur:prefix>
</v6ur:prefix-list>
</v6ur:ipv6-router-advertisements>
</ip:ipv6>
</if:interface>
</if:interfaces>
</config>
</edit-config>
</rpc>
# Display IPv6 ND RA data.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="subtree">
<if:interfaces-state xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>Vlanif10</if:name>
</if:interface>
</if:interfaces-state>
</filter>
</get>
</rpc>
# Sample of successful response for configuring IPv6 ND RA
##### 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 successful response for displaying IPv6 ND RA data
##### 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="2">
<data>
<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>Vlanif10</name>
<type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</type>
<admin-status>up</admin-status>
<oper-status>down</oper-status>
<if-index>441</if-index>
<phys-address>fc:e3:3c:9f:17:6b</phys-address>
<ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
<forwarding>false</forwarding>
<mtu>1500</mtu>
</ipv4>
<ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
<forwarding>false</forwarding>
<mtu>1500</mtu>
<ipv6-router-advertisements xmlns="urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing">
<send-advertisements>false</send-advertisements>
<max-rtr-adv-interval>600</max-rtr-adv-interval>
<min-rtr-adv-interval>200</min-rtr-adv-interval>
<managed-flag>true</managed-flag>
<other-config-flag>true</other-config-flag>
<reachable-time>10</reachable-time>
<retrans-timer>1000</retrans-timer>
<cur-hop-limit>10</cur-hop-limit>
<default-lifetime>2222</default-lifetime>
<prefix-list>
<prefix>
<prefix-spec>111::/64</prefix-spec>
<valid-lifetime>1000</valid-lifetime>
<on-link-flag>true</on-link-flag>
<preferred-lifetime>111</preferred-lifetime>
<autonomous-flag>true</autonomous-flag>
</prefix>
</prefix-list>
</ipv6-router-advertisements>
</ipv6>
</interface>
</interfaces-state>
</data>
</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="2">
<rpc-error>
<error-type>application</error-type>
<error-tag>invalid-value</error-tag>
<error-severity>error</error-severity>
<error-message>validation failed</error-message>
</rpc-error>
</rpc-reply>