Coder Social home page Coder Social logo

srlinux_basics's Introduction

Basic Nokia SRLinux demo

Run a standalone SRL container.

  1. Requirements

    • OS environment (min. system requirements):
      • Centos 8.x or Centos 7.x system with min. Kernel 4.17
      • 8 GB RAM
      • 8 core CPU
    • Software
      • Docker CE installed, minimum version 18.09:
      • Python version 3.6 or higher
      • license key file available
      • srl container image available
  2. Copy the SRL inmage X.Y.Z-N.tar.xz file into Project directory on Centos 8 Host Machine.

    • Out of scope
  3. Copy the license.key into Project directory.

    • Out of scope
  4. Load the docker image. To load the image, the user must have root privilege, or be part of the docker group.

    docker image load -i 20.6.1-286.tar.xz
  5. Check that the docker image was imported correctly:

    docker images
    REPOSITORY                     TAG                 IMAGE ID            CREATED             SIZE
    srlinux                        20.6.1-286          79019d14cfc7        3 weeks ago         1.32GB
  6. Deploy a SRL container

    docker run -t -d --rm --privileged \
    --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    --sysctl net.ipv4.ip_forward=0 \
    --sysctl net.ipv6.conf.all.accept_dad=0 \
    --sysctl net.ipv6.conf.default.accept_dad=0 \
    --sysctl net.ipv6.conf.all.autoconf=0 \
    --sysctl net.ipv6.conf.default.autoconf=0 \
    -u $(id -u):$(id -g) \
    -v $SRL_LICENSE:/opt/srlinux/etc/license.key:ro \
    --name $SRL_NAME srlinux:20.6.1-286 \
    bash -c 'sudo opt/srlinux/bin/sr_linux'
    
  7. Check if container runs

    docker ps
    CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS               NAMES
    2919c2a3705d        srlinux:20.6.1-286   "/tini -- fixuid -q …"   4 minutes ago       Up 3 minutes                            srlinux_dut1
  8. Find mgmt IP address

    SRL_NAME='srlinux_dut1'
    docker inspect $SRL_NAME  --format "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}"
    172.17.0.2
    
  9. Access SRL CLI (via SSH or via 'Console')

    docker exec -ti srlinux_dut1 sr_cli
    

Add a virtual link between containers

  1. Create usable names for Namespaces
    # Create DIR
        mkdir -p /run/netns/
    # Get container PID and create a soft link for userfriendly CLI
        container_name=$srl_a
        container_pid=$(docker inspect $container_name  --format "{{json .State.Pid}}")
        ln -s /proc/$container_pid/ns/net /run/netns/$container_name
    
        container_name=$srl_b
        container_pid=$(docker inspect $container_name  --format "{{json .State.Pid}}")
        ln -s /proc/$container_pid/ns/net /run/netns/$container_name
    # Report
        ip netns
  2. Create VETH links and glue them to SRL containers
    # Create VETH connection between $srl_a and $srl_b containers
        ip link add tmp_a type veth peer name tmp_b
        ip link set tmp_a netns $srl_a
        ip link set tmp_b netns $srl_b
        ip netns exec $srl_a ip link set tmp_a name $srl_a_int
        ip netns exec $srl_b ip link set tmp_b name $srl_b_int
        ip netns exec $srl_a ip link set $srl_a_int up
        ip netns exec $srl_b ip link set $srl_b_int up
    # Disable Offload option for both container
        docker exec -ti $srl_a ethtool --offload $srl_a_int rx off tx off
        docker exec -ti $srl_b ethtool --offload $srl_b_int rx off tx off

Configuration

srlinux_basics's People

Contributors

pklepikov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.