No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

NETCONF YANG API Reference

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

NETCONF YANG API Reference
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Ethernet Interface

Ethernet Interface

Data Model

The configuration model files matching the Ethernet interface are huawei-vlan-termination.yang and huawei-ethernet.yang.

Table 1 Data model of the Ethernet interface

Object

Description

/if:interfaces/interface:/vct-enble/ifname

Indicates the Ethernet electrical interface to which the twisted-pair link to be detected is connected.

/if:interfaces/interface:/physical-config/speed

Indicates the rate of the Ethernet interface.

/if:interfaces/interface:/physical-config/duplex

Indicates the full-duplex or half-duplex mode of the Ethernet interface.

/if:interfaces/interface:/vlan-termination/termination-type

Configures the termination mode of the Ethernet sub-interface.

/if:interfaces/interface:/vlan-termination/terminated-cvlan-range/start-vlan

Indicates the C-VLAN ID for termination on the Ethernet sub-interface.

/if:interfaces/interface:/vlan-termination/terminated-svlan-range/start-vlan

Indicates the S-VLAN ID for termination on the Ethernet sub-interface.

/huawei-interfaces:virtual-cable-test/ifname

Indicates the name of the Ethernet electrical interface to which the twisted-pair link to be detected is connected.

Configuring Twisted-Pair Link Detection

This section provides a sample of configuring twisted-pair link detection.

Table 3-13 Configuring twisted-pair link detection

Operation

XPATH

edit-config:default

/huawei-interfaces:virtual-cable-test/ifname

Data Requirements
Table 3-14 Configuring twisted-pair link detection

Item

Data

Description

Name of the Ethernet electrical interface to which the twisted-pair link to be detected is connected

GigabitEthernet0/0/1

Configure twisted-pair link detection on GigabitEthernet0/0/1 to which the twisted-pair link is connected.

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="b82d16d2aaa24575b2c217ae1082e517">
 <virtual-cable-test xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet"> 
  <ifname>GigabitEthernet0/0/1</ifname>
 </virtual-cable-test>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="b82d16d2aaa24575b2c217ae1082e517">
 <virtualcabletest-state-result xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet">
  <virtualcabletest-pairalength>53</virtualcabletest-pairalength>
  <virtualcabletest-pairblength>53</virtualcabletest-pairblength>
  <virtualcabletest-pairclength>52</virtualcabletest-pairclength>
  <virtualcabletest-pairdlength>52</virtualcabletest-pairdlength>
  <virtualcabletest-pairastatus>normal</virtualcabletest-pairastatus>
  <virtualcabletest-pairbstatus>normal</virtualcabletest-pairbstatus>
  <virtualcabletest-paircstatus>normal</virtualcabletest-paircstatus>
  <virtualcabletest-pairdstatus>normal</virtualcabletest-pairdstatus>
 </virtualcabletest-state-result>
</rpc-reply>

Configuring the Rate of the Ethernet Interface

This section provides a sample of configuring the rate of the Ethernet interface.

Table 3-15 Configuring the rate of the Ethernet interface

Operation

XPATH

edit-config:config

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/speed

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/2

Configure the description of GigabitEthernet0/0/2 as "aa" and the rate at 10 Mbps.

Interface description

aa

Whether the interface is enabled

true

Interface rate

10Mbps

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface> 
     <name>GigabitEthernet0/0/2</name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
     <enabled>true</enabled> 
     <description>aa</description> 
     <physical-config xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet"> 
      <speed>10Mbps</speed> 
     </physical-config> 
    </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>

Changing the Rate of the Ethernet Interface

This section provides a sample of changing the rate of the Ethernet interface.

Table 3-16 Changing the rate of the Ethernet interface

Operation

XPATH

edit-config:replace

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/speed

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/2

Configure the description of GigabitEthernet0/0/2 as "aa" and work in auto-negotiation mode.

Interface description

aa

Whether the interface is enabled

true

Interface rate

