< Home

Configuring Basic Attributes of an Interface

This section provides a sample of configuring basic attributes of an interface using the rpc method.

Table 1 Configuring basic attributes of an interface

Operation

XPATH

rpc

  • /ietf-interfaces:interfaces/interface/name
  • /ietf-interfaces:interfaces/interface/description
  • /ietf-interfaces:interfaces/interface/type
  • /ietf-interfaces:interfaces/interface/enabled
  • /ietf-interfaces:interfaces/interface/link-up-down-trap-enable

Data Requirements

Item

Data

Description

Interface name

XGigabitEthernet0/0/10

-

Interface description

port 001

-

Interface type

ethernetCsmacd

The interface is a physical interface.

Interface status

true

The interface is enabled.

Trap sending function

disabled

Disable the function of sending a trap when the interface protocol status changes.

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>
      <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
        <if:interface>
          <if:name>XGigabitEthernet0/0/10</if:name>
          <if:description>port 001</if:description>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <if:enabled>true</if:enabled>
          <if:link-up-down-trap-enable>disabled</if:link-up-down-trap-enable>
        </if:interface>
      </if:interfaces>
    </config>
  </edit-config>
</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="1">
  <ok/>
</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="2">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>Wrong interface type.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="XGigabitEthernet0/0/10"]/type</error-info>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >