OcNOS-SP : OpenConfig Command Reference : OSPFv2 Openconfig Translation
OSPFv2 Openconfig Translation
Create OSPF process
This XML configuration snippet is used to create OSPF process.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NETCONF Payload
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>xe2</name>
<config>
<name>xe2</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>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">
<identifier>oc-pol-types:OSPF</identifier>
<name>100</name>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<ospfv2>
<global>
<config>
<router-id>2.2.2.2</router-id>
</config>
</global>
<areas>
<area>
<identifier>0.0.0.0</identifier>
<config>
<identifier>0.0.0.0</identifier>
</config>
<interfaces>
<interface>
<id>xe2</id>
<config>
<id>xe2</id>
<network-type xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:NON_BROADCAST_NETWORK</network-type>
<passive>true</passive>
<authentication-type>simple</authentication-type>
</config>
<interface-ref>
<config>
<interface>xe2</interface>
</config>
</interface-ref>
</interface>
</interfaces>
</area>
</areas>
</ospfv2>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
ospf area-interface-config-mode
router ospf 100
ospf router-id 2.2.2.2
area 0.0.0.0 interface xe2
area 0.0.0.0 interface xe2 passive
area 0.0.0.0 interface xe2 network-type non-broadcast
area 0.0.0.0 interface xe2 authentication
!
OcNOS NETCONF Payload
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>xe2</name>
<config>
<name>xe2</name>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<config>
<primary-ip-addr>10.10.10.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>default</instance-name>
<config>
<instance-name>default</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>default</vrf-name>
</config>
</vrf>
<bridge xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bridge">
<config>
<protocol>ieee-vlan-bridge</protocol>
</config>
</bridge>
</network-instance>
</network-instances>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>100</ospf-id>
<config>
<router-id>2.2.2.2</router-id>
<ospf-id>100</ospf-id>
<vrf-name>default</vrf-name>
</config>
<areas>
<area>
<area-id>0.0.0.0</area-id>
<config>
<area-id>0.0.0.0</area-id>
</config>
<interfaces>
<interface>
<name>xe2</name>
<config>
<name>xe2</name>
<network-type>non-broadcast</network-type>
<passive />
<authentication-type>simple</authentication-type>
</config>
</interface>
</interfaces>
</area>
</areas>
</process>
</processes>
<global>
<config>
<area-interface-config-mode />
</config>
</global>
</ospfv2>
Validation with NETCONF get
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<ospfv2>
<global>
<config>
<router-id>2.2.2.2</router-id>
</config>
</global>
<areas>
<area>
<identifier>0.0.0.0</identifier>
<config>
<identifier>0.0.0.0</identifier>
</config>
<state>
<identifier>0.0.0.0</identifier>
</state>
<interfaces>
<interface>
<id>xe2</id>
<config>
<id>xe2</id>
<network-type
xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:NON_BROADCAST_NETWORK</network-type>
<passive>true</passive>
<authentication-type>simple</authentication-type>
</config>
<interface-ref>
<config>
<interface>xe2</interface>
</config>
</interface-ref>
<state>
<id>xe2</id>
<network-type
xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:NON_BROADCAST_NETWORK</network-type>
<passive>true</passive>
<authentication-type>simple</authentication-type>
</state>
</interface>
</interfaces>
</area>
</areas>
</ospfv2>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
<network-instance>
<name>management</name>
<config>
<name>management</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</config>
</network-instance>
</network-instances>
Restrictions
Area
/network-instances/network-instance/protocols/protocol/ospfv2/areas/area
must always be set with interface. At least one.
/network-instances/network-instance/protocols/protocol/ospfv2/areas/area/interfaces/interface
Create OSPF process
This XML configuration snippet is used to create OSPF process.
Release
This configuration was introduced in OcNOS version 6.3.
OpenConfig NETCONF Payload
<interfaces xmlns="http://openconfig.net/yang/interfaces">
<interface>
<name>eth1</name>
<config>
<name>eth1</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>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
<interface>
<name>eth2</name>
<config>
<name>eth2</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>20.20.20.1</ip>
<config>
<ip>20.20.20.1</ip>
<prefix-length>24</prefix-length>
</config>
</address>
</addresses>
</ipv4>
<config>
<index>0</index>
</config>
</subinterface>
</subinterfaces>
</interface>
</interfaces>
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">
<identifier>oc-pol-types:OSPF</identifier>
<name>100</name>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<ospfv2>
<global>
<config>
<router-id>1.1.1.1</router-id>
<log-adjacency-changes>true</log-adjacency-changes>
<summary-route-cost-mode>RFC1583_COMPATIBLE</summary-route-cost-mode>
</config>
<mpls>
<config>
<traffic-engineering-extensions>false</traffic-engineering-extensions>
</config>
</mpls>
<graceful-restart>
<config>
<enabled>false</enabled>
</config>
</graceful-restart>
<timers>
<max-metric>
<config>
<set>true</set>
<include>MAX_METRIC_INCLUDE_STUB</include>
</config>
</max-metric>
<lsa-generation>
<config>
<initial-delay>100</initial-delay>
<maximum-delay>100</maximum-delay>
</config>
</lsa-generation>
<spf>
<config>
<initial-delay>400</initial-delay>
<maximum-delay>4000</maximum-delay>
</config>
</spf>
</timers>
</global>
<areas>
<area>
<identifier>0.0.0.0</identifier>
<config>
<identifier>0.0.0.0</identifier>
</config>
<interfaces>
<interface>
<id>eth1</id>
<config>
<id>eth1</id>
<passive>true</passive>
<priority>255</priority>
<network-type xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:POINT_TO_POINT_NETWORK</network-type>
<authentication-type>message-digest</authentication-type>
<metric>65535</metric>
</config>
<interface-ref>
<config>
<interface>eth1</interface>
</config>
</interface-ref>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<lsa-filter>
<config>
<all>true</all>
</config>
</lsa-filter>
<mpls>
<config>
<traffic-engineering-metric>1</traffic-engineering-metric>
</config>
<igp-ldp-sync>
<config>
<enabled>true</enabled>
<post-session-up-delay>1000</post-session-up-delay>
</config>
</igp-ldp-sync>
</mpls>
<timers>
<config>
<dead-interval>2</dead-interval>
<hello-interval>1</hello-interval>
<retransmission-interval>1</retransmission-interval>
</config>
</timers>
</interface>
</interfaces>
</area>
<area>
<identifier>1.1.1.1</identifier>
<config>
<identifier>1.1.1.1</identifier>
</config>
<interfaces>
<interface>
<id>eth2</id>
<config>
<id>eth2</id>
</config>
<interface-ref>
<config>
<interface>eth2</interface>
</config>
</interface-ref>
</interface>
</interfaces>
<virtual-links>
<virtual-link>
<remote-router-id>10.143.74.1</remote-router-id>
<config>
<remote-router-id>10.143.74.1</remote-router-id>
</config>
</virtual-link>
</virtual-links>
</area>
</areas>
</ospfv2>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
ospf area-interface-config-mode
router ospf 100
ospf router-id 1.1.1.1
max-metric router-lsa include-stub
compatible rfc1583
log-adjacency-changes detail
no capability restart graceful
timers spf exp 400 4000
timers throttle lsa all 100 100 100
area 0.0.0.0 interface eth1
area 0.0.0.0 interface eth1 passive
area 0.0.0.0 interface eth1 cost 65535
area 0.0.0.0 interface eth1 network-type point-to-point
area 0.0.0.0 interface eth1 priority 255
area 0.0.0.0 interface eth1 authentication message-digest
area 0.0.0.0 interface eth1 bfd
area 0.0.0.0 interface eth1 database-filter all out
area 0.0.0.0 interface eth1 te-metric 1
area 0.0.0.0 interface eth1 mpls ldp-igp sync ospf holddown-timer 1
area 0.0.0.0 interface eth1 dead-interval 2
area 0.0.0.0 interface eth1 hello-interval 1
area 0.0.0.0 interface eth1 retransmit-interval 1
area 1.1.1.1 interface eth2
area 1.1.1.1 virtual-link 10.143.74.1
no capability traffic-engineering
no capability cspf
!
OcNOS NETCONF Payload
<interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
<interface>
<name>eth1</name>
<config>
<name>eth1</name>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<config>
<primary-ip-addr>10.10.10.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
<interface>
<name>eth2</name>
<config>
<name>eth2</name>
</config>
<ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
<config>
<primary-ip-addr>20.20.20.1/24</primary-ip-addr>
</config>
</ipv4>
</interface>
</interfaces>
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>default</instance-name>
<config>
<instance-name>default</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>default</vrf-name>
</config>
</vrf>
<bridge xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bridge">
<config>
<protocol>ieee-vlan-bridge</protocol>
</config>
</bridge>
</network-instance>
</network-instances>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>100</ospf-id>
<config>
<router-id>1.1.1.1</router-id>
<ospf-id>100</ospf-id>
<vrf-name>default</vrf-name>
</config>
<capability>
<config>
<disable-traffic-engineering />
<disable-graceful-restart />
</config>
</capability>
<max-metric>
<config>
<enable-max-router-lsa />
<include-stub />
</config>
</max-metric>
<timers>
<lsa>
<delays>
<delay>
<start-delay>100</start-delay>
<min-delay>100</min-delay>
<max-delay>100</max-delay>
<config>
<start-delay>100</start-delay>
<min-delay>100</min-delay>
<max-delay>100</max-delay>
</config>
</delay>
</delays>
</lsa>
<spf>
<delay>
<config>
<min-delay>400</min-delay>
<max-delay>4000</max-delay>
</config>
</delay>
</spf>
</timers>
<areas>
<area>
<area-id>0.0.0.0</area-id>
<config>
<area-id>0.0.0.0</area-id>
</config>
<interfaces>
<interface>
<name>eth1</name>
<config>
<name>eth1</name>
<passive/>
<priority>255</priority>
<network-type>point-to-point</network-type>
<authentication-type>message-digest</authentication-type>
<cost>65535</cost>
</config>
<enable-bfd>
<config>
<enabled>enable</enabled>
</config>
</enable-bfd>
<lsa-filter>
<config>
<filter-out/>
</config>
</lsa-filter>
<mpls>
<config>
<traffic-engineering-metric>1</traffic-engineering-metric>
</config>
<igp-ldp-sync>
<config>
<ldp-igp-sync-enable/>
<holddown-timer>1</holddown-timer>
</config>
</igp-ldp-sync>
</mpls>
<timers>
<config>
<dead-interval>2</dead-interval>
<hello-interval>1</hello-interval>
<retransmission-interval>1</retransmission-interval>
</config>
</timers>
</interface>
</interfaces>
</area>
<area>
<area-id>1.1.1.1</area-id>
<config>
<area-id>1.1.1.1</area-id>
</config>
<interfaces>
<interface>
<name>eth2</name>
<config>
<name>eth2</name>
</config>
</interface>
</interfaces>
<virtual-links>
<virtual-link>
<remote-router-id>10.143.74.1</remote-router-id>
<config>
<remote-router-id>10.143.74.1</remote-router-id>
</config>
</virtual-link>
</virtual-links>
</area>
</areas>
</process>
</processes>
<global>
<config>
<area-interface-config-mode/>
</config>
</global>
</ospfv2>
Validation with NETCONF get
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<ospfv2>
<global>
<config>
<router-id>1.1.1.1</router-id>
<summary-route-cost-mode>RFC1583_COMPATIBLE</summary-route-cost-mode>
<log-adjacency-changes>true</log-adjacency-changes>
</config>
<mpls>
<config>
<traffic-engineering-extensions>false</traffic-engineering-extensions>
</config>
</mpls>
<graceful-restart>
<config>
<enabled>false</enabled>
</config>
</graceful-restart>
<timers>
<lsa-generation>
<config>
<initial-delay>100</initial-delay>
<maximum-delay>100</maximum-delay>
</config>
</lsa-generation>
<spf>
<config>
<initial-delay>400</initial-delay>
<maximum-delay>4000</maximum-delay>
</config>
</spf>
<max-metric>
<config>
<set>true</set>
<include
xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:MAX_METRIC_INCLUDE_STUB</include>
</config>
</max-metric>
</timers>
</global>
<areas>
<area>
<identifier>0.0.0.0</identifier>
<config>
<identifier>0.0.0.0</identifier>
</config>
<interfaces>
<interface>
<id>eth1</id>
<config>
<id>eth1</id>
<metric>65535</metric>
<network-type
xmlns:oc-ospf-types="http://openconfig.net/yang/ospf-types">oc-ospf-types:POINT_TO_POINT_NETWORK</network-type>
<passive>true</passive>
<priority>255</priority>
<authentication-type>message-digest</authentication-type>
</config>
<interface-ref>
<config>
<interface>eth1</interface>
</config>
</interface-ref>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<lsa-filter>
<config>
<all>true</all>
</config>
</lsa-filter>
<mpls>
<config>
<traffic-engineering-metric>1</traffic-engineering-metric>
</config>
<igp-ldp-sync>
<config>
<enabled>true</enabled>
<post-session-up-delay>1000</post-session-up-delay>
</config>
</igp-ldp-sync>
</mpls>
<timers>
<config>
<dead-interval>2</dead-interval>
<hello-interval>1</hello-interval>
<retransmission-interval>1</retransmission-interval>
</config>
</timers>
</interface>
</interfaces>
</area>
<area>
<identifier>1.1.1.1</identifier>
<config>
<identifier>1.1.1.1</identifier>
</config>
<interfaces>
<interface>
<id>eth2</id>
<config>
<id>eth2</id>
</config>
<interface-ref>
<config>
<interface>eth2</interface>
</config>
</interface-ref>
</interface>
</interfaces>
<virtual-links>
<virtual-link>
<remote-router-id>10.143.74.1</remote-router-id>
<config>
<remote-router-id>10.143.74.1</remote-router-id>
</config>
</virtual-link>
</virtual-links>
</area>
</areas>
</ospfv2>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:OSPF</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
<network-instance>
<name>management</name>
<config>
<name>management</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</config>
</tables>
</network-instance>
</network-instances>
Restrictions
In OpenConfig, for path /network-instances/network-instance/protocols/protocol/ospfv2/areas/area/interfaces/interface/mpls/igp-ldp-sync/config/post-session-up-delay, only steps of 1000 by 1000 should be configured, to prevent broken values ​​from being configured and then being presented rounded in get operations.