auto

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_84771fcd2a93486790dcdb6101e7a8ef"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface xc:operation="replace"> 
     <name>GigabitEthernet0/0/2 </name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
     <enabled>true</enabled> 
     <description>Ethernet0/0/1 config</description> 
     <physical-config xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet"> 
      <speed>auto</speed> 
     </physical-config> 
    </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_84771fcd2a93486790dcdb6101e7a8ef"> 
  <ok/> 
</rpc-reply>

Configuring the Full-duplex or Half-duplex Mode of the Ethernet Interface

This section provides a sample of configuring the full-duplex or half-duplex mode of the Ethernet interface.

Table 3-17 Configuring the full-duplex or half-duplex mode of the Ethernet interface

Operation

XPATH

edit-config:config

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/media

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/duplex

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/2

Configure the description of GigabitEthernet0/0/2 as "aa" and work in half-duplex mode.

Interface description

aa

Whether the interface is enabled

true

Full-duplex or half-duplex mode of an interface

half

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface> 
     <name>GigabitEthernet0/0/2  </name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
     <enabled>true</enabled> 
     <description>aa</description> 
     <physical-config xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet"> 
      <media>copper</media> 
      <duplex>half</duplex> 
     </physical-config>    
    </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>

Changing the Full-duplex or Half-duplex Mode of the Ethernet Interface

This section provides a sample of changing the full-duplex or half-duplex mode of the Ethernet interface.

Table 3-18 Changing the full-duplex or half-duplex mode of the Ethernet interface

Operation

XPATH

edit-config:replace

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/media

/ietf-interfaces:interfaces/ietf-interfaces:interface/huawei-ethernet:physical-config/duplex

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/2

Configure the description of GigabitEthernet0/0/2 as "aa" and work in auto-negotiation mode.

Interface description

aa

Whether the interface is enabled

true

Full-duplex or half-duplex mode of an interface

auto

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_84771fcd2a93486790dcdb6101e7a8ef"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
    <interface xc:operation="replace"> 
     <name>GigabitEthernet0/0/2 </name> 
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
     <enabled>true</enabled> 
     <description>aa</description> 
     <physical-config xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet"> 
      <media>copper</media> 
      <duplex>auto</duplex> 
     </physical-config> 
    </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_84771fcd2a93486790dcdb6101e7a8ef"> 
  <ok/> 
</rpc-reply>

Creating a dot1q Process

This section provides a sample of creating and running a dot1q process.

Table 3-19 Creating and running a dot1q process

Operation

XPATH

edit-config:config

/ietf-interfaces:interfaces/interface/vlan-termination/termination-type

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-cvlan-range/start-vlan

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/4.1

Create subinterfaces of GigabitEthernet0/0/4.1,set the description of GigabitEthernet0/0/4.1 as "GigabitEthernet0/0/4 sub-interface", set the value of end-cvlan-id as 2.

Interface description

GigabitEthernet0/0/4 sub-interface

Whether the interface is enabled

true

C-VLAN ID for termination

2

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
          <interface> 
                  <name>GigabitEthernet0/0/4.1</name> 
                  <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
                  <enabled>true</enabled> 
                  <description>GigabitEthernet0/0/4 sub-interface</description> 
                   <vlan-termination xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan-termination">      
                       <termination-type>dot1q 
                       </termination-type> 
                       <terminated-cvlan-range> 
                       <start-vlan>2</start-vlan> 
                       </terminated-cvlan-range> 
                   </vlan-termination>  
          </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>

Deleting a dot1q Process

This section provides a sample of deleting a dot1q process.

Table 3-20 Deleting a dot1q process

Operation

XPATH

edit-config:remove

/ietf-interfaces:interfaces/interface/vlan-termination/termination-type

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-cvlan-range/start-vlan

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/4.1

Delete the description of GigabitEthernet0/0/4.1 and the value of end-cvlan-id .

Interface description

GigabitEthernet0/0/4 sub-interface

Whether the interface is enabled

true

C-VLAN ID for termination

