OcNOS DC : OpenConfig Command Reference : Interface Configuration OpenConfig Translation
Interface Configuration OpenConfig Translation
Configure Interfaces
This XML configuration snippet is used to define and configure network interfaces.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload for Interface Configuration.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<mtu>1450</mtu>
<description>Test desc for the interface</description>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X88A8</tpid>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<duplex-mode>FULL</duplex-mode>
<auto-negotiate>false</auto-negotiate>
<port-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
</config>
</ethernet>
<subinterfaces>
<subinterface>
<index>2</index>
<config>
<index>2</index>
<description>Test subinterface double tagged</description>
<enabled>true</enabled>
</config>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>30.1.1.1</ip>
<config>
<ip>30.1.1.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
<address>
<ip>40.10.10.10</ip>
<config>
<ip>40.10.10.10</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI commands are used for Interface Configuration.
interface xe10
description "Test desc for the interface"
speed 1g
duplex full
mtu 1450
switchport dot1q ethertype 0x88A8
no shutdown
 
interface xe10.2
description "Test subinterface double tagged"
ip address 30.1.1.1/24
ip address 40.10.10.10/24 secondary
no shutdown
encapsulation dot1ad 10 inner-dot1q 200
OcNOS NetConf Payload
Here is the sample OcNOS NetConf Payload for Interface Configuration.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<mtu>1450</mtu>
<description>Test desc for the interface</description>
</config>
<extended xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-extended">
<config>
<dot1q-ether-type>0x88A8</dot1q-ether-type>
</config>
</extended>
<ethernet xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ethernet">
<config>
<duplex-mode>full</duplex-mode>
<port-speed>1g</port-speed>
</config>
</ethernet>
</interface>
<interface>
<name>xe10.2</name>
<config>
<name>xe10.2</name>
<description>Test subinterface double tagged</description>
<enabled>true</enabled>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<secondary-addresses>
<ip-address>40.10.10.10/24</ip-address>
<config>
<ip-address>40.10.10.10/24</ip-address>
</config>
</secondary-addresses>
<config>
<primary-ip-addr>30.1.1.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for interface configuration, providing details about the current state of the specified interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<mtu>1450</mtu>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<description>Test desc for the interface</description>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<mtu>1450</mtu>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<description>Test desc for the interface</description>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<duplex-mode>FULL</duplex-mode>
<auto-negotiate>false</auto-negotiate>
<port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
</config>
<state>
<duplex-mode>FULL</duplex-mode>
<port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.9729.abc5</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<config>
<mtu>1450</mtu>
</config>
</ipv4>
<config>
<index>0</index>
</config>
<ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
<config>
<mtu>1450</mtu>
</config>
</ipv6>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
As a general restriction, interface names must have valid OcNOS naming conventions, such as 'eth,' 'xe,' 'ce,' 'so,' 'po,' etc. This naming convention is not configurable.
Configure Description
This XML configuration snippet is used to assign a description to a given interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to configure interface description.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<description>Test desc for the interface</description>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used for configuring interface descriptions.
interface xe10
description "Test desc for the interface"
no shutdown
OcNOS NetConf Payload
Here is the sample OcNOS NetConf Payload for configuring interface descriptions.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<description>Test desc for the interface</description>
</config>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for configuring interface descriptions, providing details about the current state of the specified interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<description>Test desc for the interface</description>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<description>Test desc for the interface</description>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.97c3.6447</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
Configure MTU
This XML configuration snippet is used to set the Maximum Transmission Unit (MTU) for an interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to set the MTU for an interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<mtu>1450</mtu>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to set the MTU for an interface.
interface xe10
mtu 1450
no shutdown
OcNOS NetConf Payload
Here is the sample OcNOS NetConf Payload to set the MTU for an interface.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<mtu>1450</mtu>
</config>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for setting the MTU for an interface, providing details about the current state of the specified interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<mtu>1450</mtu>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<mtu>1450</mtu>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.97c3.6447</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<config>
<mtu>1450</mtu>
</config>
</ipv4>
<config>
<index>0</index>
</config>
<ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
<config>
<mtu>1450</mtu>
</config>
</ipv6>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
The leaf mentioned below is used only to configure the physical interface.
/interfaces/interface/config/mtu
Configure Primary IP Address
This XML configuration snippet is used to specify that an IP address and prefix length will be used by the interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to indicate that the interface will use an IP address and a prefix length.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>30.1.1.1</ip>
<config>
<ip>30.1.1.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an IP address and prefix length for an interface.
interface xe10
ip address 30.1.1.1/24
no shutdown
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for assigning a primary IP address and prefix length to an interface.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<config>
<primary-ip-addr>30.1.1.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for assigning a primary IP address and prefix length to an interface, providing details about the current state of the specified interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.97c3.6447</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>30.1.1.1</ip>
<config>
<ip>30.1.1.1</ip>
<prefix-length>24</prefix-length>
</config>
<state>
<ip>30.1.1.1</ip>
<prefix-length>24</prefix-length>
</state>
</address>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
The first entry on the below list will be used as the primary address, as OpenConfig does not have this concept.
/interfaces/interface/subinterfaces/subinterface/ipv4/addresses/address
Configure Secondary IP Address
This XML configuration snippet specifies the use of a secondary IP address and prefix length for an interface. It's important to note that the secondary address cannot be configured if there is no primary IP address present.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is a sample OpenConfig NetConf payload that specifies the configuration for an interface. This configuration includes the interface type, subinterface details, and IPv4 addresses with their respective prefix lengths.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>10.10.10.1</ip>
<config>
<ip>10.10.10.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
<address>
<ip>11.11.11.1</ip>
<config>
<ip>11.11.11.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an interface with both a primary and a secondary IP address.
interface xe10
ip address 10.10.10.1/24
ip address 11.11.11.1/24 secondary
no shutdown
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for configuring interface with both a primary and a secondary IP address.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<secondary-addresses>
<ip-address>11.11.11.1/24</ip-address>
<config>
<ip-address>11.11.11.1/24</ip-address>
</config>
</secondary-addresses>
<config>
<primary-ip-addr>10.10.10.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response providing details about the current state of the specified interface, as configured in the OpenConfig YANG model.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.97c3.6447</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>10.10.10.1</ip>
<config>
<ip>10.10.10.1</ip>
<prefix-length>24</prefix-length>
</config>
<state>
<ip>10.10.10.1</ip>
<prefix-length>24</prefix-length>
</state>
</address>
<address>
<ip>11.11.11.1</ip>
<config>
<ip>11.11.11.1</ip>
<prefix-length>24</prefix-length>
</config>
<state>
<ip>11.11.11.1</ip>
<prefix-length>24</prefix-length>
</state>
</address>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
All leaves of the below list, excluding the first entry, will be treated as secondary addresses.
/interfaces/interface/subinterfaces/subinterface/ipv4/addresses/address
Configure IPv6 Addresses
This XML configuration snippet is used to set the IPv6 addresses of an interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload for configuring IPv6 addresses on an interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe11</name>
<config>
<name>xe11</name>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<subinterfaces>
<subinterface>
<index>0</index>
<ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>ad0f::ac0f:ab0f</ip>
<config>
<ip>ad0f::ac0f:ab0f</ip>
<prefix-length>64</prefix-length>
</config>
</address>
<address>
<ip>ae0f::ad0f:ac0f</ip>
<config>
<ip>ae0f::ad0f:ac0f</ip>
<prefix-length>64</prefix-length>
</config>
</address>
<address>
<ip>f0ca:bebe::cafe</ip>
<config>
<ip>f0ca:bebe::cafe</ip>
<prefix-length>64</prefix-length>
</config>
</address>
</addresses>
</ipv6>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an interface with multiple IPv6 addresses and enable the interface.
interface xe11
ipv6 address ad0f::ac0f:ab0f/64
ipv6 address ae0f::ad0f:ac0f/64
ipv6 address f0ca:bebe::cafe/64
no shutdown
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for configuring an interface with multiple IPv6 addresses.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe11</name>
<config>
<name>xe11</name>
</config>
<ipv6 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<addresses>
<ipv6-address>ad0f::ac0f:ab0f/64</ipv6-address>
<config>
<ipv6-address>ad0f::ac0f:ab0f/64</ipv6-address>
</config>
</addresses>
<addresses>
<ipv6-address>ae0f::ad0f:ac0f/64</ipv6-address>
<config>
<ipv6-address>ae0f::ad0f:ac0f/64</ipv6-address>
</config>
</addresses>
<addresses>
<ipv6-address>f0ca:bebe::cafe/64</ipv6-address>
<config>
<ipv6-address>f0ca:bebe::cafe/64</ipv6-address>
</config>
</addresses>
</ipv6>
</interface>
</interfaces>
Validation with NetConf get
The below NetConf validation response provides details about the current state of the specified interface configured with multiple IPv6 addresses using OpenConfig YANG data model elements.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<duplex-mode>FULL</duplex-mode>
</config>
<state>
<duplex-mode>FULL</duplex-mode>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.97c3.6447</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
Configure Duplex-mode
This XML configuration snippet is used to configure the duplex mode for an interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to configure interface with the FULL duplex mode enabled.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<duplex-mode>FULL</duplex-mode>
</config>
</ethernet>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an interface with full duplex mode enabled and with no shutdown.
interface xe10
duplex full
no shutdown
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to configure interface with full duplex mode enabled and ensures that the interface is in the enabled state.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
</config>
<ethernet xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ethernet">
<config>
<duplex-mode>full</duplex-mode>
</config>
</ethernet>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response provides comprehensive information about the current state of an interface, including its operational and administrative status, traffic counters, and Ethernet configuration details.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<auto-negotiate>false</auto-negotiate>
<port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
</config>
<state>
<port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.9729.abc5</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
Default
By default, the duplex mode for an interface is set to full duplex.
Configure Port-Speed
This XML configuration snippet is used to set the link speed of the interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload that specifies the configuration for an interface. It sets the interface's state to enabled (true) and defines it as an Ethernet interface (ianaift:ethernetCsmacd). Additionally, it specifies that auto-negotiation for link speed is disabled (false) and sets the port speed for a specified Ethernet interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<config>
<auto-negotiate>false</auto-negotiate>
<port-speed xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_1GB</port-speed>
</config>
</ethernet>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an interface for a speed of 1 gigabit and enable it.
interface xe10
speed 1g
no shutdown
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload that enables an interface and sets its speed.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
</config>
<ethernet xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ethernet">
<config>
<port-speed>1g</port-speed>
</config>
</ethernet>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response to set the speed of an interface, providing details about the current state of the specified interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X8100</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.9729.abc5</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
This leaf can only be used when the auto-negotiate leaf (../auto-negotiate) is set to false.
/interfaces/interface/ethernet/config/port-speed
Configure Ethernet Type
This XML configuration snippet is used to specify the Ethernet type for an interface.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload that sets the Ethernet Type for an interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X88A8</tpid>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command configures VLAN tagging with Ethernet Type on an interface and ensures that the interface is not in shutdown mode.
interface xe10
switchport dot1q ethertype 0x88a8
no shutdown
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload that enables an interface and configures it to use a dot1q Ethernet Type for VLAN tagging.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<enabled>true</enabled>
</config>
<extended xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-extended">
<config>
<dot1q-ether-type>0x88a8</dot1q-ether-type>
</config>
</extended>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for the specified interface, providing comprehensive details about its current state, including operational and administrative statuses, traffic counters, Ethernet configuration, and VLAN tagging settings.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan" xmlns:oc-vlan-types="http://openconfig.net/yang/vlan-types">oc-vlan-types:TPID_0X8100</tpid>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</config>
<state>
<name>xe10</name>
<tpid xmlns="http://openconfig.net/yang/vlan-types">TPID_0X88a8</tpid>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>10010</ifindex>
<counters>
<last-clear>0</last-clear>
<out-errors>0</out-errors>
<out-discards>0</out-discards>
<out-multicast-pkts>0</out-multicast-pkts>
<out-broadcast-pkts>0</out-broadcast-pkts>
<out-unicast-pkts>0</out-unicast-pkts>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-fcs-errors>0</in-fcs-errors>
<in-errors>0</in-errors>
<in-discards>0</in-discards>
<in-multicast-pkts>0</in-multicast-pkts>
<in-broadcast-pkts>0</in-broadcast-pkts>
<in-unicast-pkts>0</in-unicast-pkts>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
</state>
<ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet">
<state>
<negotiated-port-speed
xmlns:oc-eth="http://openconfig.net/yang/interfaces/ethernet">oc-eth:SPEED_10GB</negotiated-port-speed>
<negotiated-duplex-mode>FULL</negotiated-duplex-mode>
<hw-mac-address>b86a.9729.abc5</hw-mac-address>
</state>
</ethernet>
<subinterfaces>
<subinterface>
<index>0</index>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
Configure Sub-interface with Primary and Secondary Addresses
This XML configuration snippet sets both primary and secondary IP addresses, each with its corresponding prefix length, for use by a sub-interface.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload for configuring sub-interface with two IPv4 addresses, each having the specified prefix length. This payload specifies the IP addresses to be used by the sub-interface with the specified index.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
</config>
<subinterfaces>
<subinterface>
<index>10</index>
<config>
<index>10</index>
</config>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>20.21.22.23</ip>
<config>
<ip>20.21.22.23</ip>
<prefix-length>24</prefix-length>
</config>
</address>
<address>
<ip>24.25.26.27</ip>
<config>
<ip>24.25.26.27</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure a sub-interface with both a primary and a secondary IPv4 address.
interface xe10.10
ip address 20.21.22.23/24
ip address 24.25.26.27/24 secondary
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for configuring a sub-interface with both a primary and a secondary IPv4 address.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe10.10</name>
<config>
<name>xe10.10</name>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<secondary-addresses>
<ip-address>24.25.26.27/24</ip-address>
<config>
<ip-address>24.25.26.27/24</ip-address>
</config>
</secondary-addresses>
<config>
<primary-ip-addr>20.21.22.23/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response for configuring a sub-interface with two IPv4 addresses, each with a specified prefix length. The response provides information about the current state of the specified sub-interface, including its operational status, interface index, and traffic counters.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe10</name>
<config>
<name>xe10</name>
</config>
<subinterfaces>
<subinterface>
<index>10</index>
<config>
<index>10</index>
</config>
<state>
<name>xe10.10</name>
<logical>true</logical>
<oper-status>DOWN</oper-status>
<ifindex>20500490</ifindex>
<counters>
<last-clear>0</last-clear>
<out-pkts>0</out-pkts>
<out-octets>0</out-octets>
<in-pkts>0</in-pkts>
<in-octets>0</in-octets>
</counters>
</state>
<ipv4 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<address>
<ip>20.21.22.23</ip>
<config>
<ip>20.21.22.23</ip>
<prefix-length>24</prefix-length>
</config>
<state>
<ip>20.21.22.23</ip>
<prefix-length>24</prefix-length>
</state>
</address>
<address>
<ip>24.25.26.27</ip>
<config>
<ip>24.25.26.27</ip>
<prefix-length>24</prefix-length>
</config>This configuration was introduced
<state>
<ip>24.25.26.27</ip>
<prefix-length>24</prefix-length>
</state>
</address>
</addresses>
</ipv4>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
Restrictions
The leaf mentioned below has been restricted to a maximum of 32 characters.
/interfaces/interface/name
The first entry on the below list will be used as the primary address, as OpenConfig does not have this concept.
/interfaces/interface/subinterfaces/subinterface/ipv4/addresses/address
When using OpenConfig translation, use the sub-interface name in the format <ifname>.<id>, as OpenConfig does not support the <ifname>.<id>.<id> format, even though it is allowed by OcNOS CLI.
/interfaces/interface/subinterfaces/subinterface/index