[WARNING]: Could not match supplied host pattern, ignoring: unprovisioned PLAY [Deploy initial device configuration] ************************************* TASK [Set variables that cannot be set with VARS] ****************************** ok: [xs] ok: [h1] ok: [h2] ok: [dut] ok: [h3] ok: [h4] TASK [Find device readiness script] ******************************************** ok: [xs] ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [dut] TASK [Wait for device to become ready] ***************************************** skipping: [dut] skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Normalize config on bridge-like devices] ********************************* included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for dut, xs, h1, h2, h3, h4 TASK [Figure out whether to deploy the module normalize on current device] ***** ok: [xs] ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [dut] TASK [Find configuration template for normalize] ******************************* ok: [xs] ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [dut] TASK [fail] ******************************************************************** skipping: [dut] skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] ok: [dut] => msg: |- normalize configuration for dut ========================================= ! interface Ethernet1 shutdown mac-address 52dc.cafe.0501 ! interface Ethernet2 shutdown mac-address 52dc.cafe.0502 ! interface Ethernet3 shutdown mac-address 52dc.cafe.0503 ! interface Ethernet4 shutdown mac-address 52dc.cafe.0504 TASK [Find configuration deployment deploy_script for normalize] *************** skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] ok: [dut] TASK [Deploy normalize configuration] ****************************************** skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/eos.yml for dut TASK [eos_config: deploying normalize from /home/pipi/net101/tools/netsim/ansible/templates/normalize/eos.j2] *** [WARNING]: To ensure idempotency and correct diff the input configuration lines should be similar to how they appear if present in the running configuration on device including the indentation changed: [dut] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for dut, xs, h1, h2, h3, h4 TASK [Figure out whether to deploy the module initial on current device] ******* ok: [xs] ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [dut] TASK [Find configuration template for initial] ********************************* ok: [xs] ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [dut] TASK [fail] ******************************************************************** skipping: [dut] skipping: [xs] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Print deployed configuration when running in verbose mode] *************** ok: [h1] => msg: |- initial configuration for h1 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.0.1/24 dev eth1 2>/dev/null set -e ip addr add 172.16.0.1/24 dev eth1 ip link set dev eth1 mtu 1500 # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.0.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.0.5 dev eth1 protocol static # # Print the final routing table ip route ok: [h4] => msg: |- initial configuration for h4 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.1.4/24 dev eth1 2>/dev/null set -e ip addr add 172.16.1.4/24 dev eth1 ip link set dev eth1 mtu 1500 # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.1.6 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.1.6 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.1.6 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.1.6 dev eth1 protocol static # # Print the final routing table ip route ok: [h2] => msg: |- initial configuration for h2 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.0.2/24 dev eth1 2>/dev/null set -e ip addr add 172.16.0.2/24 dev eth1 ip link set dev eth1 mtu 1500 # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.0.6 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.0.6 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.0.6 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.0.6 dev eth1 protocol static # # Print the final routing table ip route ok: [h3] => msg: |- initial configuration for h3 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.1.3/24 dev eth1 2>/dev/null set -e ip addr add 172.16.1.3/24 dev eth1 ip link set dev eth1 mtu 1500 # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.1.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.1.5 dev eth1 protocol static # # Print the final routing table ip route ok: [xs] => msg: |- initial configuration for xs ========================================= #!/bin/bash # set -e set -x # # Create bash profile script # cat <<SCRIPT >/root/.bash_profile #!/bin/bash # export PS1="\h(bash)# " echo echo "Use vtysh to connect to FRR daemon" echo SCRIPT cat <<SCRIPT >.bash_profile #!/bin/bash # export PS1="\h(bash)$ " export PATH=$PATH:/usr/sbin echo echo "Use sudo vtysh to connect to FRR daemon" echo SCRIPT # # Build hosts file # # cat <<SCRIPT >/tmp/hosts # # Created by netlab initial # 10.0.0.5 dut 172.16.0.5 Vlan1000.dut 172.16.1.5 Vlan1001.dut 10.0.0.6 xs 172.16.0.6 vlan1000.xs 172.16.1.6 vlan1001.xs 172.16.0.1 h1 eth1.h1 172.16.0.2 h2 eth1.h2 172.16.1.3 h3 eth1.h3 172.16.1.4 h4 eth1.h4 SCRIPT grep "Created by netlab" /etc/hosts || uniq /tmp/hosts >>/etc/hosts # # Configure system defaults on Ubuntu # hostnamectl set-hostname xs sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv6.conf.all.forwarding=1 APT_INSTALL= # if which curl; then echo "Package curl already installed" else APT_INSTALL="$APT_INSTALL curl" fi # if which gpg; then echo "Package gnupg already installed" else APT_INSTALL="$APT_INSTALL gnupg" fi # if which bridge; then echo "Package iproute2 already installed" else APT_INSTALL="$APT_INSTALL iproute2" fi # # APT_INSTALL always starts with a blank, so we can't just check if it's empty # The following hack turns a string that contains only whitespaces into # an empty string and removes leading whitespaces # APT_INSTALL=`echo $APT_INSTALL` if [ -n "$APT_INSTALL" ]; then echo "Installing packages $APT_INSTALL" apt-get update -qq && apt-get install -qq $APT_INSTALL fi # # Install FRR on a Ubuntu VM if needed # if which /usr/lib/frr/frrinit.sh; then echo "FRR already installed, skipping installation" else curl -s https://deb.frrouting.org/frr/keys.asc >/etc/apt/trusted.gpg.d/frr.asc FRRVER="frr-stable" echo deb https://deb.frrouting.org/frr $(lsb_release -s -c) $FRRVER > /etc/apt/sources.list.d/frr.list apt-get update -qq && apt-get install -qq frr frr-pythontools bridge-utils ethtool fi # # Enable FRR modules (if not using containerlab bind-mounted /etc/frr/daemons) # # # Enable FRR daemons # /usr/lib/frr/frrinit.sh restart # # Create loopbacks, stub and lag/bond devices # if [ ! -e /sys/class/net/lo ]; then if [ ! -e /sys/devices/virtual/net/lo ]; then ip link add lo type dummy ip link set dev lo up fi fi if [ ! -e /sys/class/net/bond1 ]; then if [ ! -e /sys/devices/virtual/net/bond1 ]; then # # Make sure 'bonding' module is loaded # if [ ! -e /sys/module/bonding ]; then modprobe bonding miimon=100 mode=802.3ad lacp_rate=fast fi if [ ! -e /sys/class/net/bond1 ]; then ip link add dev bond1 type bond mode 802.3ad lacp_rate slow fi ip link set dev bond1 up fi fi # Disable IPv6 (for IPv4-only interfaces) or SLAAC (if the device is a router) # sysctl -qw net.ipv6.conf.bond1.disable_ipv6=1 ip link set dev bond1 mtu 1500 sysctl -qw net.ipv6.conf.eth1.disable_ipv6=1 ip link set dev eth1 mtu 1500 sysctl -qw net.ipv6.conf.eth2.disable_ipv6=1 ip link set dev eth2 mtu 1500 sysctl -qw net.ipv6.conf.eth3.disable_ipv6=1 ip link set dev eth3 mtu 1500 sysctl -qw net.ipv6.conf.eth4.disable_ipv6=1 ip link set dev eth4 mtu 1500 # # Add vtysh.conf file echo "service integrated-vtysh-config" >/etc/frr/vtysh.conf # # Rest of initial configuration done through VTYSH # cat >/tmp/config <<CONFIG hostname xs ! frr defaults datacenter ! interface lo no shutdown ip address 10.0.0.6/32 ! interface bond1 no shutdown description xs -> dut ! no ip address ! interface eth1 no shutdown description xs -> dut ! no ip address ! interface eth2 no shutdown description xs -> dut ! no ip address ! interface eth3 no shutdown description [Access VLAN v1] xs -> h2 ! no ip address ! interface eth4 no shutdown description [Access VLAN v2] xs -> h4 ! no ip address ! interface bond1.1000 no shutdown description [SubIf VLAN v1] xs -> dut ! no ip address ! interface bond1.1001 no shutdown description [SubIf VLAN v2] xs -> dut ! no ip address ! interface vlan1000 no shutdown description VLAN v1 (1000) -> [h1,dut,h2] ip address 172.16.0.6/24 ! interface vlan1001 no shutdown description VLAN v2 (1001) -> [h3,dut,h4] ip address 172.16.1.6/24 ! do write CONFIG vtysh -f /tmp/config exit 0 ok: [dut] => msg: |- initial configuration for dut ========================================= hostname dut ! logging monitor debugging aaa authorization exec default local ! lldp run ip routing ! ! ip host h1 172.16.0.1 ip host h2 172.16.0.2 ip host h3 172.16.1.3 ip host h4 172.16.1.4 ip host xs 10.0.0.6 172.16.0.6 172.16.1.6 ! interface Management1 no lldp transmit no lldp receive ! interface Loopback0 ip address 10.0.0.5/32 ! interface port-channel1 no switchport description dut -> xs ! interface Ethernet1 no switchport description dut -> xs ! mac-address 52dc.cafe.0501 no shutdown ! interface Ethernet2 no switchport description dut -> xs ! mac-address 52dc.cafe.0502 no shutdown ! interface Ethernet3 no switchport description [Access VLAN v1] dut -> h1 ! mac-address 52dc.cafe.0503 no shutdown ! interface Ethernet4 no switchport description [Access VLAN v2] dut -> h3 ! mac-address 52dc.cafe.0504 no shutdown ! interface Vlan1000 description VLAN v1 (1000) -> [h1,xs,h2] ip address 172.16.0.5/24 ! interface Vlan1001 description VLAN v2 (1001) -> [h3,xs,h4] ip address 172.16.1.5/24 ! TASK [Find configuration deployment deploy_script for initial] ***************** ok: [xs] ok: [h1] ok: [h3] ok: [h2] ok: [h4] ok: [dut] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/eos.yml for dut included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/frr.yml for xs included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/linux-clab.yml for h1, h2, h3, h4 TASK [eos_config: deploying initial from /home/pipi/net101/tools/netsim/ansible/templates/initial/eos.j2] *** changed: [dut] TASK [template] **************************************************************** changed: [xs] TASK [set_fact] **************************************************************** ok: [xs] TASK [run /tmp/config.sh to deploy initial config from /home/pipi/net101/tools/netsim/ansible/templates/initial/frr.j2] *** changed: [xs] TASK [run vtysh to import initial config from /home/pipi/net101/tools/netsim/ansible/templates/initial/frr.j2] *** skipping: [xs] TASK [Define script filename and determine whether to execute in netns] ******** ok: [h1] ok: [h2] ok: [h3] ok: [h4] TASK [Create a temporary file for the rendered script] ************************* changed: [h3 -> localhost] changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h4 -> localhost] TASK [Create container setup script from /home/pipi/net101/tools/netsim/ansible/templates/initial/linux-clab.j2] *** changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] TASK [Copy script into running container at /tmp/config-h1_initial.sh] ********* skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Execute /tmp/config-h1_initial.sh to deploy initial config based on /home/pipi/net101/tools/netsim/ansible/templates/initial/linux-clab.j2] *** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Container configuration for initial based on /home/pipi/net101/tools/netsim/ansible/templates/initial/linux-clab.j2 executed in netns] *** changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] TASK [Remove temporary file /tmp/h1_initial-2jna37he.sh] *********************** changed: [h3 -> localhost] changed: [h4 -> localhost] changed: [h1 -> localhost] changed: [h2 -> localhost] PLAY [Deploy module-specific configurations] *********************************** TASK [Set variables that cannot be set with VARS] ****************************** ok: [xs] ok: [dut] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for dut, xs => (item=lag) included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for dut, xs => (item=vlan) TASK [Figure out whether to deploy the module lag on current device] *********** ok: [xs] ok: [dut] TASK [Find configuration template for lag] ************************************* ok: [xs] ok: [dut] TASK [fail] ******************************************************************** skipping: [dut] skipping: [xs] TASK [Print deployed configuration when running in verbose mode] *************** ok: [xs] => msg: |- lag configuration for xs ========================================= #!/bin/bash # set -e # Exit immediately when any command fails # # Bond devices are created by 'initial' module - add members # ethtool -s eth1 autoneg off speed 1000 duplex full ip link set dev eth1 down ip link set dev eth1 master bond1 ip link set dev eth1 up ethtool -s eth2 autoneg off speed 1000 duplex full ip link set dev eth2 down ip link set dev eth2 master bond1 ip link set dev eth2 up ip link set dev bond1 up exit 0 ok: [dut] => msg: |- lag configuration for dut ========================================= interface port-channel1 description dut -> xs ! ! interface Ethernet1 description dut -> xs in channel-group 1 channel-group 1 mode active ! interface Ethernet2 description dut -> xs in channel-group 1 channel-group 1 mode active TASK [Find configuration deployment deploy_script for lag] ********************* ok: [xs] ok: [dut] TASK [Deploy lag configuration] ************************************************ included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/eos.yml for dut included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/frr.yml for xs TASK [eos_config: deploying lag from /home/pipi/net101/tools/netsim/ansible/templates/lag/eos.j2] *** changed: [dut] TASK [template] **************************************************************** changed: [xs] TASK [set_fact] **************************************************************** ok: [xs] TASK [run /tmp/config.sh to deploy lag config from /home/pipi/net101/tools/netsim/ansible/templates/lag/frr.j2] *** changed: [xs] TASK [run vtysh to import lag config from /home/pipi/net101/tools/netsim/ansible/templates/lag/frr.j2] *** skipping: [xs] TASK [Figure out whether to deploy the module vlan on current device] ********** ok: [xs] ok: [dut] TASK [Find configuration template for vlan] ************************************ ok: [xs] ok: [dut] TASK [fail] ******************************************************************** skipping: [dut] skipping: [xs] TASK [Print deployed configuration when running in verbose mode] *************** ok: [xs] => msg: |- vlan configuration for xs ========================================= #!/bin/bash # set -e # Exit immediately when any command fails # if [ ! -e /sys/devices/virtual/net/bond1.1000 ]; then ip link add link bond1 name bond1.1000 type vlan id 1000 ip link set dev bond1.1000 up fi if [ ! -e /sys/devices/virtual/net/bond1.1001 ]; then ip link add link bond1 name bond1.1001 type vlan id 1001 ip link set dev bond1.1001 up fi if [ ! -e /sys/devices/virtual/net/vlan1000 ]; then brctl addbr vlan1000 ip link set dev vlan1000 address 52:dc:ca:fd:06:00 ip link set dev vlan1000 mtu 1500 ip addr flush dev vlan1000 ip addr add 172.16.0.6/24 dev vlan1000 fi if [ ! -e /sys/devices/virtual/net/vlan1001 ]; then brctl addbr vlan1001 ip link set dev vlan1001 address 52:dc:ca:fd:06:01 ip link set dev vlan1001 mtu 1500 ip addr flush dev vlan1001 ip addr add 172.16.1.6/24 dev vlan1001 fi brctl addif vlan1000 eth3 brctl addif vlan1001 eth4 brctl addif vlan1000 bond1.1000 brctl addif vlan1001 bond1.1001 ip link set dev vlan1000 up ip link set dev vlan1001 up exit 0 ok: [dut] => msg: |- vlan configuration for dut ========================================= vlan 1000 name v1 ! vlan 1001 name v2 ! ! interface port-channel1 switchport switchport mode trunk switchport trunk allowed vlan 1000,1001 ! interface Ethernet3 switchport switchport access vlan 1000 ! interface Ethernet4 switchport switchport access vlan 1001 ! interface Vlan1000 ! interface Vlan1001 TASK [Find configuration deployment deploy_script for vlan] ******************** ok: [xs] ok: [dut] TASK [Deploy vlan configuration] *********************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/eos.yml for dut included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/frr.yml for xs TASK [eos_config: deploying vlan from /home/pipi/net101/tools/netsim/ansible/templates/vlan/eos.j2] *** changed: [dut] TASK [template] **************************************************************** changed: [xs] TASK [set_fact] **************************************************************** ok: [xs] TASK [run /tmp/config.sh to deploy vlan config from /home/pipi/net101/tools/netsim/ansible/templates/vlan/frr.j2] *** changed: [xs] TASK [run vtysh to import vlan config from /home/pipi/net101/tools/netsim/ansible/templates/vlan/frr.j2] *** skipping: [xs] PLAY [Deploy custom deployment templates] ************************************** skipping: no hosts matched PLAY RECAP ********************************************************************* dut : ok=31 changed=4 unreachable=0 failed=0 skipped=5 rescued=0 ignored=0 h1 : ok=16 changed=4 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 h2 : ok=16 changed=4 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 h3 : ok=16 changed=4 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 h4 : ok=16 changed=4 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 xs : ok=33 changed=6 unreachable=0 failed=0 skipped=11 rescued=0 ignored=0 The device under test is a layer-2 switch connected with a LAG VLAN trunk to another layer-2 switch. Host in the same VLAN should be able to ping each other.