Creating Device configuration snippets [CREATED] dut: 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 server [SSH] SSH server on node server (device iol) is ready after 28.4 seconds Config Deploying device 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: [dut] ok: [server] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for dut, c1, c2, server TASK [Figure out whether to deploy the module initial on current device] ******* ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [Find configuration template for initial] ********************************* ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [fail] ******************************************************************** skipping: [dut] skipping: [c1] skipping: [c2] skipping: [server] TASK [Find configuration deployment deploy_script for initial] ***************** ok: [c1] ok: [c2] ok: [dut] ok: [server] 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 GigabitEthernet0-1.c_vrf.dut\n172.16.1.1 GigabitEthernet0-2.dut\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 dut\n172.16.0.1 GigabitEthernet0-1.c_vrf.dut\n172.16.1.1 GigabitEthernet0-2.dut\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" } ok: [dut] => { "msg": "initial configuration for dut\n=========================================\nhostname dut\n!\nno ip domain lookup\nlogging buffered 256000\n\n!\nlldp run\n!\nip host dut-c_vrf 172.16.0.1\nip host server 172.16.1.4\n!\nip routing\n!\nno ipv6 unicast-routing\n!\nvrf definition c_vrf\n rd 65000:1\n route-target import 65000:1\n route-target export 65000:1\n!\n address-family ipv4\n exit-address-family\n!\n\n!\n!\ninterface Loopback0\n ip address 10.0.0.1 255.255.255.255\n!\ninterface GigabitEthernet0/0\n no lldp transmit\n no lldp receive\n!\ninterface GigabitEthernet0/1\n vrf forwarding c_vrf\n description dut -> [c1,c2] [stub]\n ip address 172.16.0.1 255.255.255.0\n no shutdown\n!\ninterface GigabitEthernet0/2\n description dut -> server [stub]\n ip address 172.16.1.1 255.255.255.0\n no shutdown\n!\n!\n! Configure DHCP client - has to be done before routing protocol config, but after generic interface config\n!\n\n!\nline vty 0 4\n exec-timeout 0 0 \n!\nno banner exec\nno banner login\nno banner incoming\n" } ok: [server] => { "msg": "initial configuration for server\n=========================================\nhostname server\n!\nno ip domain lookup\nlogging buffered 256000\n\n!\nlldp run\n!\nip host dut 10.0.0.1 172.16.1.1\nip host dut-c_vrf 172.16.0.1\n!\nip routing\n!\nno ipv6 unicast-routing\n!\n!\n!\ninterface Ethernet0/0\n no lldp transmit\n no lldp receive\n!\ninterface Ethernet0/1\n description server -> dut [stub]\n ip address 172.16.1.4 255.255.255.0\n no shutdown\n!\n!\n! Configure DHCP client - has to be done before routing protocol config, but after generic interface config\n!\n\n!\nline vty 0 4\n exec-timeout 0 0 \n!\nno banner exec\nno banner login\nno banner incoming\n" } TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/ios.yml for dut, server included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux.yml for c1, c2 TASK [ios_config: deploying initial from /work/netlab_cicd/node_files/dut/initial] *** [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: [server] changed: [dut] 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] ok: [dut] ok: [server] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for dut, c1, c2, server => (item=vrf) included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for dut, c1, c2, server => (item=routing) included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for dut, c1, c2, server => (item=dhcp) TASK [Figure out whether to deploy the module vrf on current device] *********** ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [Find configuration template for vrf] ************************************* skipping: [c1] skipping: [c2] skipping: [server] ok: [dut] TASK [fail] ******************************************************************** skipping: [dut] skipping: [c1] skipping: [c2] skipping: [server] TASK [Find configuration deployment deploy_script for vrf] ********************* skipping: [c1] skipping: [c2] skipping: [server] ok: [dut] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [c1] skipping: [c2] skipping: [server] ok: [dut] => { "msg": "vrf configuration for dut\n=========================================\n!\n!\n" } TASK [Deploy vrf configuration] ************************************************ skipping: [c1] skipping: [c2] skipping: [server] included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/ios.yml for dut TASK [ios_config: deploying vrf from /work/netlab_cicd/node_files/dut/vrf] ***** ok: [dut] TASK [Figure out whether to deploy the module routing on current device] ******* ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [Find configuration template for routing] ********************************* skipping: [dut] skipping: [c1] skipping: [c2] ok: [server] TASK [fail] ******************************************************************** skipping: [dut] skipping: [c1] skipping: [c2] skipping: [server] TASK [Find configuration deployment deploy_script for routing] ***************** skipping: [dut] skipping: [c1] skipping: [c2] ok: [server] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [dut] skipping: [c1] skipping: [c2] ok: [server] => { "msg": "routing configuration for server\n=========================================\n!\n!\n! Static routes\n!\nip route 0.0.0.0 0.0.0.0 Ethernet0/1 172.16.1.1\n" } TASK [Deploy routing configuration] ******************************************** skipping: [dut] skipping: [c1] skipping: [c2] included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/ios.yml for server TASK [ios_config: deploying routing from /work/netlab_cicd/node_files/server/routing] *** changed: [server] TASK [Figure out whether to deploy the module dhcp on current device] ********** ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [Find configuration template for dhcp] ************************************ ok: [c1] ok: [c2] ok: [dut] ok: [server] TASK [fail] ******************************************************************** skipping: [dut] skipping: [c1] skipping: [c2] skipping: [server] TASK [Find configuration deployment deploy_script for dhcp] ******************** ok: [c1] ok: [c2] ok: [dut] ok: [server] 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: [dut] => { "msg": "dhcp configuration for dut\n=========================================\nip dhcp relay information option vpn\n!\ninterface GigabitEthernet0/1\n ip helper-address global 172.16.1.4\n" } ok: [server] => { "msg": "dhcp configuration for server\n=========================================\nip dhcp excluded-address vrf c_vrf 172.16.0.1\n!\nip dhcp pool links_1_\n vrf c_vrf\n network 172.16.0.0 255.255.255.0\n!\nip dhcp relay information option vpn\n!\n" } TASK [Deploy dhcp configuration] *********************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/ios.yml for dut, server included: /home/pipi/netlab_gh/netsim/ansible/tasks/linux/dhcp.yml for c1, c2 TASK [ios_config: deploying dhcp from /work/netlab_cicd/node_files/dut/dhcp] *** changed: [dut] changed: [server] TASK [Install dnsmasq] ********************************************************* skipping: [c1] skipping: [c2] TASK [Install isc-dhcp-relay] ************************************************** skipping: [c1] skipping: [c2] TASK [Create DHCP deployment script] ******************************************* changed: [c2] changed: [c1] 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=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 dut : ok=25 changed=2 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 server : ok=25 changed=3 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 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.