Candela Technologies Logo
 
http://www.candelatech.com
sales@candelatech.com
+1 360 380 1618 [PST, GMT -8]
Network Testing and Emulation Solutions

Adding a LANforge Virtual Machine

Goal: Add a virtual machine running LANforge to a LAN with a physical LANforge manager.

We review the configuration steps necessary to add a virtual LANforge resource. This was done using VirtualBox 5.2.10 and Fedora 27 Server edition. The guest instances will be configured to export MAC-VLAN ports to run traffic on their physical management port.
 
  1. Create a new guest instance.

    1. When creating the guest, we should use 2 GB of RAM: screenshot

    2. 20 GB of disk: screenshot

    3. Omit a floppy drive, use a USB table as pointing device: screenshot

    4. Allocate two or more cores and PAE/NX: screenshot

    5. And the usual virtual processor features: screenshot

    6. We don't need graphics on these nodes, so use minimum graphics memory: screenshot

    7. Enable RDP access, that is useful. It might be a good habit to allocate separate RDP ports per host, we'll use 9134 for the first guest, 9135 for the second screenshot

    8. Enable Host I/O caching for your SATA device. Specify the Fedora 27 Server ISO image as the DVD: screenshot

    9. Disable Audio screenshot

    10. Configure the network adapter to: screenshot

      1. Use the LAN bridged adapter br0

      2. Use a server adapter driver

      3. Enable Promiscuous Mode to allow sniffing

    11. Start the installation screenshot

    12. Under System Automatic partitioning should be adequate for general use. screenshot

      1. If you develop on these image (do lots of updates, install new kernels) reserve 1GB for /boot

    13. Set the root password to lanforge. Click Done twice. screenshot

    14. Add user LANforge: screenshot

      1. Make user lanforge an Administrator

      2. Set password to lanforge

      3. Click Done twice

    15. When installation finishes, reboot. You will see a login prompt: screenshot

    16. Login as root. Do updates:

      [root@localhost]# dnf update -y

    17. Install perl:

      [root@localhost]# dnf install -y perl

    18. Set guest's hostname:

      [root@localhost]# hostnamectl --static set-hostname atlas-fedora27s01

    19. Reboot:

      [root@localhost]# shutdown -r now

  2. Install LANforge on the guest instance. Start by logging in as root: screenshot

    1. Use wget (or curl) to download lf_kinstall.txt:

      [root@atlas-fedora27s01]# cd /root
      [root@atlas-fedora27s01]# curl -o lf_kinstall.pl http://www.candelatech.com/lf_kinstall.txt
      [root@atlas-fedora27s01]# chmod +x lf_kinstall.pl

    2. You don't need to do a burn in, so toggle that off:

      [root@atlas-fedora27s01]# touch /home/lanforge/did_cpuburn

    3. Install LANforge:

      [root@atlas-fedora27s01]# ./lf_kinstall.pl --lfver 5.3.7 --kver 4.13.16+ --do_all_ct

    4. You can disable the VNC Server and Xrdp services on these guests:

      [root@atlas-fedora27s01]# systemctl stop vncserver@\:1 xrdp.service
      [root@atlas-fedora27s01]# systemctl disable vncserver@\:1 xrdp.service
      [root@atlas-fedora27s01]# systemctl daemon-reload
      screenshot

    5. You will notice that we have about 6GB of disk space left in this VM screenshot

    6. When installation finishes, reboot:

      [root@atlas-fedora27s01]# shutdown -r now

    7. On next boot, you will see a LANforge kernel option, it should be automatically selected: screenshot

  3. From your LANforge GUI, configure a MAC-VLAN the on default Ethernet port.

    1. In the LANforge GUI, choose the Port Mgr tab, and highlight the new enp0s17 port: screenshot

    2. Click the Create button

    3. create one MAC-VLAN port screenshot

      1. Select MAC-VLAN

      2. Quantity: 1

      3. Select DHCP-IPv4

      4. Click Apply

    4. You will see the new port in the GUI: screenshot

    5. In the guest VM, you will also see the new port:

      [root@localhost]# ip a show
      screenshot

  4. Add a second VM

    1. Shut down the previous VM:

      [root@atlas-fedora27s01]# shutdown -r now

    2. clone the VM

      1. Select the Reinitialize MAC addresses choice, these machine will operate simultaneously. screenshot

      2. Verify the MAC address of the new guest is set screenshot

      3. Boot the second guest

    3. Change the hostname of the second guest:

      [root@localhost]# hostnamectl --static set-hostname atlas-fedora27s02
      screenshot

    4. Make sure that the MAC address of the second guest is not listed in the ifcfg-enp0s17 file. screenshot

      1. Compare the adapter to the file:

        [root@localhost]# cd /etc/sysconfig/network-scripts
        [root@localhost]# cat ifcfg-enp0s17

      2. If it is listed, change it or remove it.

    5. LANforge changes the /etc/udev/rules.d/70-persistent-net.rules file, edit tht file those as to match the value of your mac address.

      [root@localhost]# cd /etc/udev/rules.d
      [root@localhost]# ip li show enp0s17
      [root@localhost]# cat 70-persistent-net.rules

    6. Stop LANforge and change the resource ID for this guest:

      [root@localhost]# service lanforge stop
      [root@localhost]# cd /home/lanforge
      [root@localhost]# ./lfconfig
      Your command: resource 5
      Your command: config
      screenshot

    7. Reboot the second guest:

      [root@localhost]# shutdown -r now

    8. Start up your first guest (resource 4)

    9. In your LANforge GUI, you should see your two VMs.

    10. Create a MAC-VLAN port for the second guest

  5. Create a VOIP connection between the two guests.

    1. In the VOIP tab, click Create screenshot

    2. You configure: screenshot

      1. Side-A will be resource 3

      2. Side-B will be resource 4

      3. Click Apply

    3. See the newly created connection: screenshot

    4. In the VOIP/RPT tab, click Start

    5. Monitor traffic on the connection with the Modify->View button screenshot


Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Google+ | Facebook | LinkedIn | Blog