Configuring IPv6 Neighbor Discovery
This section describes the configuration model of IPv6 neighbor discovery and provides examples of XML packets.
Data Model
The configuration file matching IPv6 neighbor discovery is ietf-ipv6-unicast-routing.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/send-advertisements |
Enables the function that sends Router Advertisement (RA) messages. |
The value is of the Boolean type:
|
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/max-rtr-adv-interval |
Sets the maximum interval for sending RA messages. |
The value is an integer that ranges from 4 to 1800. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/min-rtr-adv-interval |
Sets the minimum interval for sending RA messages. |
The value is an integer that ranges from 3 to 1350. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/managed-flag |
Sets the managed (M) flag of stateful address autoconfiguration in an RA message. |
The value is of the Boolean type:
|
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/other-config-flag |
Sets the other-config flag of stateful address autoconfiguration in an RA message. |
The value is of the Boolean type:
|
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/reachable-time |
Sets the IPv6 neighbor reachable time. |
The value is an integer that can be 0 or ranges from 1 to 3600000. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/retrans-timer |
Sets the interval for sending Neighbor Solicitation (NS) messages. |
The value is an integer that can be 0 or ranges from 1000 to 4294967295. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/cur-hop-limit |
Sets the hop limit for RA messages. |
The value is an integer that ranges from 0 to 255. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/default-lifetime |
Sets the lifetime of RA messages. |
The value is an integer that can be 0 or ranges from 4 to 9000. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/no-advertise |
Configures RA messages not to carry the default prefix generated by an interface IPv6 address. |
The value is a character string and can only be a space with unlimited length. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/valid-lifetime |
Sets the valid lifetime of prefixes. |
The value is an integer that ranges from 0 to 4294967295. valid-lifetime must be greater than or equal to preferred-lifetime. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/on-link-flag |
Sets the O-Flag. |
The value is of the Boolean type:
|
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/preferred-lifetime |
Sets the preferred lifetime of prefixes. |
The value is an integer that ranges from 0 to 4294967295. |
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-ipv6-unicast-routing:ipv6-router-advertisements/prefix-list/prefix/control-adv-prefixes/advertise/autonomous-flag |
Sets the A-Flag. |
The value is of the Boolean type:
|
The IPv6 function must be enabled on interfaces using the /ietf-ip:ipv6/enabled object. |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/send-advertisements |
Displays the enabling status of the function that sends RA messages: |
The value is of the Boolean type:
|
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/max-rtr-adv-interval |
Displays the maximum interval for sending RA messages. |
The value is an integer that ranges from 4 to 1800. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/min-rtr-adv-interval |
Displays the minimum interval for sending RA messages. |
The value is an integer that ranges from 3 to 1350. |
NA |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/managed-flag |
Displays the M flag of stateful address autoconfiguration in an RA message. |
The value is of the Boolean type:
|
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/other-config-flag |
Displays the other-config flag of stateful address autoconfiguration in an RA message. |
The value is of the Boolean type:
|
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/reachable-time |
Displays the IPv6 neighbor reachable time. |
The value is an integer that can be 0 or ranges from 1 to 3600000. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/retrans-timer |
Displays the interval for sending NS messages. |
The value is an integer that can be 0 or ranges from 1000 to 4294967295. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/cur-hop-limit |
Displays the hop limit of RA messages. |
The value is an integer that ranges from 0 to 255. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/default-lifetime |
Displays the lifetime of RA messages. |
The value is an integer that can be 0 or ranges from 4 to 9000. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/prefix-spec |
Displays the prefix information carried in an RA message. |
The value is a character string. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/valid-lifetime |
Displays the valid lifetime of prefixes. |
The value is an integer that ranges from 0 to 4294967295. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/on-link-flag |
Displays the O-Flag. |
The value is of the Boolean type:
|
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/preferred-lifetime |
Displays the preferred lifetime of prefixes. |
The value is an integer that ranges from 0 to 4294967295. |
N/A |
/ietf-interfaces:interfaces-state/interface/ipv6/ietf-ipv6-unicast-routing: ipv6-router-advertisements/prefix-list/prefix/autonomous-flag |
Displays the A-Flag. |
The value is of the Boolean type:
|
N/A |
Configuring the IPv6 ND RA Function
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 |
Data Requirements
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. |
Request Example
# 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>
Response Example
# 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>