exclusive #!/bin/bash # vars IP="10.0.0.1" HOSTNAME="cumulusvx-1" # test touch touch /tmp/cumulusvx-config # add VIRL user useradd -m cisco -s /bin/bash echo "cisco:cisco" | chpasswd addgroup cisco sudo # set hostname echo "$IP $HOSTNAME" >>/etc/hosts echo "$HOSTNAME" >/etc/hostname hostname $HOSTNAME # add network interface config cat << EOF >>/etc/network/interfaces auto lo:1 iface lo:1 address $IP/32 auto swp1 iface swp1 address $IP/32 auto swp2 iface swp2 address $IP/32 EOF ifup -a # add ospf daemon to quagga sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons service quagga restart # add quagga config cat << EOF > /etc/quagga/Quagga.conf hostname $HOSTNAME log file /var/log/quagga/ospfd.log log timestamp precision 6 username cumulus nopassword ! service integrated-vtysh-config ! password cn321 enable password cn321 ! interface swp1 ip ospf network point-to-point ! interface swp2 ip ospf network point-to-point ! router ospf ospf router-id $IP network $IP/32 area 0.0.0.0 ! line vty ! EOF service quagga restart #!/bin/bash # vars IP="10.0.0.2" HOSTNAME="cumulusvx-2" # test touch touch /tmp/cumulusvx-config # add VIRL user useradd -m cisco -s /bin/bash echo "cisco:cisco" | chpasswd addgroup cisco sudo # set hostname echo "$IP $HOSTNAME" >>/etc/hosts echo "$HOSTNAME" >/etc/hostname hostname $HOSTNAME # add network interface config cat << EOF >>/etc/network/interfaces auto lo:1 iface lo:1 address $IP/32 auto swp1 iface swp1 address $IP/32 auto swp2 iface swp2 address $IP/32 EOF ifup -a # add ospf daemon to quagga sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons service quagga restart # add quagga config cat << EOF > /etc/quagga/Quagga.conf hostname $HOSTNAME log file /var/log/quagga/ospfd.log log timestamp precision 6 username cumulus nopassword ! service integrated-vtysh-config ! password cn321 enable password cn321 ! interface swp1 ip ospf network point-to-point ! interface swp2 ip ospf network point-to-point ! router ospf ospf router-id $IP network $IP/32 area 0.0.0.0 ! line vty ! EOF service quagga restart #!/bin/bash # vars IP="10.0.0.3" LEAF_IP="10.21.0.1" HOSTNAME="cumulusvx-3" # test touch touch /tmp/cumulusvx-config # add VIRL user useradd -m cisco -s /bin/bash echo "cisco:cisco" | chpasswd addgroup cisco sudo # set hostname echo "$IP $HOSTNAME" >>/etc/hosts echo "$HOSTNAME" >/etc/hostname hostname $HOSTNAME # add network interface config cat << EOF >>/etc/network/interfaces auto lo:1 iface lo:1 address $IP/32 auto lo:2 iface lo:2 address $LEAF_IP/24 auto swp1 iface swp1 address $IP/32 auto swp2 iface swp2 address $IP/32 EOF ifup -a # add ospf daemon to quagga sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons service quagga restart # add quagga config cat << EOF > /etc/quagga/Quagga.conf hostname $HOSTNAME log file /var/log/quagga/ospfd.log log timestamp precision 6 username cumulus nopassword ! service integrated-vtysh-config ! password cn321 enable password cn321 ! interface swp1 ip ospf network point-to-point ! interface swp2 ip ospf network point-to-point ! router ospf ospf router-id $IP network $IP/32 area 0.0.0.0 network $LEAF_IP/24 area 0.0.0.0 ! line vty ! EOF service quagga restart #!/bin/bash # vars IP="10.0.0.4" LEAF_IP="10.11.0.1" HOSTNAME="cumulusvx-4" # test touch touch /tmp/cumulusvx-config # add VIRL user useradd -m cisco -s /bin/bash echo "cisco:cisco" | chpasswd addgroup cisco sudo # set hostname echo "$IP $HOSTNAME" >>/etc/hosts echo "$HOSTNAME" >/etc/hostname hostname $HOSTNAME # add network interface config cat << EOF >>/etc/network/interfaces auto lo:1 iface lo:1 address $IP/32 auto lo:2 iface lo:2 address $LEAF_IP/24 auto swp1 iface swp1 address $IP/32 auto swp2 iface swp2 address $IP/32 EOF ifup -a # add ospf daemon to quagga sed -i.bak -e s/"ospfd=no"/"ospfd=yes"/g /etc/quagga/daemons sed -i.bak -e s/"zebra=no"/"zebra=yes"/g /etc/quagga/daemons service quagga restart # add quagga config cat << EOF > /etc/quagga/Quagga.conf hostname $HOSTNAME log file /var/log/quagga/ospfd.log log timestamp precision 6 username cumulus nopassword ! service integrated-vtysh-config ! password cn321 enable password cn321 ! interface swp1 ip ospf network point-to-point ! interface swp2 ip ospf network point-to-point ! router ospf ospf router-id $IP network $IP/32 area 0.0.0.0 network $LEAF_IP/24 area 0.0.0.0 ! line vty ! EOF service quagga restart