< Home

Configuring an ACL for Controlling NMSs That Can Access the Switch

This section describes how to configure an ACL for controlling NMSs that can access the switch using the rpc method.

Table 1 Configuring an ACL for controlling NMSs that can access the switch

Operation

XPATH

rpc

  • /ietf-snmp:snmp/engine/enabled
  • /ietf-snmp:snmp/huawei-snmp:acl

Data Requirements

Item

Data

Description

Whether to enable the SNMP agent function on a switch

true

Enable the SNMP agent function on a switch.

ACL for controlling an NMS that can access the switch

3000

Set the ACL used to control the NMS that can access the switch to 3000.

Request Example

The ACL must already exist. For details about how to configure an ACL, see ACL Rule Management.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="10" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <snmp:snmp xmlns:snmp="urn:ietf:params:xml:ns:yang:ietf-snmp">
        <snmp:engine>
          <snmp:enabled>true</snmp:enabled>
        </snmp:engine>
        <hw-snmp:acl xmlns:hw-snmp="urn:huawei:params:xml:ns:yang:huawei-snmp">3000</hw-snmp:acl>
      </snmp:snmp>
    </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="10">
  <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="10">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>Service process failed.</error-message>
    <error-info>Error on node/ietf-snmp:snmp/engine/enabled</error-info>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >