Candela Technologies Logo
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. The guest instances will be configured to export MAC-VLAN ports to run traffic on their physical management port. The example here uses VirtualBox 5.2.10 and Fedora 27 Server edition, but our current recommendation for virtual machine platforms is actually libvirtd/kvm.
 
  1. Create a new guest instance.
    1. When creating the guest, we should use 2 GB of RAM: screenshot
    2. 60 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->Installation Destination please manually partitioning is necessary. screenshot
      1. Avoid selecting XFS or BTRFS file systems formats.
      2. Create a 1GB partition for /boot, select ext4 filesystem format.
      3. Use the remainder of the drive space for /
      4. If you want to separate the / and /home partions select 35GB for / partition.
    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: dnf update -y
    17. Install perl: dnf install -y perl
    18. Set guest's hostname: hostnamectl --static set-hostname atlas-fedora27s01
    19. Reboot: 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:
    2. cd /root
    3. wget http://www.candelatech.com/lf_kinstall.txt
    4. chmod +x lf_kinstall.pl
    5. You don't need to do a burn in, so turn off the disk check:
    6. touch /home/lanforge/did_cpuburn
    7. Install LANforge: ./lf_kinstall.pl --lfver 5.3.7 --kver 4.13.16+ --do_all_ct
    8. You can disable the VNC Server and Xrdp services on these guests:
      systemctl stop vncserver@\:1 xrdp.service
      systemctl disable vncserver@\:1 xrdp.service
      systemctl daemon-reload screenshot
    9. When installation finishes, reboot: shutdown -r now
    10. 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:ip -br a show screenshot
  4. Add a second VM
    1. Shut down the previous VM: 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]# echo 'atlas-fedora27s02' > /etc/hostname 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:
      2. cd /etc/sysconfig/network-scripts
      3. cat ifcfg-enp0s17
      4. 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:
      cd /etc/udev/rules.d
      ip li show enp0s17
      cat 70-persistent-net.rules
    6. Stop LANforge and change the resource ID for this guest:
      service lanforge stop
      cd /home/lanforge
      ./lfconfig
      resource 5
      config screenshot
    7. Reboot the second guest: 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
Facebook | LinkedIn | Blog