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-enable/huawei-vlan:translation-enable /ietf-interfaces:interfaces/interface/huawei-vlan:vlan-translation/huawei-vlan:mapping |
Item |
Data |
Description |
---|---|---|
VLAN translation on an interface |
true |
Enable VLAN translation on an interface. |
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. |
<?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>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> <huawei-vlan:vlan-translation-enable xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan"> <huawei-vlan:translation-enable>true</huawei-vlan:translation-enable> </huawei-vlan:vlan-translation-enable> <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>
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="GigabitEthernet0/0/1"]/huawei-vlan:vlan-translation-enable/translation-enable</error-info> </rpc-error> </rpc-reply>