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

S600-E V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG API functions supported by the switch, including the data model and samples.
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).
Configuring a Voice VLAN

Configuring a Voice VLAN

This section describes the data model of a voice VLAN and provides examples of XML packets.

Data Model

The configuration model files matching VLAN management are huawei-vlan.yang and ietf-interfaces.yang.

Table 2-163  VLAN management

Object

Description

Value

Remarks

/huawei-vlan:voice-vlan/remark-8021p

Specifies the 802.1p priority.

The value is an integer that ranges from 0 to 7. The default value is 6. A greater value indicates a higher priority.

NA

/huawei-vlan:voice-vlan/remark-dscp

Specifies the DSCP priority.

The value is an integer that ranges from 0 to 63. The default value is 46. A greater value indicates a higher priority.

NA

/huawei-vlan:voice-vlan/address/mac

Specifies the OUI address of voice packets that can be transmitted in the voice VLAN.

The value is in H:H:H:H:H:H format. H is a hexadecimal number that contains 1 to 2 digits, such as e0 and fc. The address cannot be all 0s, multicast address, or broadcast address.

NA

/huawei-vlan:voice-vlan/address/mask

Specifies the mask length of the OUI address.

The value is an integer that ranges from 1 to 48.

NA

/huawei-vlan:voice-vlan/address/description

Indicates the description of the OUI address.

The value is a string of 1 to 80 case-sensitive characters.

NA

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/voice-vlan-id

Configures a specified VLAN as a voice VLAN.

The value is an integer that ranges from 2 to 4094.

NA

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/include-untagged

Adds voice VLAN IDs to untagged packets.

The value is of the Boolean type:
  • true: Adds voice VLAN IDs to untagged packets.
  • false: Does not add voice VLAN IDs to untagged packets.

The default value is false.

NA

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/include-tag0

Changes VLAN 0 in packets to the voice VLAN ID.

The value is of the Boolean type:
  • true: Changes VLAN 0 in packets to the voice VLAN ID.
  • false: Does not change VLAN 0 in packets to the voice VLAN ID.

The default value is false.

NA

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/remark-mode

Configures a mode to increase the priority of voice packets.

The value is of the enumerated type:
  • vlan: Specifies that the priority of voice packets is increased based on VLAN IDs.
  • mac-address: Specifies that the priority of voice packets is increased based on MAC addresses.

The default value is vlan.

You must enable the voice VLAN function on interfaces before configuring a mode to increase the priority of voice packets.

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/security

Configures the secure or normal mode of a voice VLAN.

The value is of the enumerated type:
  • enable: Enables the secure mode of the voice VLAN.
  • disable: Disables the secure mode of the voice VLAN so that the voice VLAN works in normal mode.

The default value is disable.

You must specify that the priority of voice VLANs is increased based on MAC addresses before enabling the secure mode of the voice VLAN.

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/mode

Specifies the working mode of the voice VLAN.

The value is of the enumerated type:
  • auto: Indicates the automatic mode of the voice VLAN.
  • manual: Indicates the manual mode of the voice VLAN.

The default value is manual.

You must specify that the priority of voice VLANs is increased based on MAC addresses before specifying the auto mode for the voice VLAN.

Access, negotiation-auto, or negotiation-desirable interfaces cannot work in auto mode. To configure these interfaces to work in auto mode, change the interface type to trunk or hybrid.

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan/legacy

Enables the CDP-compatible voice VLAN function so that the switch encapsulates voice VLAN information in CDP packets and sends them to connected IP phones.

The value is of the enumerated type:
  • enable: Enable
  • disable: Disable

The default value is disable.

You must enable the voice VLAN function on interfaces before enabling the CDP-compatible voice VLAN function so that the switch encapsulates voice VLAN information in CDP packets and sends them to connected IP phones.

Sample of Configuring a MAC Address-based Voice VLAN

This section provides a sample of configuring a MAC address-based voice VLAN using the edit-config method.

Table 2-164  Configuring a MAC address-based voice VLAN

Operation

XPATH

edit-config

/huawei-vlan:voice-vlan/remark-8021p

/huawei-vlan:voice-vlan/remark-dscp

/huawei-vlan:voice-vlan/address

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan

Data Requirements

Item

Data

Description

802.1p priority of the voice VLAN

7

Set the 802.1p priority of the voice VLAN to 7.

DSCP priority of the voice VLAN

50

Set the DSCP priority of the voice VLAN to 50.

OUI addresses of voice packets

  • The value of mac is 12:34:12:34:12:34.
  • The value of mask is 24.
  • The value of description is PhoneA.

Allow the voice packets coming from Phone A, an IP phone, to be identified by the voice VLAN. The MAC address of Phone A is 1234-1234-1234 and the OUI mask address is ffff-ff00-0000.

Interface name

XGigabitEthernet0/0/1

Enable the voice VLAN function on the XGigabitEthernet0/0/1 interface and specify VLAN 103 as a voice VLAN. Add voice VLAN IDs to untagged packets and change VLAN 0 in packets to the voice VLAN ID.

Interface type

iana-if-type:ethernetCsmacd

Voice VLAN ID

103

Adding voice VLAN IDs to untagged packets

true

