From f75a15b3cae858425d76703df85761b7135d8955 Mon Sep 17 00:00:00 2001 From: Sebastian Rieger Date: Wed, 23 Nov 2016 14:13:47 +0100 Subject: [PATCH] cloud-init scripts for LXCs fixed by Christoph Hardegen --- .../advcompnet-lab2-dcn-fabricpath.virl | 195 +++++++++++++++++- 1 file changed, 184 insertions(+), 11 deletions(-) diff --git a/GIT-VIRL-HS-Fulda/Advanced Computer Networks (Master AI)/advcompnet-lab2-dcn-fabricpath.virl b/GIT-VIRL-HS-Fulda/Advanced Computer Networks (Master AI)/advcompnet-lab2-dcn-fabricpath.virl index 6040dd8..9495a39 100644 --- a/GIT-VIRL-HS-Fulda/Advanced Computer Networks (Master AI)/advcompnet-lab2-dcn-fabricpath.virl +++ b/GIT-VIRL-HS-Fulda/Advanced Computer Networks (Master AI)/advcompnet-lab2-dcn-fabricpath.virl @@ -1,9 +1,9 @@ - + exclusive - + !Command: show running-config !Time: Tue Jun 23 19:24:32 2015 @@ -840,7 +840,7 @@ router bgp 1 - + !Command: show running-config !Time: Tue Jun 23 19:24:33 2015 @@ -1671,7 +1671,7 @@ router bgp 1 - + !Command: show running-config @@ -2457,7 +2457,7 @@ router bgp 1 - + !Command: show running-config @@ -3243,7 +3243,7 @@ router bgp 1 - + !Command: show running-config !Time: Tue Jun 23 19:24:30 2015 @@ -4032,7 +4032,7 @@ router bgp 1 - + !Command: show running-config !Time: Tue Jun 23 19:24:31 2015 @@ -4833,34 +4833,207 @@ router bgp 1 - + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: lxc-iperf-1 +manage_etc_hosts: true +runcmd: +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.20.22 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) ALL +write_files: +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + ifconfig eth1 up 192.168.100.1 netmask 255.255.255.0 + exit 0 + + 10 - + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: lxc-iperf-2 +manage_etc_hosts: true +runcmd: +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.20.22 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) ALL +write_files: +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + ifconfig eth1 up 192.168.100.2 netmask 255.255.255.0 + exit 0 + + 10 - + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: lxc-iperf-3 +manage_etc_hosts: true +runcmd: +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.20.22 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) ALL +write_files: +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + ifconfig eth1 up 192.168.100.3 netmask 255.255.255.0 + exit 0 + + 10 - + + + #cloud-config +bootcmd: +- ln -s -t /etc/rc.d /etc/rc.local +hostname: lxc-iperf-4 +manage_etc_hosts: true +runcmd: +- systemctl start rc-local +- sed -i '/^\s*PasswordAuthentication\s\+no/d' /etc/ssh/sshd_config +- echo "UseDNS no" >> /etc/ssh/sshd_config +- service ssh restart +- service sshd restart +users: +- default +- gecos: User configured by VIRL Configuration Engine 0.20.22 + lock-passwd: false + name: cisco + plain-text-passwd: cisco + shell: /bin/bash + ssh-authorized-keys: + - VIRL-USER-SSH-PUBLIC-KEY + sudo: ALL=(ALL) ALL +write_files: +- path: /etc/systemd/system/dhclient@.service + content: | + [Unit] + Description=Run dhclient on %i interface + After=network.target + [Service] + Type=oneshot + ExecStart=/sbin/dhclient %i -pf /var/run/dhclient.%i.pid -lf /var/lib/dhclient/dhclient.%i.lease + RemainAfterExit=yes + owner: root:root + permissions: '0644' +- path: /etc/rc.local + owner: root:root + permissions: '0755' + content: |- + #!/bin/sh + ifconfig eth1 up 192.168.100.4 netmask 255.255.255.0 + exit 0 + + 10 +