Selective QinQ and VLAN Mapping
This section describes the data model of selective QinQ and VLAN mapping and provides examples of XML packets.
Data Model
The configuration model file matching selective QinQ and VLAN mapping is huawei-vlan.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:mapping/huawei-vlan:vlan |
Indicates the VLAN ID carried in the received frame. |
The value is of the character string type and must be in the format x..y, which indicates VLANs in the range from x to y. x and y are in the range from 1 to 4094. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:mapping/huawei-vlan:map-vlan |
Indicates the mapped VLAN ID. |
The value is an integer in the range from 1 to 4094. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:mapping/huawei-vlan:remark-8021p |
Indicates the re-marked 802.1p priority of the mapped tag. |
The value is an integer in the range from 0 to 7. A larger value indicates a higher priority. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:stacking/huawei-vlan:vlan |
Indicates the VLAN ID in a received tagged frame. |
The value is of the character string type and must be in the format x..y, which indicates VLANs in the range from x to y. x and y are in the range from 1 to 4094. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:stacking/huawei-vlan:stack-vlan |
Indicates the outer VLAN ID added to a frame. |
The value is an integer in the range from 1 to 4094. |
N/A |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:stacking/huawei-vlan:remark-8021p |
Indicates the re-marked 802.1p priority in the outer tag added to a frame. |
The value is an integer in the range from 0 to 7. A larger value indicates a higher priority. |
N/A |
Configuring Selective QinQ
This section provides a sample of configuring selective QinQ using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:stacking |
Data Requirements
Item |
Data |
Description |
---|---|---|
VLAN ID in a received tagged frame |
3..7 |
Configure VLANs 3 to 7 to be contained in tagged frames. |
Outer VLAN ID added to a frame |
22 |
Set the outer VLAN ID added to a frame to 22. |
Request Example
<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<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>
<huawei-vlan:vlan-translation xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
<huawei-vlan:stacking>
<huawei-vlan:vlan>3..7</huawei-vlan:vlan>
<huawei-vlan:stack-vlan>22</huawei-vlan:stack-vlan>
</huawei-vlan:stacking>
</huawei-vlan:vlan-translation>
</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="1">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message> This command is only supported on a trunk or hybrid port.</error-message>
<error-info>Error on node /ietf-interfaces:interfaces/interface[name="GigabitEthernet1/0/1"]/huawei-vlan:vlan-translation-enable/translation-enable</error-info>
</rpc-error>
</rpc-reply>
Configuring VLAN Mapping
This section provides a sample of configuring VLAN mapping using the edit-config method.
Operation |
XPATH |
---|---|
edit-config |
/ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:mapping |
Data Requirements
Item |
Data |
Description |
---|---|---|
VLAN ID in a received frame |
20..25 |
Configure VLANs 20 to 25 to be contained in received frames. |
VLAN ID in the mapped tag |
40 |
Set the VLAN ID in the mapped tag to 40. |
Re-marked 802.1p priority of the mapped tag |
6 |
Set the re-marked 802.1p priority of the mapped tag to 6. |
Request Example
<?xml version="1.0" encoding="utf-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <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> <huawei-vlan:vlan-translation xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan"> <huawei-vlan:mapping> <huawei-vlan:vlan>20..25</huawei-vlan:vlan> <huawei-vlan:map-vlan>40</huawei-vlan:map-vlan> <huawei-vlan:remark-8021p>6</huawei-vlan:remark-8021p> </huawei-vlan:mapping> </huawei-vlan:vlan-translation> </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="2"> <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> This command is only supported on a trunk or hybrid port.</error-message> <error-info>Error on node /ietf-interfaces:interfaces/interface[name="GigabitEthernet1/0/1"]/huawei-vlan:vlan-translation-enable/translation-enable</error-info> </rpc-error> </rpc-reply>