Creating Device configuration snippets [CREATED] dut: normalize,initial,dhcp [CREATED] c1: initial,dhcp [CREATED] c2: initial,dhcp [CREATED] c3: initial,dhcp [CREATED] c4: initial,dhcp [CREATED] s1: initial,dhcp,services,routing [CREATED] s2: initial,dhcp,services,routing Checking Are lab devices ready to be configured? [INFO] Checking SSH server(s) on dut [SSH] SSH server on node dut (device ioll2) is ready after 10.3 seconds Config Normalizing device configurations netmiko: [INFO] Sent normalize configuration to dut Config Deploying device configurations [INFO] Executing initial configuration for node s1 (namespace clab- ml-17-s1) [INFO] Executing initial configuration for node s2 (namespace clab- ml-17-s2) [INFO] Executing routing configuration for node s1 (namespace clab- ml-17-s1) [INFO] Executing routing configuration for node s2 (namespace clab- ml-17-s2) netmiko: [INFO] Sent initial configuration to dut netmiko: [INFO] Sent dhcp configuration to dut [INFO] Starting Ansible playbook to deploy the rest of the configurations [WARNING]: Found variable using reserved name: hosts PLAY [Deploy initial device configuration] ************************************* TASK [Set variables that cannot be set with VARS] ****************************** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for c1, c2, c3, c4 TASK [Figure out whether to deploy the module initial on current device] ******* ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Find configuration template for initial] ********************************* ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Find configuration deployment deploy_script for initial] ***************** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Print deployed configuration when running in verbose mode] *************** ok: [c1] => { "msg": "initial configuration for c1\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname c1\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n172.16.0.1 Ethernet0-1.dut\n172.16.1.1 Ethernet0-2.dut\n172.16.2.1 Ethernet0-3.dut\n172.16.3.1 Ethernet1-0.dut\n172.16.2.6 s1 eth1.s1\n172.16.3.7 s2 eth1.s2\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname c1\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n dhcp4: true\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=1\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } ok: [c3] => { "msg": "initial configuration for c3\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname c3\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n172.16.0.1 Ethernet0-1.dut\n172.16.1.1 Ethernet0-2.dut\n172.16.2.1 Ethernet0-3.dut\n172.16.3.1 Ethernet1-0.dut\n172.16.2.6 s1 eth1.s1\n172.16.3.7 s2 eth1.s2\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname c3\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n dhcp4: true\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=1\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } ok: [c2] => { "msg": "initial configuration for c2\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname c2\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n172.16.0.1 Ethernet0-1.dut\n172.16.1.1 Ethernet0-2.dut\n172.16.2.1 Ethernet0-3.dut\n172.16.3.1 Ethernet1-0.dut\n172.16.2.6 s1 eth1.s1\n172.16.3.7 s2 eth1.s2\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname c2\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n dhcp4: true\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=1\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } ok: [c4] => { "msg": "initial configuration for c4\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname c4\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n172.16.0.1 Ethernet0-1.dut\n172.16.1.1 Ethernet0-2.dut\n172.16.2.1 Ethernet0-3.dut\n172.16.3.1 Ethernet1-0.dut\n172.16.2.6 s1 eth1.s1\n172.16.3.7 s2 eth1.s2\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname c4\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n dhcp4: true\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=1\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } TASK [Deploy initial configuration] ******************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-config/linux.yml for c1, c2, c3, c4 TASK [template] **************************************************************** changed: [c1] changed: [c3] changed: [c2] changed: [c4] TASK [Execute /tmp/config.sh to deploy initial config from /work/netlab_cicd/node_files/c1/initial] *** changed: [c2] changed: [c4] changed: [c3] changed: [c1] PLAY [Deploy module-specific configurations] *********************************** TASK [Set variables that cannot be set with VARS] ****************************** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for c1, c2, c3, c4 => (item=dhcp) included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for c1, c2, c3, c4 => (item=services) included: /home/pipi/net101/tools/netsim/ansible/tasks/deploy-module.yml for c1, c2, c3, c4 => (item=routing) TASK [Figure out whether to deploy the module dhcp on current device] ********** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Find configuration template for dhcp] ************************************ ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Find configuration deployment deploy_script for dhcp] ******************** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Print deployed configuration when running in verbose mode] *************** ok: [c1] => { "msg": "dhcp configuration for c1\n=========================================\n# This is a placeholder file. DHCP is configured during initial configuration\n#\nif [ `grep 'ID=ubuntu' /etc/os-release` ]; then\n echo \"DHCP is supported, it should work after another plea to netplan\"\n netplan apply\nelse\n echo \"netlab supports DHCP only on Ubuntu\" >&2\n exit 1\nfi\n" } ok: [c2] => { "msg": "dhcp configuration for c2\n=========================================\n# This is a placeholder file. DHCP is configured during initial configuration\n#\nif [ `grep 'ID=ubuntu' /etc/os-release` ]; then\n echo \"DHCP is supported, it should work after another plea to netplan\"\n netplan apply\nelse\n echo \"netlab supports DHCP only on Ubuntu\" >&2\n exit 1\nfi\n" } ok: [c3] => { "msg": "dhcp configuration for c3\n=========================================\n# This is a placeholder file. DHCP is configured during initial configuration\n#\nif [ `grep 'ID=ubuntu' /etc/os-release` ]; then\n echo \"DHCP is supported, it should work after another plea to netplan\"\n netplan apply\nelse\n echo \"netlab supports DHCP only on Ubuntu\" >&2\n exit 1\nfi\n" } ok: [c4] => { "msg": "dhcp configuration for c4\n=========================================\n# This is a placeholder file. DHCP is configured during initial configuration\n#\nif [ `grep 'ID=ubuntu' /etc/os-release` ]; then\n echo \"DHCP is supported, it should work after another plea to netplan\"\n netplan apply\nelse\n echo \"netlab supports DHCP only on Ubuntu\" >&2\n exit 1\nfi\n" } TASK [Deploy dhcp configuration] *********************************************** included: /home/pipi/net101/tools/netsim/ansible/tasks/linux/dhcp.yml for c1, c2, c3, c4 TASK [Install dnsmasq] ********************************************************* skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Install isc-dhcp-relay] ************************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Create DHCP deployment script] ******************************************* changed: [c3] changed: [c2] changed: [c1] changed: [c4] TASK [Execute /tmp/config.sh to deploy dhcp config from /work/netlab_cicd/node_files/c1/dhcp] *** changed: [c4] changed: [c2] changed: [c3] changed: [c1] TASK [Figure out whether to deploy the module services on current device] ****** ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Find configuration template for services] ******************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Find configuration deployment deploy_script for services] **************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Deploy services configuration] ******************************************* skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Figure out whether to deploy the module routing on current device] ******* ok: [c1] ok: [c2] ok: [c3] ok: [c4] TASK [Find configuration template for routing] ********************************* skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Find configuration deployment deploy_script for routing] ***************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] TASK [Deploy routing configuration] ******************************************** skipping: [c1] skipping: [c2] skipping: [c3] skipping: [c4] PLAY [Deploy custom deployment templates] ************************************** skipping: no hosts matched PLAY RECAP ********************************************************************* c1 : ok=22 changed=4 unreachable=0 failed=0 skipped=14 rescued=0 ignored=0 c2 : ok=22 changed=4 unreachable=0 failed=0 skipped=14 rescued=0 ignored=0 c3 : ok=22 changed=4 unreachable=0 failed=0 skipped=14 rescued=0 ignored=0 c4 : ok=22 changed=4 unreachable=0 failed=0 skipped=14 rescued=0 ignored=0 Results of configuration script deployments ================================================================================ dut Script: normalize,initial,dhcp s1 Script: initial,routing s2 Script: initial,routing Use this topology to test the DHCPv4 relay functionality of your device. Use 'netlab validate' to check whether your device propagated DHCPv4 requests from DHCP clients (Linux VMs) to DHCP servers.