diff --git a/create-arista-veos-image/create-arista-veos-image.sh b/create-arista-veos-image/create-arista-veos-image.sh index 6e6d6a6..5dbd7ba 100644 --- a/create-arista-veos-image/create-arista-veos-image.sh +++ b/create-arista-veos-image/create-arista-veos-image.sh @@ -1,10 +1,11 @@ #!/bin/bash -# create-arista-veos-image.sh V1.11 +# create-arista-veos-image.sh V1.12 # HS-Fulda - sebastian.rieger@informatik.hs-fulda.de # # changelog: -# V1.1 added injection of config defined in VM Maestro using config-drivex +# V1.1 added injection of config defined in VM Maestro using config-drivex # V1.11 fixed device mapping of extracted partitions, fixed problems with stale swi directory +# V1.12 rc.eos now supports e1000 and virtio as vnic types (virtio is supported in vEOS >=4.14.5F) # usage if [ ! $# -eq 3 ] ; then @@ -68,9 +69,15 @@ mount /dev/sdb1 /config-drive echo "Getting ip address for ma1 via dhcp..." echo "==========================================" -dhclient -r ma1 -dhclient -1 -v ma1 >/mnt/flash/dhclient.log -IP=\$(ip addr show ma1 | grep inet | tr -s ' ' | cut -d ' ' -f 3 | sed s/"\/"/"\\\\\\\\\/"/g) +MANAGEMENT_INTERFACE="ma1" +ip link show \$MANAGEMENT_INTERFACE +if [ \$? -ne 0 ]; then + # if using virtio ma1 will not be up during Eos Init 1, hence we use eth0 + MANAGEMENT_INTERFACE="eth0" +fi +dhclient -r \$MANAGEMENT_INTERFACE +dhclient -1 -v \$MANAGEMENT_INTERFACE >/mnt/flash/dhclient.log +IP=\$(ip addr show \$MANAGEMENT_INTERFACE | grep inet | tr -s ' ' | cut -d ' ' -f 3 | sed s/"\/"/"\\\\\\\\\/"/g) echo \$IP sed s/"! ip of ma1 configured on launch"/"ip address \$IP"/g /config-drive/veos_config.txt >/mnt/flash/startup-config.tmp cat /mnt/flash/startup-config.tmp