Eth-Trunk Management
This section describes the configuration model of Eth-Trunk management and provides examples of XML packets.
Data Model
The configuration model file matching Eth-Trunk management is huawei-eth-trunk.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/trunk-work-mode |
Indicates the Eth-Trunk mode. |
The value is of the enumerated type:
|
N/A |
/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/assign-interface |
Indicates the Eth-Trunk member interface. |
The value is a string. |
NA |
/huawei-eth-trunk:eth-trunk-state/interface/name |
Indicates the Eth-Trunk interface to view the configuration. |
The value is a string. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/lag-id |
Displays the ID of the Eth-Trunk interface. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/trunk-work-mode |
Displays the working mode of the Eth-Trunk interface. |
The value is of the enumerated type:
|
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/preempt-mode |
Displays the status of the LACP priority preemption in LACP mode. |
The value is of the boolean type:
|
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/preempt-delay-time |
Displays the LACP preemption delay, in seconds. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/load-balance |
Displays the load balancing mode of the Eth-Trunk interface. |
The value is of the enumerated type:
|
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/system-priority |
Displays the LACP system priority. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/system-id |
Displays the system ID. |
The value is in the format of H-H-H. Each H is a 4-digit hexadecimal number. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/least-active-num |
Displays the lower threshold of member links that are in Up state. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/max-active-num |
Displays the upper threshold of member links that are in Up state. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/max-bandwidth-affected |
Displays the maximum number of connections that affect the Eth-Trunk bandwidth. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/oper-status |
Displays the status of the Eth-Trunk interface. |
The value is of the enumerated type:
|
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/up-port-num |
Displays the number of member interfaces that are in Up state in the Eth-Trunk interface. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/name |
Displays the name of a member interface. |
The value is a string. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/index |
Displays the index of a member interface. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/oper-status |
Displays the status of an Eth-Trunk member interface. |
The value is of the enumerated type:
|
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/weight |
Displays the weight of a member interface. |
The value is an integer. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/remote-sys-id |
Displays the system ID of a peer member interface. |
The value is in the format of H-H-H. Each H is a 4-digit hexadecimal number. |
This object only supports the get operation. |
/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/remote-sys-pri |
Displays the LACP system priority of a peer member interface. |
The value is an integer. |
This object only supports the get operation. |
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.
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
Item |
Data |
Description |
---|---|---|
Working mode of an Eth-Trunk |
lacp |
Set the working mode of an Eth-Trunk to LACP. |
Member interface |
GigabitEthernet1/0/1 |
Add GigabitEthernet1/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>GigabitEthernet1/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>GigabitEthernet1/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 GigabitEthernet1/0/1 has other configurations. Please clear configuration first.The error port is GigabitEthernet1/0/1.</error-message> <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk1"]/huawei-eth-trunk:eth-trunk/assign-interface[.="GigabitEthernet1/0/1"]</error-info> </rpc-error> </rpc-reply>
Example of Querying the Eth-Trunk Configuration
This section provides a sample of querying the Eth-Trunk configuration information using the get method.
Operation |
XPATH |
---|---|
get |
/huawei-eth-trunk:eth-trunk-state/interface |
Data Requirement
Item |
Data |
Description |
---|---|---|
Eth-Trunk name |
Eth-Trunk100 |
Displays the configuration of Eth-Trunk100 in LACP mode. |
Eth-Trunk name |
Eth-Trunk101 |
Displays the configuration of Eth-Trunk101 in manual mode. |
Request Example 1
# Displays the configuration of Eth-Trunk100 in LACP mode.
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <hw-eth-trunk:eth-trunk-state xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk"> <hw-eth-trunk:interface> <hw-eth-trunk:name>Eth-Trunk100</hw-eth-trunk:name> </hw-eth-trunk:interface> </hw-eth-trunk:eth-trunk-state> </filter> </get> </rpc>
Response Example 1
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="3"> <data> <eth-trunk-state xmlns="urn:huawei:params:xml:ns:yang:huawei-eth-trunk"> <interface> <name>Eth-Trunk100</name> <lag-id>100</lag-id> <trunk-work-mode>lacp</trunk-work-mode> <preempt-mode>false</preempt-mode> <load-balance>dst-mac</load-balance> <system-priority>32768</system-priority> <system-id>00:0b:09:47:5c:23</system-id> <least-active-num>1</least-active-num> <max-active-num>32</max-active-num> <oper-status>up</oper-status> <up-port-num>1</up-port-num> <eth-trunk-member> <name>XGigabitEthernet1/0/6</name> <index>204</index> <oper-status>down</oper-status> <weight>1</weight> <remote-sys-id>00:00:00:00:00:00</remote-sys-id> <remote-sys-pri>0</remote-sys-pri> </eth-trunk-member> <eth-trunk-member> <name>XGigabitEthernet1/0/12</name> <index>210</index> <oper-status>up</oper-status> <weight>1</weight> <remote-sys-id>f8:4a:bf:e7:d4:60</remote-sys-id> <remote-sys-pri>32768</remote-sys-pri> </eth-trunk-member> </interface> </eth-trunk-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="3"> <data/> </rpc-reply>
Request Example 2
# Displays the configuration of Eth-Trunk101 in manual mode.
<?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"> <hw-eth-trunk:eth-trunk-state xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk"> <hw-eth-trunk:interface> <hw-eth-trunk:name>Eth-Trunk101</hw-eth-trunk:name> </hw-eth-trunk:interface> </hw-eth-trunk:eth-trunk-state> </filter> </get> </rpc>
Response Example 2
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>
<eth-trunk-state xmlns="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
<interface>
<name>Eth-Trunk101</name>
<trunk-work-mode>manual</trunk-work-mode>
<load-balance>dst-ip</load-balance>
<least-active-num>1</least-active-num>
<max-bandwidth-affected>32</max-bandwidth-affected>
<oper-status>up</oper-status>
<up-port-num>1</up-port-num>
<eth-trunk-member>
<name>XGigabitEthernet1/0/18</name>
<index>216</index>
<oper-status>up</oper-status>
<weight>1</weight>
</eth-trunk-member>
</interface>
</eth-trunk-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>