nokia_srlinux adapter

Features

The main feature of this module is the handling of the whole configuration of a Nokia SR Linux device. It uses netconf as networking management protocol and yang as high level configuration modeling language. Instead of using the yang files directly, the module uses pre-compiled xml obtained from the yang models in docs/yang_models.

Tooling is available to convert yang configuration from the device into model code automatically (as shown below). For more information contact sales.

Usage example

The example model below shows how you can use the adapter to configure an IP address on subinterfaces of the router. You can find more usage examples in the examples repo.

import nokia_srlinux
import nokia_srlinux::interface as srinterface
import nokia_srlinux::interface::subinterface as srsubinterface
import nokia_srlinux::interface::subinterface::ipv4 as sripv4
import yang



######## Leaf 1 ########

leaf1 = nokia_srlinux::GnmiDevice(
    auto_agent=true,
    name="leaf1",
    mgmt_ip="172.30.0.210",
    yang_credentials=yang::Credentials(
        username="admin",
        password="NokiaSrl1!",
    ),
)

leaf1_eth1 = nokia_srlinux::Interface(
    device=leaf1,
    name="ethernet-1/1",
    mtu=9000,
    subinterface=[
        srinterface::Subinterface(
            x_index=0,
            ipv4=srsubinterface::Ipv4(
                address=sripv4::Address(
                    ip_prefix="10.10.11.2/30",
                ),
            ),
        ),
    ],
)

########################


######## Leaf 2 ########

leaf2 = nokia_srlinux::GnmiDevice(
    auto_agent=true,
    name="leaf2",
    mgmt_ip="172.30.0.220",
    yang_credentials=yang::Credentials(
        username="admin",
        password="NokiaSrl1!",
    ),
)

leaf2_eth1 = nokia_srlinux::Interface(
    device=leaf2,
    name="ethernet-1/1",
    mtu=9000,
    subinterface=[
        srinterface::Subinterface(
            x_index=0,
            ipv4=srsubinterface::Ipv4(
                address=sripv4::Address(
                    ip_prefix="10.10.21.2/30",
                ),
            ),
        ),
    ],
)

########################


######## Spine ########

spine = nokia_srlinux::GnmiDevice(
    auto_agent=true,
    name="spine",
    mgmt_ip="172.30.0.100",
    yang_credentials=yang::Credentials(
        username="admin",
        password="NokiaSrl1!",
    ),
)

# |ethernet 1| #

spine_eth1 = nokia_srlinux::Interface(
    device=spine,
    name="ethernet-1/1",
    mtu=9000,
    subinterface=[
        srinterface::Subinterface(
            x_index=0,
            ipv4=srsubinterface::Ipv4(
                address=sripv4::Address(ip_prefix="10.10.11.1/30"),
            ),
        ),
    ],
)

# |ethernet 2| #

spine_eth2 = nokia_srlinux::Interface(
    device=spine,
    name="ethernet-1/2",
    mtu=9000,
    subinterface=[
        srinterface::Subinterface(
            x_index=0,
            ipv4=srsubinterface::Ipv4(
                address=sripv4::Address(ip_prefix="10.10.21.1/30"),
            ),
        ),
    ],
)