Open main menu

CDOT Wiki β

Virtual-Lan

Revision as of 16:08, 12 January 2011 by Cheping (talk | contribs) (Virtual Network Configuration)

Setup a Virtual Local Area Network environment for OPS535 Labs

OS Installation

  • Install 64-bit version of CentOS 5.5 with Virtualization Packages
  • Create Four Virtual Machines, each with 8GB of disk space, 1G Memory, 1CPU
  • Install CentOS5.5 on VM1 to VM3 with at least the following packages:
    • NFS
    • NIS
    • DNS
    • DHCP
    • Postfix, sendmail
    • OpenLDAP
  • CentOS 5.5 configuration:
    • Enable iptables
    • Create a regular user account
    • Enable SELinux
  • Collect the following information:
    • IP address(es) assigned to the host OS and each VM for the virtual network
    • Name of the network device used by the host OS to connect to the virtual network
    • IP address, netmask, and gateway for each guest OS
    • Name of the device used by each guest OS to connect to the virtual network
  • Install Fedora 14 on VM4 with the following packages:
    • NFS
    • NIS
    • DNS
    • OpenLDAP
    • Wireshark
    • tcpdump

Virtual Network Configuration

  • Default Virtual Network
    • Network Address 192.168.122.0/24
    • Network Type: NAT
  • Create the 2nd Virtual Network, named "opsnet"
    • Network Address 192.168.[x].0/24 where [x] assigned by your professor
    • Network Type: Isolated
  • Locate the name of the physical network device connected to the lab network. The following configuration assume eth3 as the device name name.
    • assignment 172.16.[x].1 to the alias of eth3: ifconfig eth3:0 172.16.[x].1
  • Adding routes to each student's "opsnet" virtual network manually or by running the following bash script on the host OS:
#!/bin/bash
route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1
route add -net 192.168.2.0 netmask 255.255.255.0 gw 172.16.2.1
route add -net 192.168.3.0 netmask 255.255.255.0 gw 172.16.3.1
route add -net 192.168.4.0 netmask 255.255.255.0 gw 172.16.4.1
...
route add -net 192.168.36.0 netmask 255.255.255.0 gw 172.16.36.1

or:

#!/bin/bash
x=1
while [ $x -le 36 ]
do
  route add -net 192.168.${x}.0 netmask 255.255.255.0 gw 172.16.${x}.1
  x=$(expr $x + 1)
done
  • To test your static routes, pair up with a few fellow students and try to ping their VMs in their "opsnet".
  • Save your network settings for the real lab.

Private Network Address Allocation