This section describes how to add a Layer 2 sub-interface in dot1q encapsulation mode to a BD using the rpc method.
Operation |
XPATH |
|---|---|
edit-config:merge |
/huawei-bd/bridge-domains/bridge-domain/members/port-vlan |
Item |
Data |
Description |
|---|---|---|
VLAN ID in dot1q encapsulation |
500 |
Add a Layer 2 sub-interface in dot1q encapsulation mode with VLAN ID 500 to a BD. |
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" 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/3</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 xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
<huawei-vlan:port-link-type>trunk</huawei-vlan:port-link-type>
</huawei-vlan:vlan>
</if:interface>
</if:interfaces>
<bd:bridge-domains xmlns:bd="urn:huawei:params:xml:ns:yang:huawei-bd" xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge">
<bd:bridge-domain xc:operation="merge">
<bd:id>10</bd:id>
<bd:members>
<bd:port-vlan>
<bd:vlan-id>500</bd:vlan-id>
<bd:interface-name>XGigabitEthernet0/0/3</bd:interface-name>
</bd:port-vlan>
</bd:members>
</bd:bridge-domain>
</bd:bridge-domains>
</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>Execute failed reason: Wrong parameter found at '^' position.</error-message>
<error-info>Error on node /huawei-bd:bridge-domains/bridge-domain[id="10"]/members/port-vlan[vlan-id="500",interface-name="XGigabitEthernet0/0/3"]</error-info>
</rpc-error>
</rpc-reply>