2

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062">
 <edit-config>
  <target>
   <running/>
  </target>
  <error-option>rollback-on-error</error-option>
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
   <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
    <interface>
     <name>GigabitEthernet0/0/4.1</name>
     <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type>
     <enabled>true</enabled>
     <description>GigabitEthernet0/0/4 sub-interface</description>
     <vlan-termination xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan-termination" xc:operation="remove">
      <termination-type>dot1q                                 </termination-type>
      <terminated-cvlan-range>
       <start-vlan>2</start-vlan>
      </terminated-cvlan-range>
     </vlan-termination>
    </interface>
   </interfaces>
  </config>
 </edit-config>
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>

Creating a QinQ Process

This section provides a sample of creating and running a QinQ process.

Table 3-21 Creating and running a QinQ process

Operation

XPATH

edit-config:config

/ietf-interfaces:interfaces/interface/vlan-termination/termination-type

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-cvlan-range/start-vlan

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-svlan-range/start-vlan

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/4.1

Create subinterfaces of GigabitEthernet0/0/4.1,set the description of GigabitEthernet0/0/4.1 as "GigabitEthernet0/0/4 sub-interface", set the value of end-cvlan-id as 2, the value of end svlan-id as 5.

Interface description

GigabitEthernet0/0/4 sub-interface

Whether the interface is enabled

true

C-VLAN ID for termination

2

S-VLAN ID for termination

5

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
          <interface> 
                  <name>GigabitEthernet0/0/4.1</name> 
                                <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
    <enabled>true</enabled> 
    <description>GigabitEthernet0/0/4 sub-interface</description> 
                                <vlan-termination xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan-termination">      
                                <termination-type>qinq 
                                </termination-type> 
                                <terminated-cvlan-range> 
                                <start-vlan>2</start-vlan> 
                                </terminated-cvlan-range> 
                                <terminated-svlan-range> 
                                <start-vlan>5</start-vlan> 
                                </terminated-svlan-range> 
                            </vlan-termination>  
          </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>

Deleting a QinQ Process

This section provides a sample of deleting a QinQ process.

Table 3-22 Deleting a QinQ process

Operation

XPATH

edit-config:remove

/ietf-interfaces:interfaces/interface/vlan-termination/termination-type

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-cvlan-range/start-vlan

/ietf-interfaces:interfaces/interface/vlan-termination/terminated-svlan-range/start-vlan

Data Requirements

Item

Data

Description

Interface name

GigabitEthernet0/0/4.1

Delete the description of GigabitEthernet0/0/4.1 and the value of end-cvlan-id and end-svlan-id.

Interface description

GigabitEthernet0/0/4 sub-interface

Whether the interface is enabled

true

C-VLAN ID for termination

2

S-VLAN ID for termination

5

Request Example
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
 <edit-config> 
  <target> 
 <running/> 
  </target> 
  <error-option>rollback-on-error</error-option> 
  <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> 
 <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"> 
          <interface> 
                  <name>GigabitEthernet0/0/4.1</name> 
                                <type xmlns:iana="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</type> 
    <enabled>true</enabled> 
    <description>GigabitEthernet0/0/4 sub-interface</description> 
                                <vlan-termination xmlns="urn:huawei:params:xml:ns:yang:huawei-vlan-termination" xc:operation="remove">    
                              <termination-type>qinq 
                                </termination-type> 
                                <terminated-cvlan-range> 
                                <start-vlan>2</start-vlan> 
                                </terminated-cvlan-range> 
                                <terminated-svlan-range> 
                                <start-vlan>5</start-vlan> 
                                </terminated-svlan-range> 
                            </vlan-termination>  
          </interface> 
 </interfaces> 
  </config> 
 </edit-config> 
</rpc>
Response Example

Sample of successful response

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="DEVICECONFIG_dc9bf91389364b8cada05b7d95f3e062"> 
  <ok/> 
</rpc-reply>
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100022096

Views: 8241

Downloads: 69

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next