Skip to content

Add IP Infusion OcNOS device (containerlab/vrnetlab) - #3960

Open
victorkhgith wants to merge 2 commits into
ipspace:devfrom
victorkhgith:ocnos-device
Open

victorkhgith wants to merge 2 commits into
ipspace:devfrom
victorkhgith:ocnos-device

Conversation

@victorkhgith

@victorkhgith victorkhgith commented Oct 22, 2026 •

Copy link
Copy Markdown

This PR adds support for IP Infusion OcNOS as a device type (ocnos). OcNOS runs as a vrnetlab container (containerlab kind ipinfusion_ocnos), and netlab configures it with Netmiko (ipinfusion_ocnos driver). The ipinfusion.ocnos Ansible collection is available as an alternative configuration method.

What's included

  • Device settings (netsim/devices/ocnos.yml), support level minimal, Netmiko as the default configuration method
  • Ansible configuration deployment and fetch task lists
  • Configuration templates: initial configuration, OSPFv2, OSPFv3, IS-IS, BGP
  • tests/config/ocnos-netmiko.yml to check Netmiko error detection
  • Documentation: OcNOS caveats (including the image build steps), the containerlab image table, the supported platforms tables, and the Netmiko developer documentation

Test environment

  • OcNOS image OcNOS-SP-PLUS-x86-7.0.0-262-GA.qcow2 (free download after registration), built into vrnetlab/ipinfusion_ocnos:7.0.0-262 using the srl-labs vrnetlab fork
  • netlab dev (7cd5b14; the only later commit is Netmiko developer documentation #3961, documentation), containerlab 0.81.1, netmiko 4.8.0
  • FRR 10.7.1 probes, Ubuntu 22.04 on WSL2

Integration test results (Netmiko)

Tests Passed Passed with a warning Failed
initial 4 0 0
ospf/ospfv2 4 3 (VRF part skipped) 0
ospf/ospfv3 5 2 (VRF part skipped) 0
isis 6 0 0
bgp 9 1 (IPv6 bgp.originate skipped) 0

The Ansible method (ansible-core 2.17.14, ipinfusion.ocnos 1.2.5) gave the same results, except that initial/01c-netmiko does not apply to it.

netlab create rejected tests that need features this PR does not implement; those tests are not counted. I could not run initial/04-mtu (it needs an Arista cEOS probe); I checked MTU separately on a link between two OcNOS nodes (mtu 1400 is configured and active on the interface).

With tests/config/ocnos-netmiko.yml, netlab config invalid and netlab config commit (a change OcNOS rejects only at commit time) both fail the deployment.

pytest -k 'xform_ or error_cases' gives the same results with and without this PR. In my environment, the dev branch has 32 failures, none related to this PR.

OcNOS behavior handled by the templates

  • OSPFv2 areas are configured with network statements in the OSPF process (there is no interface-level OSPFv2 area command). OSPFv3 uses ipv6 router ospf area <area> tag <process> on the interfaces.
  • The loopback interface lo keeps 127.0.0.1/8 as its primary address, so the netlab loopback address is configured as a secondary address. Additional loopbacks are loopback<n>.
  • The management interface is in the management VRF, so the vrnetlab management subnet does not conflict with netlab loopback addresses.
  • IS-IS uses level-2-only, and wide metrics are set with isis wide-metric.
  • BGP sends standard and extended communities by default. The template turns off the types not listed in bgp.community.
  • A network prefix is advertised only when it is in the routing table, so bgp.originate prefixes get a discard static route.

Not implemented

VRFs, route import (redistribution), default route origination, BFD, graceful restart, unnumbered interfaces, VLANs, IPv6 bgp.originate, and LLA-only IPv6 interfaces.

Disclosure: I work at IP Infusion.

@jbemmel

jbemmel commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Hi Victor,

Thanks for your contribution!

Have you considered using Netmiko to configure OcNOS, instead of Ansible? See #3937 - the project is trying to move away from its Ansible dependency, and it would be very helpful if new devices would use the new leaner method (it's basically SCP followed by applying the config)

@victorkhgith

Copy link
Copy Markdown
Author

@jbemmel, let me use Netmiko, thank you.

@ipspace

ipspace commented Oct 22, 2026

Copy link
Copy Markdown
Owner

@jbemmel, let me use Netmiko, thank you.

OcNOS support in Netmiko seems pretty thin (there's just the SSH/Telnet driver), so I'm not sure whether the approach we're currently using to configure devices with Netmiko would work.

Anyhow, I'd love to reduce the Ansible usage, so if you can't get OcNOS to work with Netmiko, please let me know, and we'll figure something out.

Also, I (finally) added Netmiko developer documentation in #3961 so you won't have to reverse-engineer what device features have to be set.

Device settings, config deployment/fetch task lists, initial, OSPFv2/OSPFv3, IS-IS and BGP templates, and documentation (caveats, image table, platform tables).
Netmiko ipinfusion_ocnos driver (netlab calls commit() after each snippet), error_regexp skips OcNOS '% Warning' lines, tests/config/ocnos-netmiko.yml for error detection, OcNOS added to the Netmiko developer documentation. The Ansible task lists remain as an alternative method.
@victorkhgith

victorkhgith commented Oct 23, 2026 •

Copy link
Copy Markdown
Author

Thanks @ipspace and @jbemmel. Netmiko works with OcNOS, so I switched the default to it.

The OcNOS driver is thin, but it has a commit() that raises an error when OcNOS rejects a commit, and netlab already calls it after each configuration snippet. error_regexp is ^%(?! Warning).* because OcNOS prints a harmless % Warning when a command runs from a parent configuration mode.

The initial, OSPFv2, OSPFv3, IS-IS and BGP integration tests give the same results as with Ansible, initial/01c-netmiko now runs and passes, and tests/config/ocnos-netmiko.yml checks that an invalid command and a rejected commit both fail. I also added OcNOS to the new Netmiko developer documentation (thanks for writing it, it made this much easier). The Ansible task lists are still there as an alternative. Details are in the updated description.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants