This section provides a sample of configuring interface as the trusted interface using the merge method.
Operation |
XPATH |
|---|---|
rpc |
/huawei-savi/savi/dhcp-snooping |
Item |
Data |
Description |
|---|---|---|
Whether DHCP is enabled |
true |
Enable the DHCP function. |
Whether DHCP snooping is enabled globally |
true |
Enable the DHCP snooping function globally. |
Trusted status of GE0/0/2 connecting to servers |
true |
Configure GE0/0/2 connecting to servers as the trusted interface. |
Trusted status of GE0/0/3 connecting to servers and added in VLAN13 |
true |
Configure GE0/0/3 connecting to servers as the trusted interface. |
<rpc message-id="123" 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>GigabitEthernet0/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>
<if:enabled>true</if:enabled>
</if:interface>
</if:interfaces>
<hw-dhcp:dhcp-config xmlns:hw-dhcp="urn:huawei:params:xml:ns:yang:huawei-dhcp">
<hw-dhcp:dhcpv4-config>
<hw-dhcp:enable>true</hw-dhcp:enable>
</hw-dhcp:dhcpv4-config>
</hw-dhcp:dhcp-config>
<hw-savi:savi xmlns:hw-savi="urn:huawei:params:xml:ns:yang:huawei-savi">
<hw-savi:dhcp-snooping>
<hw-savi:snooping-global-enable>
<hw-savi:ipv4-enable>true</hw-savi:ipv4-enable>
</hw-savi:snooping-global-enable>
<hw-savi:snooping>
<hw-savi:interface>
<hw-savi:interface-name>GigabitEthernet0/0/2</hw-savi:interface-name>
<hw-savi:snooping-trust-enable>true</hw-savi:snooping-trust-enable>
</hw-savi:interface>
<hw-savi:vlan-and-interface>
<hw-savi:vlan-id>13</hw-savi:vlan-id>
<hw-savi:interface-name>GigabitEthernet0/0/3</hw-savi:interface-name>
<hw-savi:snooping-trust-enable>true</hw-savi:snooping-trust-enable>
</hw-savi:vlan-and-interface> </hw-savi:snooping>
</hw-savi:dhcp-snooping>
</hw-savi:savi>
</config>
</edit-config>
</rpc>
Sample of successful response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123"> <ok/> </rpc-reply>
Sample of failed response
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="123">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message> Service process failed.</error-message>
<error-info>Error on node /huawei-savi/savi/dhcp-snooping/snooping/interface[interface-name="GigabitEthernet0/0/2"]/snooping-trust-enable</error-info>
</rpc-error>
</rpc-reply>