< Home

Configuring the MTU for an Interface

This section describes how to configure the MTU for an interface using the edit-config:merge method.

Table 1 Configuring the MTU for an Interface

Operation

XPATH

edit-config:merge

/ietf-interfaces:interfaces/interface/ietf-ip:ipv4/mtu

Data requirement

Item

Data

Description

MTU of an interface

1200

Indicates that the MTU of the interface is 1200 bytes.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="5" 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>Vlanif101</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:propVirtual</if:type>
          <ip:ipv4 xmlns:ip="urn:ietf:params:xml:ns:yang:ietf-ip">
            <ip:mtu>1200</ip:mtu>
          </ip:ipv4>
        </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="5">
  <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="5">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>Wrong parameter.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Vlanif101"]/ietf-ip:ipv4/mtu</error-info>
  </rpc-error>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >