Wanos on QEMU/KVM and virt-manager Comprehensive guide for...

36
Wanos on QEMU/KVM and virt-manager Comprehensive guide for a complete lab This document guides the user in setting up a Wanos appliance using KVM/QEMU and Virtual Machine Manager (virt-manager) on a CentOS 6.x (64-bit) GNU/Linux operating system. Four Virtual Machines will be created in this guide. It is assumed that the current version of CentOS 6 64-bit (with GUI) has all the necessary updates installed. Two Microsoft Windows OS based virtual machines such as Windows 7 are also needed. Wanos version 2.6.2. is used in this guide. The system requirements for Wanos as well as the download image can be obtained at http://wanos.co/wan-optimization/download/ . The Raw Disk Image is used in this tutoral.

Transcript of Wanos on QEMU/KVM and virt-manager Comprehensive guide for...

Page 1: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Wanos on QEMU/KVM and virt-manager

Comprehensive guide for a complete lab

This document guides the user in setting up a Wanos appliance using KVM/QEMUand Virtual Machine Manager (virt-manager) on a CentOS 6.x (64-bit) GNU/Linuxoperating system. Four Virtual Machines will be created in this guide. It isassumed that the current version of CentOS 6 64-bit (with GUI) has all thenecessary updates installed. Two Microsoft Windows OS based virtual machinessuch as Windows 7 are also needed. Wanos version 2.6.2. is used in this guide.

The system requirements for Wanos as well as the download image can beobtained at http://wanos.co/wan-optimization/download/. The Raw Disk Image isused in this tutoral.

Page 2: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Table of Contents

• Setting up QEMU/KVM and Virtual Machine Manager

• Disabling Network Manager

• Configure Network Interface

• Configure Virtual Networks

• Adding Virtual Networks

• Set up and Configure Wanos Appliance

• Creating a Wanos Virtual Machine

• Configuring Wanos Appliance to work on your network

• Set up and Configure Client -PC Virtual Machine

• Creating a Windows Virtual Machine

• Configure Wanos web-based GUI for testing simulation

Page 3: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Setting up QEMU/KVM and Virtual Machine Manager

This section will focus on the installation of QEMU/KVM Hypervisor and VirtualMachine Manager using the CLI (Commad Line Interface). Internet connectivity isrequired.

Open the Terminal and switch to root user by typing su followed by the rootpassword.

After logging in as root, run the following command:

yum install libvirt qemu-kvm.x86_64 virt-manager

Review and confirm all prompts during the installation phase. After installation,start libvirt service by running this command as root.

service libvirtd start

Launch Virtual Machine Manager under Applications > System Tools > VirtualMachine Manager

Page 4: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Disabling Network Manager

NetworkManager is a GUI based tool available to assist users manage basicaspects of computer networking. However, setting up bridge or advancednetworking on a Virtual Machine Manager does not work well withNetworkManager and Wanos so this feature needs to be disabled.

Open the Terminal, log in as root by typing su followed by the root password.

Type the following commands:

chkconfig NetworkManager off

chkconfig network on

Reboot the machine and launch Virtual Machine Manager from Applications >System Tools > Virtual Machine Manager

Page 5: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Configure Network Interface

On the Virtual Machine Manager menu, click Edit > Connection Details.

Go to Network Interfaces tab.

Select LAN interface (eth0), click the Stop Interface button (select Yes to

confirm) then click the Delete Interface button to remove eth0.

Page 6: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Click the Add Interface button , select Bridge and click the Forward button.

Set the following parameters:

Name: br0

Start Mode: OnBoot

Activate Now: Ticked / Mark Checked

IP Settings: IPv4, DHCP

Bridge Settings: STP of, delay 0 sec

Click the Finish button to complete the process. Select Yes when a dialogb boxpops up stating that using the new settings will overwrite your existingconfiguration on the selected interface.

(Screen shots on the succeeding pages)

Page 7: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive
Page 8: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive
Page 9: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Configure Virtual Networks

From Network Interfaces tab, switch to Virtual Networks tab. Click the Stop

Interface button to stop the default virtual network. Untick / Uncheck theAutostart option to set the option to Never.

Page 10: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Adding Virtual Networks

Click the Add Network button to add a new entry. Click the Forward button and set the Network Name to WAN_Link.

Click the Forward button to continue.

Page 11: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Set or Leave the Network value to/as 192.168.100.0/24 and click the Forward button.

Page 12: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Untick / Uncheck Enable DHCP and click the Forward button.

Page 13: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Select Forwarding to physical network

Destination: Physical device eth0

Mode: Routed

Click the Forward button to continue. Review the settings and click the Finish button to complete the process.

Page 14: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Add a new network by repeating the same process outlined in Adding VirtualNetworks with the following information:

Network Name: Branch_LAN

Network: 192.168.200.0/24

Enable DHCP: Untick / Uncheck

Connecting to physical network:

Forwarding to physical network

Destination: Physical device eth0

Mode: Routed

Once done, two new entries should appear under Virtual Networks.

Page 15: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Set up and Configure Wanos Appliance

After downloading Wanos Raw Disk Image from the website, the file is stored inzip format. Use the built in extraction tool provided in CentOS or use the p7ziptool to extract the .img file to your preferred directory.

Launch Virtual Machine Manager from Applications > System Tools > Virtual Machine Manager

Creating a Wanos Virtual Machine

Click the Create a new virtual machine button . Set the Name toWanos-HQ, select Import existing disk image and click the Forward button.

Page 16: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Select Linux as the OS type and Generic 2.6.25 or later kernel with virtio asthe Version. Click the Forward button.

Click the Browse button under Provide the existing storage path.

Note that the zip file was extracted and duplicated prior to this step. The fileswere renamed to wanos-hq.img and wanos-branch.img .

Page 17: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Click the Browse Local button.

Page 18: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Navigate to the directory where wanos-hq.img is stored.

Click the Open button, select Choose Volume and click the Forward button to continue.

Page 19: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Leave or set the value of Memory (RAM) as 1024 MB and CPUs to 1.

Click the Forward button to continue.

Page 20: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Tick / Check on Customize configuration before install. Expand Advancedoptions select WAN_Link from the drop down list. Make sure Virt Type is KVMand Architecture is x86_64. Click the Finish button to create the VM.

Page 21: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Click the Add Hardware button to add the second NIC.

Page 22: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Set the Host device to Bridge br0 from the drop down menu and click theFinish button.

Click the Begin Installation button to start the virtual machine.

Page 23: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

The same step can be used as outlined in Creating a Wanos Virtual Machine tocreate Wanos-Branch Virtual Machine with the following information:

Name: Wanos-Branch

Import existing image > Browse and locate wanos-branch.img

OS Type: Linux

Version: Generic 2.6.25 or later kernel with virtio

Memory (RAM): 1024

CPUs: 1

Tick / Check Customize configuration before install

Advanced Options > WAN_Link (drop down menu)

Virt Type: kvm

Architecture: x86_64

Add Hardware > Network > Host device: Branch_LAN

Page 24: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Configuring Wanos Appliance to work on your network

By default, the Wanos Virtual Machine is configured as follows:

IP: 192.168.1.200

Address Mask: 24

Gateway Address: 192.168.1.1

Wanos-HQ does not need to be configured if the physical network is configured as192.168.1.0/24 network with the gateway being 192.168.1.1. If the network isdifferent then follow the same steps outlined below and use 192.168.1.200 forthe IP field.

This section guides the user in configuring Wanos-Branch Virtual Machine.

Ensure that both Wanos-HQ and Wanos-Branch are running. If not, select thetarget Appliance on your Virtual Machine Manager and click the Power on

virtual machine button then click the Show the virtual machine

console and details button .

Page 25: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

The Virtual machine will go through the boot up process. Once the user isprompted with the information:

############################

Press Enter to Login

############################

Press the Enter key and use the following information to log-in.

Username: tc

Password: ChangeM3 (the password is C@$e $enSiT!ve)

Once logged in, type wanos-cfg to run the configuration utility and set thefollowing information:

IP: 192.168.1.201

Address Mask: 24

Gateway Address: 192.168.1.1

A prompt will ask you if you want to save the new settings. Type y to confirm.

Page 26: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Set up and Configure Client-PC Virtual Machine

In this section, the user will set up a Windows-based virtual machine. Two virtualmachines are needed to act as a workstation PC; one is for the WAN_Link whilethe second virtual machine will work for the Branch_LAN network. A 32-bitWindows 7 .img file has been created for this lab but feel free to use whateverversion of Windows is available to you.

Creating a Windows Virtual Machine

Click the Create a new virtual machine button . Use HQ-PC as the Nameof the virtual machine, select Import existing disk image and click theForward button.

Page 27: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Select Windows as the OS type and Microsoft Windows 7 or later as theVersion. Click the Browse button under Provide the existing storage path.

Page 28: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Click the Browse Local button.

Page 29: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Navigate to the directory where hq-pc.img is stored.

Click the Open button, select Choose Volume and click the Forward button to continue.

Page 30: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Leave the value of Memory (RAM) as 1024 MB and CPUs as 1.

Click the Forward button to continue.

Page 31: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Tick / Check on Customize configuration before install. Expand Advancedoptions and select Bridge br0 from the drop down list. Make sure Virt Type iskvm and Architecture is i686.

Page 32: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Select NIC and set the Device model to rtl8139. Click the Apply button to savethe changes and click Begin Installation to start the virtual machine.

Click the Begin Installation button to start the virtual machine.

Page 33: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

The same step can be used, as outlined in Creating a Windows Virtual Machine, tocreate Wanos-Branch Virtual Machine with the following information:

Name: Branch-PC

Import existing image > Browse and locate branch-pc.img

OS Type: Windows

Version: Microsoft Windows 7 or later

Memory (RAM): 1024

CPUs: 1

Tick / Check Customize configuration before install

Advanced Options > Branch_LAN (drop down menu)

Virt Type: kvm

Architecture: i686

NIC > Device model: rtl8139

Page 34: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Configure Wanos web-based GUI for testing simulation

Open Internet Explorer on your HQ-PC virtual machine. Type 192.168.1.200on the address bar and enter the following log in credential:

User name: wanos

Password: wanos

Internet Explorer will prompt a problem with the website's security certificate.Click Continue to this website (not recommended) and enter the same username and password listed above.

The user will be redirected to the Wanos Dashboard. Go to Configure >System Settings.

Page 35: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Under Optimization Settings, set the following parameters:

Encapsulation: UDP

Peer Timeout: 600

Global WAN Tx Rate: 1024

Click the Submit button to commit the changes. Wanos will apply the newconfiguration and restart.

Page 36: Wanos on QEMU/KVM and virt-manager Comprehensive guide for ...wanos.co/docs/wp-content/uploads/2016/09/Wanos-Lab-on-KVM-Virt... · Wanos on QEMU/KVM and virt-manager Comprehensive

Apply the same settings to Wanos-Branch Virtual Machine. Use the following IPaddress after launching Internet Explorer on Branch-PC:

192.168.1.201

and follow the instructions outlined in Configure Wanos web-based GUI for testingsimulation.