FortiGate Cloud
FortiGate Cloud provides cloud-based management for FortiGate devices.
fredery
Staff
Staff
Article Id 224803
Description

This article describes how to deploy a FortiGate-VM in Hyper-V on Windows 10 to test a FortiGate in a simple setup.

 

A few documents and blog exist about FortiGate-VM deployment on Hyper-V.

Scope

FortiGate VM, Windows 10, Hyper-V.

 

Note that using an evaluation license of FortiGate-VM has some limitations:

https://docs.fortinet.com/document/fortigate-private-cloud/7.2.0/kvm-administration-guide/504166/for...

 

It is still possible to use a fully licensed FortiGate-VM if the feature or scaling for being tested for is not available in the evaluation license, or to have a more permanent 'lab setup' in the Hyper-V.

Solution

To enable Hyper-V on the Windows 10 computer, see the Microsoft learn article.

 

Download the FortiGate-VM from the Fortinet support page:

 

Go to Suppor-> Downloads -> VM Images.

Select Product -> FortiGate.

Select Platform -> Hyper-V.

 

Select the version needed.

Download the .zip file with hyperv in the name.

 

fredery_5-1664160127785.png

 

Unzip the downloaded file in the Hyper-V directory.

 

Note the default path used by Hyper-V should be as follows:

 

C:\Users\Public\Documents\Hyper-V\

 

In this scenario, a C:\Hyper-V\ directory has been created. The pros and cons of using the C:\Users\Documents\ tree versus the C:\ drive is beyond the scope of this article. For example, if a directory has been used for which there are no backups because there will be multiple VMs with different Fortinet products and OSes eventually.

 

Open the Hyper-V Manager and edit Virtual Switch:

Go to Action -> Virtual Switch Manager.

 

fredery_3-1664156483821.png

 

There is a Default Switch configured as Internal Network in Hyper-V which gives the VM access to the computer's network using NAT.

A network is created and DHCP is available to procure an IP to the VM.

 

A new virtual network switch with the External network type will be configured to bind one port of the FortiGate-VM with its own dedicated IP on the LAN in the same network as the Windows 10 computer.

Using 'External' in the name of this virtual switch is recommended.

In this scenario, a Wi-Fi adapter has been used with the computer NIC to use in the setup.

 

Go to Name -> External Virtual Switch Wi-Fi, select External networks and then select the appropriate network adapter.

Do not deselect 'Allow management operating system to share the network adapter'.

 

fredery_0-1664158992084.png

 

Configure another virtual switch with the Private network type if needed.

This type is internal only to Hyper-V (no communication can exit computer).

 

Create the FortiGate-VM:

 

Go to Actions -> New -> Virtual Machine.

 

fredery_1-1664159312175.png

 

Select Next.

 

fredery_2-1664159428324.png

 

Under Names, enter 'FGT-VM1' (in this example).

 

Select Next.

 

fredery_3-1664159528805.png

 

Select Generation 1.

 

Select Next.

 

fredery_4-1664159629343.png

 

Under Startup memory, specify 2048 MB (a default value of 1024 MB may be enough for older versions).

 

Select Next.

 

fredery_6-1664160326852.png

 

Under Connection, select External Virtual Switch.

 

Select Next.

 

fredery_7-1664160610250.png

 

Select Use an existing virtual hard disk.

 

Select the fortios.vhd file (where it is unzipped).

 

Select Next.

 

fredery_8-1664160805660.png

 

Select Finish.

 

fredery_9-1664161045723.png

 

Start the FortiGate-VM by navigating to FGT-VM1 -> Start in the Hyper-V Manager.

 

fredery_11-1664161160265.png

 

Connect with the console.

 

fredery_12-1664161325059.png

 

Log in and configure a password.

The default username/password combination is admin/[empty] (submit an empty password when prompted). Input a new password as requested.

 

fredery_14-1664161675555.png

 

This network uses DHCP. The VM received an IP directly on the LAN (external virtual switch):

 

fredery_15-1664161813299.png

 

Test to ensure Google DNS is 'pingable'. This step's results will differ in a setup that does not have direct Internet access.

 

fredery_16-1664161923345.png

 

In a CMD prompt, use ipconfig /all to identify the 2 virtual switches.

 

Note the Default switch uses a network configured automatically.

This network is now attached internally to Hyper-V, so collision may occur if a real network with the same IP is used in the topology.

 

Port2 of the FortiGate-VM has not been yet attached to an internal switch, so only the External Virtual Switch is used.

 

fredery_17-1664162203770.png

 

Next, return to the VM console. Note the output of the command show that exhibits the configuration under config system interface.

The dhcp config is permitted to obtain an IP address, and there are http and https access methods.

 

fredery_20-1664162887270.png

 

Next, try this from the GUI.

 

With newer versions, it will be necessary to provide the  FortiCloud credentials to activate the evaluation license.

 

fredery_19-1664162845990.png

 

There is now a one-armed FortiGate-VM.

This is probably not the topology desired. Stop the VM in Hyper-V Manager.

Edit its settings and add a network adapter through Add Hardware if needed. 

 

Do not forget to configure DHCP under Port2 if the Network Adapter added is using the Default Switch (with the internal type).

The internal type uses NAT to exit the computer.

 

Modify routing in the FortiGate-VM. A default route is configured with the default gateway provided by DHCP on the External Virtual switch (LAN).

 

The topology will look like this with Port2 configured in the default switch:

 

fredery_0-1664166965955.png

 

Note that the IP used by the NAT of the Default Switch and the IP used by the computer are the same.

By using an External Virtual switchit is possible to use DHCP from the Wi-Fi router or configure a static IP from the LAN.

 

Related document:

Fortinet's Private FortiGate Cloud Microsoft Hyper-V administration guide.