OcNOS-SP : OpenConfig Command Reference : Tunnel Interfaces OpenConfig Translation
Tunnel Interfaces OpenConfig Translation
Create Tunnel Interface
This XML configuration snippet is used to specify the configuration for an OpenConfig interface with a tunnel type, source and destination IP addresses.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload configures an OpenConfig interface as a tunnel type with specific source and destination IP addresses and Time to Live (TTL) settings.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>Tunnel30</name>
<config>
<name>Tunnel30</name>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:tunnel</type>
</config>
<tunnel xmlns="http://openconfig.net/yang/interfaces/tunnel">
<ipv4>
<addresses>
<address>
<ip>40.1.1.1</ip>
<config>
<ip>40.1.1.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
<config>
<src>20.2.2.1</src>
<dst>20.2.2.2</dst>
<ttl>250</ttl>
</config>
</tunnel>
</interface>
</interfaces>
OcNOS CLI Command
The below CLI command is used to configure an interface with an IP address, a tunnel source and destination addresses, and a tunnel TTL value.
interface Tunnel30
ip address 40.1.1.1/24
tunnel source 20.2.2.1
tunnel destination 20.2.2.2
tunnel ttl 250
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload that configures a Tunnel Interface with the specified source and destination addresses, and a TTL value. It also includes a secondary IPv4 address for the interface.
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>Tunnel30</name>
<config>
<name>Tunnel30</name>
</config>
<tunnel xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-extended">
<config>
<src>20.2.2.1</src>
<dst>20.2.2.2</dst>
<ttl>250</ttl>
</config>
</tunnel>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<secondary-addresses>
<ip-address>40.1.1.1/24</ip-address>
<config>
<ip-address>40.1.1.1/24</ip-address>
</config>
</secondary-addresses>
</ipv4>
</interface>
</interfaces>
Validation with NetConf get
Here is a NetConf validation response provides an information about the configuration and status of the Tunnel Interface.
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>Tunnel30</name>
<config>
<name>Tunnel30</name>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:tunnel</type>
</config>
<state>
<name>Tunnel30</name>
<logical>false</logical>
<last-change>0</last-change>
<oper-status>DOWN</oper-status>
<admin-status>UP</admin-status>
<ifindex>0</ifindex>
<type
xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:tunnel</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_UNKNOWN</negotiated-port-speed>
<negotiated-duplex-mode>HALF</negotiated-duplex-mode>
<hw-mac-address>0000.0000.0000</hw-mac-address>
</state>
</ethernet>
<tunnel xmlns="http://openconfig.net/yang/interfaces/tunnel">
<ipv4>
<addresses>
<address>
<ip>40.1.1.1</ip>
<config>
<ip>40.1.1.1</ip>
<prefix-length>24</prefix-length>
</config>
<state>
<ip>40.1.1.1</ip>
<prefix-length>24</prefix-length>
</state>
</address>
</addresses>
</ipv4>
<config>
<src>20.2.2.1</src>
<dst>20.2.2.2</dst>
<ttl>250</ttl>
</config>
<state>
<src>20.2.2.1</src>
<dst>20.2.2.2</dst>
<ttl>250</ttl>
</state>
</tunnel>
</interface>
</interfaces>
Restrictions
Tunnel interfaces must begin with Tunnel followed by a numerical value, such as Tunnel30.
/interfaces/interface/name
The tunnel configuration parameters src and dst do not have support for IPv6.
/interfaces/interface/tunnel/config/dst
/interfaces/interface/tunnel/config/src
The data type of the ttl leaf has been updated from uint8 to uint16.
/interfaces/interface/tunnel/config/ttl
The primary IP address is determined by the first configured address, and it is not possible to delete the primary address without removing the other addresses.
/interfaces/interface/tunnel/ipv4/addresses/address/config/ip