< Home

Configuring an Eth-Trunk

This section provides a sample of configuring the Eth-Trunk working mode and adding a member interface using the rpc method.

Table 1 Configuring an Eth-Trunk

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/trunk-work-mode

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/assign-interface

Data Requirements

Table 2 Configuring an Eth-Trunk

Item

Data

Description

Working mode of an Eth-Trunk

lacp

Set the working mode of an Eth-Trunk to LACP.

Member interface

GigabitEthernet0/0/1

Add GigabitEthernet0/0/1 to Eth-Trunk1.

Request Example

# Configure the physical interfaces to be added to an Eth-Trunk.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" 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>GigabitEthernet0/0/1</if:name>
          <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:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

# Configure an Eth-Trunk.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" 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>Eth-Trunk1</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-eth-trunk:eth-trunk xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
            <hw-eth-trunk:trunk-work-mode>lacp</hw-eth-trunk:trunk-work-mode>
            <hw-eth-trunk:assign-interface>GigabitEthernet0/0/1</hw-eth-trunk:assign-interface>
          </hw-eth-trunk:eth-trunk>
        </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="6">
  <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="12">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>The port GigabitEthernet0/0/1 has other configurations. Please clear configuration first.The error port is GigabitEthernet0/0/1.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk1"]/huawei-eth-trunk:eth-trunk/assign-interface[.="GigabitEthernet0/0/1"]</error-info>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >