OC Interfaces
Configuring an Interface with Description, Mode, Native VLAN, Allowed Trunk VLAN, MTU Size, Auto Negotiation, Status, and Flow Control
Configuring an Interface with Description, Mode, Native VLAN, Allowed Trunk VLAN, MTU Size, Auto Negotiation, Status, and Flow Control
Request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<edit-config>
<target>
<running/>
</target>
<config>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/50</name>
<config>
<mtu>9216</mtu>
<description>configured with openconfig</description>
<enabled>true</enabled>
</config>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<auto-negotiate>true</auto-negotiate>
<enable-flow-control>true</enable-flow-control>
</config>
<switched-vlan xmlns="http://openconfig.net/yang/vlan">
<config>
<interface-mode>TRUNK</interface-mode>
<native-vlan>10</native-vlan>
<trunk-vlans>1..100</trunk-vlans>
</config>
</switched-vlan>
</ethernet>
</interface>
</interfaces>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
Container: Interfaces
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
interface Ethernet1/50
description configured with openconfig
switchport mode trunk
switchport trunk native vlan 10
switchport trunk allowed vlan 1-100
flowcontrol receive on
flowcontrol send on
mtu 9216
negotiate auto
no shutdown
Configuring a Port Channel as an Access Port
Configuring a Port Channel as an Access Port
Request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<edit-config>
<target>
<running/>
</target>
<config>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>po2000</name>
<config>
<description>configured with openconfig</description>
<enabled>true</enabled>
</config>
<aggregation xmlns="http://openconfig.net/yang/interfaces/aggregate">
<switched-vlan xmlns="http://openconfig.net/yang/vlan">
<config>
<interface-mode>ACCESS</interface-mode>
<access-vlan>10</access-vlan>
</config>
</switched-vlan>
</aggregation>
</interface>
</interfaces>
</config>
</edit-config>
</rpc>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
interface port-channel2000
description configured with openconfig
switchport access vlan 10
no shutdown
Configuring an Interface as Part of a Port Channel
Configuring an Interface as Part of a Port Channel
Request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<edit-config>
<target>
<running/>
</target>
<config>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/40</name>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<aggregate-id xmlns="http://openconfig.net/yang/interfaces/aggregate">po2000</aggregate-id>
</config>
</ethernet>
</interface>
</interfaces>
</config>
</edit-config>
</rp
Response:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<ok/>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
interface Ethernet1/40
channel-group 2000
Querying the State of an Interface
Querying the State of an Interface
Request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get>
<filter>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/50</name>
<state>
<type/>
<mtu/>
<enabled/>
<admin-status/>
<oper-status/>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state/>
</ethernet>
</interface>
</interfaces>
</filter>
</get>
</rpc>
Response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0465462e-f991-4202-aaeb-871ad55bab10">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/50</name>
<state>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
<mtu>9216</mtu>
<enabled>false</enabled>
<admin-status>false</admin-status>
<oper-status>false</oper-status>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<auto-negotiate>true</auto-negotiate>
<enable-flow-control>true</enable-flow-control>
<mac-address>A0:E0:AF:0D:31:F7</mac-address>
<port-speed>SPEED_UNKNOWN</port-speed>
<counters>
<in-crc-errors>0</in-crc-errors>
<in-fragment-frames>0</in-fragment-frames>
<in-jabber-frames>0</in-jabber-frames>
<in-mac-control-frames>0</in-mac-control-frames>
<in-mac-pause-frames>0</in-mac-pause-frames>
<in-oversize-frames>0</in-oversize-frames>
<out-mac-control-frames>0</out-mac-control-frames>
<out-mac-pause-frames>0</out-mac-pause-frames>
</counters>
<hw-mac-address>A0:E0:AF:0D:32:2C</hw-mac-address>
<negotiated-port-speed>SPEED_UNKNOWN</negotiated-port-speed>
</state>
</ethernet>
</interface>
</interfaces>
</data>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
show interface Eth1/50
Querying the Configuration of an Interface
Querying the Configuration of an Interface
Request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get-config>
<source>
<running/>
</source>
<filter>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/40</name>
</interface>
</interfaces>
</filter>
</get-config>
</rpc>
Response:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:8511fdc4-924f-49a4-9a5b-d65054b5b3c5">
<data>
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1/40</name>
<config>
<enabled>true</enabled>
<mtu>1500</mtu>
<name>eth1/40</name>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<hold-time>
<config>
<down>100</down>
</config>
</hold-time>
<subinterfaces>
<subinterface>
<config>
<index>0</index>
</config>
<index>0</index>
</subinterface>
</subinterfaces>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<auto-negotiate>true</auto-negotiate>
<aggregate-id xmlns="http://openconfig.net/yang/interfaces/aggregate">po2000</aggregate-id>
</config>
<switched-vlan xmlns="http://openconfig.net/yang/vlan">
<config>
<access-vlan>10</access-vlan>
<interface-mode>ACCESS</interface-mode>
<native-vlan>1</native-vlan>
</config>
</switched-vlan>
</ethernet>
</interface>
</interfaces>
</data>
</rpc-reply>
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right.
show interface Eth1/50