Vaibhav Singh

Blog - vaibhavsingh.com

Eve-ng lab on Google Cloud (GCP)

I need to prepare for a big datacenter build project that’s coming up based on newer networking technologies. As I don’t have access to my home lab presently due to COVID-19 lock-down so I’ve decided to build one on GCP.

I posted a related post few years ago – read [here].

Cost

Looking at cloud console, it seems it’s cheapest to spin an instance on Oregon us-west1. That’s about $0.034 hourly. I’m starting with smallest 1vCPU, 4G RAM type. A quick google shows that the instance type can be changed later.

I’d be exploring Google Cloud Scheduler to ensure this instance doesn’t run beyond a few hours. Just in case I forget to, or somehow can’t manually turn it off.

Steps

Create a new project

Go to create a new compute instance screen

Launch the cloud shell from upper right

Execute the following command in cloud shell – it will create a custom image suitable to run EVE-NG (with nested virtualization enabled)

gcloud compute images create eve-ng-lab-image --source-image-family=ubuntu-1604-lts --source-image-project=ubuntu-os-cloud --licenses https://www.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx

Head over to the GUI console

Change you boot disk to your custom image “eve-ng-lab-image”. Choose at least 20G disk size as the base-install would be approx 10G.

Choose CPU as Skylake or later

Let the IP addresses be ephemeral for now, we’ll change its public IP to static later if its not chargeable, otherwise we’d use dynamic dns service to always resolve our dynamic external IP to a recognizable domain name.

I changed the Network Services Tier selection from “Premium” to “Standard” as this is a learning lab. Don’t know how much of a difference it’d make to the running costs. [more]

Allow http/https in firewall settings

Launch SSH for your VM from the browser window and run the following commands to install EVE-NG and its dependencies.

sudo -i

#create a local user for later SSH use
useradd <some-username>
passwd <some-username>

wget -O - https://www.eve-ng.net/repo/install-eve.sh | bash -i

apt update
apt upgrade

Confirm and proceed to reboot the VM. You’ll be presented with a wizard to set root password. Enter password of your choice. You won’t see the *** while typing. For hostname I entered “eve-ng” and for domain I chose “example.com”. Select “DHCP” as network type. Chose default options for other screens. At one point you will lose your SSH session as the server starts regenerating SSH keys. Reconnect after few seconds.

I was curious to see the processor, disk and memory usage for a base install.

free -h
df -h

top
#press shift+E to change top output to MB mode
#press W to save settings 
Disk and Memory usage

Top output

Resource utilization from GUI

Connect to http:// of your VM instance. You’ll be presented with EVE-NG Web login screen. Credentials are admin/eve

Change password for admin user to something complex

Upload virtual images

Open sftp to your VM’s public IP address and login using the <some-username> credentials created earlier. Upload images to /tmp and later move it to required directory from your SSH console.

I could’ve allowed direct root login to SSH, if I wanted, but I chose not to. I’d better login via non-root user and su - myself.

Follow procedure for each vendor/device type from official EVE-NG website

Sample topology

A small topology just to test the installation as well to observe impact on hardware resources.

Sample topology with Arista vEOS
Sample topology resource utilization

As evident, to run more nodes such as Arista vEOS, we’d need approx 2G RAM per node. Since my goal is to make a CLOS topology – I’d need about 10G-12G RAM. I’d explore which instance type suits this criteria.

Conclusion

Running a lab in the cloud could be quite useful in situations where you can’ make use of your physical lab machine. I will use this VM for a lab session and publish notes of my practical experiences.

Moreover, I’d record the running costs (or projections) after a few days of using this setup.

Next post in this series – changing-gcp-instance-type

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top