SD-WAN

 View Only
last person joined: 14 days ago 

Ask questions and share experiences with SD-WAN and Session Smart Router (formerly 128T).
  • 1.  Using the network-namespace setting on a device-interface

     
    Posted 01-05-2019 14:07
    Question about the `network-namespace` setting on a `host` device interface: If I specify a pre-existing ns name here, what should I expect 128T to do when it adds the KNI? Will it place the interface in the specified namespace automatically, or will I need to move it there with a plugin network-script? Currently I'm seeing that I need to move it into the ns I configure myself. Perhaps the intention of this setting is that 128T would create the namespace, and it wouldn't pre-exist?

    Any clarification on how this is supposed to work would be appreciated.

    ------------------------------
    - Reid
    ------------------------------


  • 2.  RE: Using the network-namespace setting on a device-interface

    Posted 01-05-2019 15:05
    As of now, putting in a value for network-namespaces does not actually create the namespace or move the interface to that namespace.  It simply informs the 128T fastLane process what network-namespace it should look in to check for link status on the kni interface.  The work of creating the namespace and moving the interface should be handled by creating an init script using the network plugin infrastructure.  The name of the namespace in the configuration will also be passed as the second option to the init script.

    Furthermore, the namespace needs to be created with an NSID.  There are functions that should be leveraged in the init scripts that can be found in /etc/128technology/plugins/network-scripts/common/namespace_helpers.

    Here is an example init script to setup and move an interface to a namespace
    #!/bin/bash
    KNI_NAME=$1
    NS=$2
    # Import common functions related to namespace operations
    source /etc/128technology/plugins/network-scripts/common/namespace_helpers
    source /etc/sysconfig/network-scripts/ifcfg-$1

    # create namespace if it doesn't exist
    if [ ! -e "/var/run/netns/$NS" ]; then
    echo "$NS namespace does not exist...creating it."
    create_namespace $NS
    ip netns exec $NS ip link set lo up
    echo "NS created."
    echo "Setting ip_forwarding in namespace $NS."
    ip netns exec $NS sysctl -w net.ipv4.ip_forward=1
    fi
     
    # set up KNI if it exists in the default namespace
    if [ -d "/sys/devices/virtual/net/$KNI_NAME" ]; then
    echo "$KNI_NAME found in default namespace."
    echo "Moving $KNI_NAME to $NS namespace."
    ip link set $KNI_NAME netns $NS
    ip netns exec $NS ip a add $IPADDR/$PREFIX dev $KNI_NAME
    ip netns exec $NS ip l set $KNI_NAME up
    fi

    ------------------------------
    Lane Shields
    Sales Engineer
    GA
    ------------------------------



  • 3.  RE: Using the network-namespace setting on a device-interface

     
    Posted 01-05-2019 20:16
    Thanks @Mark Shields , that matches what I'm seeing them.

    Out of curiosity, the $IPADDR/$PREFIX vars in your script... Are you setting those manually somewhere, or are they passed in somehow?

    ------------------------------
    - Reid
    ------------------------------



  • 4.  RE: Using the network-namespace setting on a device-interface

     
    Posted 01-05-2019 20:18
    Ah, I think I see it. Looks like those would be sourced from the ifcfg script file.

    ------------------------------
    - Reid
    ------------------------------



  • 5.  RE: Using the network-namespace setting on a device-interface

    Posted 01-05-2019 22:56
    Yep, you got it.  We create an ifcfg file for the kni, so when I source that using the $1 argument to the init script, I can just reference those variables and get the values we set via config.

    ------------------------------
    Lane Shields
    Sales Engineer
    GA
    (781) 328-0010
    ------------------------------