0% found this document useful (0 votes)
52 views3 pages

02 Virtual Network Setup

This document discusses setting up a virtual network using VMware Player by installing VMware Player, creating three CentOS virtual machines (VMs), and configuring them to connect to each other across four virtual networks (vmnet0-vmnet3). Key steps include cloning VMs to quickly create additional VMs, editing scripts to configure the virtual networks, assigning network interfaces in each VM to connect to the different virtual networks, and verifying connectivity across the VMs and host. The goal is to replicate the network diagram shown with IP addresses assigned to each virtual network.

Uploaded by

Kishor Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views3 pages

02 Virtual Network Setup

This document discusses setting up a virtual network using VMware Player by installing VMware Player, creating three CentOS virtual machines (VMs), and configuring them to connect to each other across four virtual networks (vmnet0-vmnet3). Key steps include cloning VMs to quickly create additional VMs, editing scripts to configure the virtual networks, assigning network interfaces in each VM to connect to the different virtual networks, and verifying connectivity across the VMs and host. The goal is to replicate the network diagram shown with IP addresses assigned to each virtual network.

Uploaded by

Kishor Jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

The Virtual Network

Introduction
Virtual Machines have been with us for quite a few years now. There are lots of different
ways to create a virtual network out there, in this labsheet we will explore VMware Player.
VMware is one of the oldest (if not the oldest) Virtualization pieces of software around, their
latest incarnation is the VMware Player which is free and simple enough to introduce you to
the concept of Virtualization without the complexities that come with other software packages
like ESX Server or KVM. In this labsheet we will build a small virtual network and see how we
can connect VMs to each other.

Installation (ONLY for method 2 @home with Dual Boot)


VMware Player is already installed if you are using work methods 1 or 3 (working
@home in a VM or working@home remotely). You will only need to install it if you are using
method 2 and have dual booted your home computer. In that case go to this link:

https://my.vmware.com/en/web/vmware/downloads/details?downloadGroup=PLAYER-
1600&productId=1039&rPId=51984

and download VMware Workstation 16.0.0 Player for Linux 64-bit.


Once you have that in your Downloads folder, open a terminal, navigate to Downloads, change
the permissions of the file to make it executable using chmod 777 VMware-Player-16.0.0-
16894299.x86_64.bundle and then simply run the file using ./VMware-Player-16.0.0-
16894299.x86_64.bundle. This will install the software on your Linux machine.

Building a VM
You now need to build your CentOS client in the Virtual machine. To do this you will
need to create it first (the equivalent of putting the hardware together) and you will now need
to have the CentOS iso file so download it here:

http://isoredirect.centos.org/centos/7/isos/x86_64/

Invoke VMware Player simply by typing vmplayer in a terminal.

Click on Create a new virtual machine. Use ISO image, click Browse and find your CentOS
iso. It should say “CentOS 7 64-bit detected”. Click Next and leave the OS to Linux and click
Next. Give the VM a name of vPrometheus0 and click Next. Set the HDD size to 10Gbytes
and in the next page select customize hardware. Set the RAM to 1GB (set it to 2GB if you
have more than 16GB on your system in total or if you are working remotely in the lab), set the
network adapter to NAT and click close and Finish. Close the next message and Select
Download and Install the VMware Tools Software Update it proposes. The VM should now
Boot into the Installation.

Choose Install CentOS 7. If you need to escape the cursor from inside the VM press alt-ctrl.
Choose Language English (United Kingdom) and continue. In Software selection choose
GNOME Desktop and click Done. In Network and Hostname set the Hostname to
vPrometheus0.netlab.ee.port.ac.uk and click Done. You are now ready to Begin
Installation.

While the installation is progressing set the Root Password to localhost1 and create a user
called DoNotUseMe. It will restart once and you must accept the License Agreement and let
it reboot again and you are done!

Virtual Machine Cloning

To build the rest of the network, according to our network diagram, we need 2 more of
those VMs. However you do not have to go through the hassle of repeating this whole
procedure, you can just clone the existing VM, rename it and use it! Shut down the VM, go into
/root/vmware and find the folder with the name of the VM. right click on it and copy and then
right click in the empty space and paste. This should now create a VM (copy). Rename this
folder into vPrometheus1. Now go to a terminal and type vmplayer again to start another
instance of the software. Go File - Open a Virtual Machine, select your new VM choose the
.vmx file and click open. Edit the VM settings and rename it (it's in the options tab). Now Play
the VM. Select "I copied it", ignore the VMTools update message and let it boot. Log in,
rename it with the hostname command, reboot again and you are done! Repeat the Cloning
process again for vPrometheus2. You now have 2 more VMs but when you go into their
terminals they are still called vPrometheus0! How can you change that? Research “how to
rename a Redhat computer” and do it.

The Virtual Network


You now need to make a few slightly radical changes to your networking infrastructure
to get the network diagram we want. VMware automatically creates vmnet1 for host only
connections and gives it a private IP address. We want to be using public IP addresses through
because we want to configure some routing later on. So we need to firstly create our own
vmnets and then we need to convince VMware player to use them!

On Moodle you will find a little script called vm_subnet. Download it and save it in your
root folder. Edit it with gedit or any other editor that suits you. We want it to start and configure
vmnet0 and vmnet1 and we want it to start just as processes, vmnet2 and vmnet3. Change
the networking information in the script to match your network diagram and save it. You then
need to sort out the permissions for it so chmod 777 vm_subnet in a terminal. Now you will
need to shut down vmnet1 as was started by the software and its corresponding dhcp server.
ps -ef | grep vmnet will give you a listing of all vmnet related processes so you can now kill
the 2 processes associated with vmnet1. Now run the script with ./vm_subnet. Type ifconfig
now. What has changed? Type ps –ef | grep vmnet now. What do you see?

We now need to setup the Virtual network cards. To do this you need to have the option
in your VMs to use more than one Host-Only network cards. In order to do this we have a
custom made script called fix-vmnet-dev. Download it, save it into each of the VM folders, run
it for each folder (on Prometheus NOT inside the VMs) and then go to the virtual machine
settings of each of your VMs. What do you see there? Configure v0 for one network card
connected to vmnet0, configure v1 for 2 network cards connected to vmnet1 and vmnet2 and
finally configure v2 for one network card connected to vmnet2. Now boot the VMs you've
already built and make the appropriate changes to their networking settings in there.
Remember vPrometheus1 should have 2 network cards!

After you've set everything up you should be able to ping neighbouring interfaces so
from VM0 to the host, from VM1 to the host and from VM1 to VM2.

Vmnet0
148.197.30.250

fkjhflkhf

vPrometheus0

Vmnet0
148.197.30.249

fkjhflkhf
Vmnet1 Vmnet1 Vmnet2 Vmnet2
148.197.31.249 148.197.31.250 148.197.32.249 148.197.32.250

fkjhflkhf fkjhflkhf fkjhflkhf fkjhflkhf

Prometheus
vPrometheus1 vPrometheus2

You might also like