Creating Device configuration snippets [CREATED] relay: initial,vrf,dhcp [CREATED] c1: initial,dhcp [CREATED] c2: initial,dhcp [CREATED] server: initial,dhcp,routing Checking Are lab devices ready to be configured? [INFO] Checking SSH server(s) on relay,server [SSH] SSH server on node relay (device iol) is ready after 28.4 seconds [SSH] SSH server on node server (device iol) is ready after 28.4 seconds Config Deploying device configurations [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] TASK [Normalize config on bridge-like devices] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for c1, c2 TASK [Figure out whether to deploy the module normalize on current device] ***** ok: [c1] ok: [c2] TASK [Find configuration template for normalize] ******************************* ok: [c1] ok: [c2] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] TASK [Find configuration deployment deploy_script for normalize] *************** ok: [c1] ok: [c2] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] TASK [Deploy normalize configuration] ****************************************** skipping: [c1] skipping: [c2] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for c1, c2 TASK [Figure out whether to deploy the module initial on current device] ******* ok: [c1] ok: [c2] TASK [Find configuration template for initial] ********************************* ok: [c1] ok: [c2] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] TASK [Find configuration deployment deploy_script for initial] ***************** ok: [c1] ok: [c2] 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 relay\n172.16.0.1 Ethernet0-1.c_vrf.relay\n172.16.1.1 Ethernet0-2.relay\n172.16.1.4 server Ethernet0-1.server\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: [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 relay\n172.16.0.1 Ethernet0-1.c_vrf.relay\n172.16.1.1 Ethernet0-2.relay\n172.16.1.4 server Ethernet0-1.server\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" } TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux.yml for c1, c2 TASK [template] **************************************************************** changed: [c2] changed: [c1] TASK [Execute /tmp/config.sh to deploy initial config from /work/netlab_cicd/node_files/c1/initial] *** changed: [c2] changed: [c1] PLAY [Deploy module-specific configurations] *********************************** TASK [Set variables that cannot be set with VARS] ****************************** ok: [c1] ok: [c2] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for c1, c2 => (item=vrf) included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for c1, c2 => (item=routing) included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for c1, c2 => (item=dhcp) TASK [Figure out whether to deploy the module vrf on current device] *********** ok: [c1] ok: [c2] TASK [Find configuration template for vrf] ************************************* skipping: [c1] skipping: [c2] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] TASK [Find configuration deployment deploy_script for vrf] ********************* skipping: [c1] skipping: [c2] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] TASK [Deploy vrf configuration] ************************************************ skipping: [c1] skipping: [c2] TASK [Figure out whether to deploy the module routing on current device] ******* ok: [c1] ok: [c2] TASK [Find configuration template for routing] ********************************* skipping: [c1] skipping: [c2] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] TASK [Find configuration deployment deploy_script for routing] ***************** skipping: [c1] skipping: [c2] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] TASK [Deploy routing configuration] ******************************************** skipping: [c1] skipping: [c2] TASK [Figure out whether to deploy the module dhcp on current device] ********** ok: [c1] ok: [c2] TASK [Find configuration template for dhcp] ************************************ ok: [c1] ok: [c2] TASK [fail] ******************************************************************** skipping: [c1] skipping: [c2] TASK [Find configuration deployment deploy_script for dhcp] ******************** ok: [c1] ok: [c2] 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" } TASK [Deploy dhcp configuration] *********************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/linux/dhcp.yml for c1, c2 TASK [Install dnsmasq] ********************************************************* skipping: [c1] skipping: [c2] TASK [Install isc-dhcp-relay] ************************************************** skipping: [c1] skipping: [c2] TASK [Create DHCP deployment script] ******************************************* changed: [c1] changed: [c2] TASK [Execute /tmp/config.sh to deploy dhcp config from /work/netlab_cicd/node_files/c1/dhcp] *** changed: [c1] changed: [c2] PLAY [Deploy custom deployment templates] ************************************** skipping: no hosts matched PLAY RECAP ********************************************************************* c1 : ok=26 changed=4 unreachable=0 failed=0 skipped=17 rescued=0 ignored=0 c2 : ok=26 changed=4 unreachable=0 failed=0 skipped=17 rescued=0 ignored=0 Results of configuration script deployments ================================================================================ relay Startup: initial,vrf,dhcp server Startup: initial,dhcp,routing Use this topology to test the inter-VRF DHCPv4 relay functionality of your device. Use 'netlab validate' to check whether your device propagated DHCPv4 requests from DHCP clients (Linux VMs) in VRF c_vrf to DHCP servers in global routing table.