Changing VLAN 0 in packets to the voice VLAN ID

true

Mode of increasing the priority of voice packets

mac-address

Specify that the priority of voice packets is increased based on MAC addresses.

Working mode of the voice VLAN

enable

Configure the voice VLAN to work in secure mode.

Mode of adding an interface to a voice VLAN

manual

Configure an interface to be added to a voice VLAN in manual mode.

NOTE:

To create a VLAN and add an interface to the VLAN, refer to VLAN Management. The related configuration is not provided here.

Request Example

# Sample of configuring the 802.1p priority and DSCP priority for a voice VLAN and setting the OUI address

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="11" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <huawei-vlan:voice-vlan xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
        <huawei-vlan:remark-8021p>7</huawei-vlan:remark-8021p>
        <huawei-vlan:remark-dscp>50</huawei-vlan:remark-dscp>
        <huawei-vlan:address>
          <huawei-vlan:mac>12:34:12:34:12:34</huawei-vlan:mac>
          <huawei-vlan:mask>24</huawei-vlan:mask>
          <huawei-vlan:description>PhoneA</huawei-vlan:description>
        </huawei-vlan:address>
      </huawei-vlan:voice-vlan>
    </config>
  </edit-config>
</rpc>

# Sample of configuring a MAC address-based voice VLAN on the XGigabitEthernet0/0/1 interface

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="12" 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/1</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <huawei-vlan:voice-vlan xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
            <huawei-vlan:voice-vlan-id>103</huawei-vlan:voice-vlan-id>
            <huawei-vlan:include-untagged>true</huawei-vlan:include-untagged>
            <huawei-vlan:include-tag0>true</huawei-vlan:include-tag0>
            <huawei-vlan:remark-mode>mac-address</huawei-vlan:remark-mode>
            <huawei-vlan:security>enable</huawei-vlan:security>
            <huawei-vlan:mode>manual</huawei-vlan:mode>
          </huawei-vlan:voice-vlan>
        </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="11">
  <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="4">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message> Auto-mode voice VLAN cannot be configured on a negotiation port.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="XGigabitEthernet0/0/1"]/huawei-vlan:voice-vlan</error-info>
  </rpc-error>
</rpc-reply>

Sample of Configuring a VLAN ID-based Voice VLAN

This section provides a sample of configuring a VLAN ID-based voice VLAN using the edit-config method.

Table 2-165  Configuring a VLAN ID-based voice VLAN

Operation

XPATH

edit-config

/huawei-vlan:voice-vlan/remark-8021p

/huawei-vlan:voice-vlan/remark-dscp

/ietf-interfaces:interfaces/interface/huawei-vlan:voice-vlan

Data Requirements

Item

Data

Description

802.1p priority of the voice VLAN

7

Set the 802.1p priority of the voice VLAN to 7.

DSCP priority of the voice VLAN

50

Set the DSCP priority of the voice VLAN to 50.

Interface name

XGigabitEthernet0/0/2

Enable the voice VLAN function on the XGigabitEthernet0/0/2 interface and specify VLAN 105 as the voice VLAN. Add voice VLAN IDs to untagged packets and change VLAN 0 in packets to the voice VLAN ID.

Interface type

iana-if-type:ethernetCsmacd

Voice VLAN ID

105

Whether to add voice VLAN IDs to untagged packets

true

Whether to change VLAN 0 in packets to the voice VLAN ID

true

Mode of increasing the priority of voice packets

vlan

Specify that the priority of voice packets is increased based on VLAN IDs.

CDP-compatible capability

enable

Enable the CDP-compatible voice VLAN function so that the switch encapsulates voice VLAN information in CDP packets and sends them to connected IP phones.

NOTE:

To create a VLAN and add an interface to the VLAN, refer to VLAN Management. The related configuration is not provided here.

Request Example

# Sample of configuring the 802.1p priority and DSCP priority for a voice VLAN

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="7" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <huawei-vlan:voice-vlan xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
        <huawei-vlan:remark-8021p>7</huawei-vlan:remark-8021p>
        <huawei-vlan:remark-dscp>50</huawei-vlan:remark-dscp>
      </huawei-vlan:voice-vlan>
    </config>
  </edit-config>
</rpc>

# Sample of configuring a VLAN ID-based voice VLAN on the XGigabitEthernet 0/0/2 interface

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="8" 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/2</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <huawei-vlan:voice-vlan xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
            <huawei-vlan:voice-vlan-id>105</huawei-vlan:voice-vlan-id>
            <huawei-vlan:include-untagged>true</huawei-vlan:include-untagged>
            <huawei-vlan:include-tag0>true</huawei-vlan:include-tag0>
            <huawei-vlan:remark-mode>vlan</huawei-vlan:remark-mode>
            <huawei-vlan:legacy>enable</huawei-vlan:legacy>
          </huawei-vlan:voice-vlan>
        </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="8">
  <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="8">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-path>/ietf-interfaces:interfaces/interface[name='XGigabitEthernet0/0/2']/huawei-vlan:voice-vlan/security</error-path>
    <error-message>parse rpc config error.(Invalid value "true" in "security" element.).</error-message>
  </rpc-error>
</rpc-reply>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 6973

Downloads: 8

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