< Home

Querying IPv4 and IPv6 Configuration Information of an Interface

This section provides a sample of querying IPv4 and IPv6 configuration information of an interface using the get method.

Table 1 Querying IPv4 and IPv6 configuration information of an interface

Operation

XPATH

get

/ietf-interfaces:interfaces-state/interface

Request Example

Query IPv4 and IPv6 configuration information of VLANIF 100.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="4" 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>Vlanif100</if:name>
        </if:interface>
      </if:interfaces-state>
    </filter>
  </get>
</rpc>

Response Example

Sample of successful response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>Vlanif100</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>up</oper-status>
        <if-index>417</if-index>
        <phys-address>fc:e3:3c:9f:17:64</phys-address>
        <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <forwarding>true</forwarding>
          <mtu>1700</mtu>
          <address>
            <ip>10.1.1.1</ip>
            <netmask>255.255.255.0</netmask>
            <origin>static</origin>
          </address>
          <neighbor>
            <ip>10.1.1.10</ip>
            <link-layer-address>00:01:00:02:00:03</link-layer-address>
            <origin>static</origin>
          </neighbor>
        </ipv4>
        <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
          <forwarding>true</forwarding>
          <mtu>1600</mtu>
          <address>
            <ip>FE80::FEE3:3CFF:FE9F:1764</ip>
            <prefix-length>64</prefix-length>
            <origin>static</origin>
            <status>preferred</status>
          </address>
          <address>
            <ip>2001::1</ip>
            <prefix-length>64</prefix-length>
            <origin>static</origin>
            <status>preferred</status>
          </address>
          <neighbor>
            <ip>2001::10</ip>
            <link-layer-address>00:01:00:01:00:01</link-layer-address>
            <origin>static</origin>
            <is-router> </is-router>
            <state>reachable</state>
          </neighbor>
        </ipv6>
      </interface>
    </interfaces-state>
  </data>
</rpc-reply>

Sample of failed response

<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <data/>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic