EVE-NG Deploying Fortigate v6 Firewalls

KB ID 0001714

Problem

The firm I work for are looking at a replacement for Cisco ASA as their preferred firewall of choice. We are looking at Fortinet to fill this gap, but as a product/solution it’s something I know very little about.

So the best way to learn is to deploy and play with, and the test bench weapon of choice for discerning technical types is EVE-NG. So can I deploy the newest (v6.4.2 at time of writing) Fortigate firewall into EVE-NG? Indeed, read on.

Solution

Getting the VM is pretty easy, Fortinet allows you to create a free login account, and download the trial version. REMEMBER you want the KVM version of the appliance!

If you didn’t know EVE-NG (and the Qemu software that runs inside it) needs to have its images in certain named folders. So log into your EVE-NG  appliance and create a new folder;

[box]

mkdir /opt/unetlab/addons/qemu/fortinet-FGT-v6.4.2

[/box]

Note: fortinet-xxxxxxxxxx is the correct naming convention 🙂

Now copy your downloaded image into this folder, I use WinSCP, but FileZilla is also free. Remember that your transfer method should be set to ‘binary’.

Back in the EVE-NG console, you need to unzip the appliance, then rename it (EVE-NG also needs the images to have certain names). Then you can delete the original Zip file, and make sure the permissions are set correctly.

[box]

cd /opt/unetlab/addons/qemu/fortinet-FGT-v6.4.2
unzip FGT_VM64_KVM-v6-build1778-FORTINET.out.kvm.zip
mv fortios.qcow2 virtioa.qcow2
rm FGT_VM64_KVM-v6-build1778-FORTINET.out.kvm.zip
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions

[/box]

That’s the hard part done. Log into EVE-NG create a new lab and drop a Fortigate device into the workspace. (Note: You can raise the RAM to 2048 to get it to perform a little better, but no higher though, as only 2GB is permitted with the trial licence).

Allow Web Management Of Fortigate VM

I’ve included this bit because most articles don’t, and if I’m unfamiliar with Fortigate, then some of you will be also. Essentially you setup the interface that you will be using as the inside interface with a static IP and allow web management via HTTP. (Note: First you will be asked to change the Admin password).

[box]

config system interface
edit port1
set mode static
set ip 192.168.1.1 255.255.255.0
set allowaccess http 
end

[/box]

Then from a management VM, (on the same network segment) connect to the appliance and log in.

If you just see a blank screen with no logon options see this article.

Related Articles, References, Credits, or External Links

NA

Fortigate Blank Web Page?

KB ID 0001713

Problem

I’ve been trying to deploy a Fortigate into EVE-NG (article to follow) this week. I could get the appliance running fine but when I tried to access the web management console all I got was the following.

Note: I have a couple of management VMs in EVE-G (Windows 7 and Server 2012), they had a mixture of IE, Chrome and Firefox on them but still I could not get in?

Solution

All forums yielded no more info other than ‘Check you have allowed access for http“. But as you can see (above) for Fortinet Logo is on the windows I was hitting the firewall and http was allowed? (Also the http daemon was running inside the appliance.

Just for fun I connected the outside interface to my test network, allowed http, and tried from there, it worked perfectly? So I deployed another Fortigate and connected the ‘inside’ interface to my test network, again it worked fine? At this point it was becoming obvious that my management machines browsers were probably the problem. Is I deployed a new Kali Linux VM fired up Firefox and;

That took a LOT longer than it needed to!

Related Articles, References, Credits, or External Links

NA

 

EVE-NG: Committing / Saving Qemu Virtual Machine Settings

KB ID 0001695

Problem

I’ve been working on a load balancing lab in EVE-NG this last week or so. I created some web servers (in TinyCore Linux,) to act as the web servers in that lab. (Essentially they serve a different colour web page so I can test the load balancing is working OK).

Now I wanted to save the changes I made so that I could redeploy the configured servers to multiple labs. But when you deploy a qemu VM as a node in a lab, EVE-NG copies the VM to the lab, and the changes you make, only apply to the node, in the lab, in the pod, you are working on!

So I wanted to update the ‘Master‘ image in EVE-NG, with the one I configured. Here is how to do that;

Solution

Firstly you need to get your POD NUMBER, you can get that from the user management screen, below you can see my user, (you can see already logged on), is using pod number 1.

Now you need to get the LAB ID NUMBER. Open the lab > Shut down the machine that you want to save the changes from > Lab Details > Copy the lab ID number.

Lastly you need the NODE ID NUMBER. Either  select Nodes and take note of the number, or right click the node and the node ID is shown (in brackets).

Armed with those three pieces of information, SSH into the EVE-NG host, and execute the following commands;

[box]

cd /opt/unetlab/tmp/POD-NUMBER/LAB-ID/NODE-ID/

for example;

cd /opt/unetlab/tmp/1/2277307f-b0bc-45a4-831f-a89a716b5841/3/

[/box]

Now depending on the VM/Appliance in question, it may be called hda.qcow2, or virtioa.qcow2 (a quick ls command will tell you!) Take the name and commit the changes with the following command;

[box]

/opt/qemu/bin/qemu-img commit hda.qcow2

[/box]

Job done!

Yes but you wanted three different servers? Correct, I then copied the server (twice) edited the IP address, and the web page served on the two copies and committed the changes back to the original VMs!

Related Articles, References, Credits, or External Links

NA

VMware vSphere – How to Import and Export OVF and OVA Files

KB ID 0000562

Problem

I prefer to think of OVF Templates as “Zip” files for Virtual Machines and Virtual Appliances. Where as the OVA file is the complete appliance pre packaged. There are two things you will want to do with an OVF Template;

1. Export a VM to an OVF Template

2. Import an OVF Template (Note: VMware call this “Deploy an OVF Template”)

Note: There are tools for OVF templates for other VMware virtualisation products, this is just for vSphere / ESX.

Tech Note: I find it a lot simpler to do this from PowerCLI now, see the article below;

VMware: Export a VM to OVA With PowerCLI

Solution

Export a Virtual Machine to OVF (vSphere v6)

Note: Machine must be Powered Off and have No Snapshots!

Select the VM > Templates > Export OVF Template.

Change the name, annotation as required > OK.

Your files will be downloaded, (the location will depend on your browser settings!)

 

Export a Virtual Machine to OVF (vSphere v3, v4 and v5)

Note: Machine must be Powered Off and have No Snapshots!

1. Connect to your host with the VI client > With your virtual machine powered off > Select it > File > Export > Export to OVF Template.

2. Select a location to save the files to > OK.

3. Depending on the size of the VM this can take a while.

4. It will give you the following message when it’s finished.

5. Here are the files that it has created.

Import / Deploy an OVF Template to a Virtual Machine

HTML5 Web Client: You can select Deploy OVF Template from either the Cluster or Host Level.

Flash Web Client: If importing OVA or OVF files into vSphere via the vSphere Web client, you can import them at the vCenter, Host, or Cluster Level.

 

From this point forward: The procedure is the same for both Flash and HTML5 clients, Ill show the process using the HTML5 client.

Choose Files > Navigate to and select ALL the applicable files > Next.

  

Give the new VM a name, and, (if applicable) select a folder to put it into > Next > Select a host to deploy to > Next.

Review details > Next > Choose the storage, (and optionally disk format) > Next.

Select the Port Group you want to connect the new VM to > Next > Again review the details > Finish.

 

Import / Deploy an OVF Template to a Virtual Machine (vSphere v3, v4 and v5)

1. To create a VM from an OVF template, connect to your host with the VI client > File > Deploy OVF Template.

2. Browse to the location that the .ovf file is stored > Next.

3. Read the details > Next.

4. Give the new VM a name > Next.

5. Select the disk format (Thick or Thin) you want the new VM to use.

What does Lazy Zeroed and Eager Zeroed Mean?

Data on disks is stored as a 1 (one) or a 0 (zero), so if all the blocks on the disk are set to zero, when you put data on the disk, it only has half the work to do (i.e. write the ones). Eager Zeroed, puts zeros on all the blocks on the disks straight away, Lazy Zeroed puts all zeroes in a block the first time the block is read.

6. Read the summary, and if you want to power on the VM on completion, tick the box > Finish.

7. Depending upon the amount of data this can take a while.

8. It will give you the following message when it’s finished.

9. And here is your VM, imported, powered up, and working.

Related Articles, References, Credits, or External Links

Original Article Written 26/01/12

Exchange – Failed to mount database(hr=0x80040115, ec=-2147221227)

KB ID 0000664 

Problem

The Exchange server on my test network stopped working, the mailbox database was not mounted. When I attempted to mount it:

[box]
--------------------------------------------------------
Microsoft Exchange Error
--------------------------------------------------------
Failed to mount database '{Database Name}'.
{Database Name}
Failed
Error:
Couldn't mount the database that you specified. Specified database: {Database Name}; 
Error code: An Active Manager operation failed with a transient error. Please retry 
the operation. Error: Database action failed with transient error. Error: A 
transient error occurred during a database operation. Error: MapiExceptionNetworkError: 
Unable to make admin interface connection to server. (hr=0x80040115, ec=-2147221227)
Diagnostic context:
......
Lid: 12696 dwParam: 0x6D9 Msg: EEInfo: Generation Time: 2012-08-28 13:55:49:266
Lid: 10648 dwParam: 0x6D9 Msg: EEInfo: Generating component: 2
Lid: 14744 dwParam: 0x6D9 Msg: EEInfo: Status: 1753
Lid: 9624 dwParam: 0x6D9 Msg: EEInfo: Detection location: 501
Lid: 13720 dwParam: 0x6D9 Msg: EEInfo: Flags: 0
Lid: 11672 dwParam: 0x6D9 Msg: EEInfo: NumberOfParameters: 4
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[0]: Unicode string: ncalrpc
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[1]: Unicode string:
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[2]: Long val: -1988875570
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[3]: Long val: 382312662
Lid: 24060 StoreEc: 0x80040115
Lid: 23746
Lid: 31938 StoreEc: 0x80040115
Lid: 19650
Lid: 27842 StoreEc: 0x80040115
Lid: 20866
Lid: 29058 StoreEc: 0x80040115 [Database: {Database Name}, Server: 
PNL-EX.petenetlive.net].
An Active Manager operation failed with a transient error. Please retry the operation. 
Error: Database action failed with transient error. Error: A transient error occurred 
during a database operation. Error: MapiExceptionNetworkError: Unable to make admin 
interface connection to server. (hr=0x80040115, ec=-2147221227)
Diagnostic context:
......
Lid: 12696 dwParam: 0x6D9 Msg: EEInfo: Generation Time: 2012-08-28 13:55:49:266
Lid: 10648 dwParam: 0x6D9 Msg: EEInfo: Generating component: 2
Lid: 14744 dwParam: 0x6D9 Msg: EEInfo: Status: 1753
Lid: 9624 dwParam: 0x6D9 Msg: EEInfo: Detection location: 501
Lid: 13720 dwParam: 0x6D9 Msg: EEInfo: Flags: 0
Lid: 11672 dwParam: 0x6D9 Msg: EEInfo: NumberOfParameters: 4
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[0]: Unicode string: ncalrpc
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[1]: Unicode string:
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[2]: Long val: -1988875570
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[3]: Long val: 382312662
Lid: 24060 StoreEc: 0x80040115
Lid: 23746
Lid: 31938 StoreEc: 0x80040115
Lid: 19650
Lid: 27842 StoreEc: 0x80040115
Lid: 20866
Lid: 29058 StoreEc: 0x80040115 [Database: {Database Name}, 
Server: PNL-EX.petenetlive.net]
An Active Manager operation failed with a transient error. Please retry the operation. 
Error: MapiExceptionNetworkError: Unable to make admin interface connection to server. 
(hr=0x80040115, ec=-2147221227)
Diagnostic context:
......
Lid: 12696 dwParam: 0x6D9 Msg: EEInfo: Generation Time: 2012-08-28 13:55:49:266
Lid: 10648 dwParam: 0x6D9 Msg: EEInfo: Generating component: 2
Lid: 14744 dwParam: 0x6D9 Msg: EEInfo: Status: 1753
Lid: 9624 dwParam: 0x6D9 Msg: EEInfo: Detection location: 501
Lid: 13720 dwParam: 0x6D9 Msg: EEInfo: Flags: 0
Lid: 11672 dwParam: 0x6D9 Msg: EEInfo: NumberOfParameters: 4
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[0]: Unicode string: ncalrpc
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[1]: Unicode string:
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[2]: Long val: -1988875570
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[3]: Long val: 382312662
Lid: 24060 StoreEc: 0x80040115
Lid: 23746
Lid: 31938 StoreEc: 0x80040115
Lid: 19650
Lid: 27842 StoreEc: 0x80040115
Lid: 20866
Lid: 29058 StoreEc: 0x80040115 [Server: PNL-EX.petenetlive.net]
MapiExceptionNetworkError: Unable to make admin interface connection to server. 
(hr=0x80040115, ec=-2147221227)
Diagnostic context:
......
Lid: 12696 dwParam: 0x6D9 Msg: EEInfo: Generation Time: 2012-08-28 13:55:49:266
Lid: 10648 dwParam: 0x6D9 Msg: EEInfo: Generating component: 2
Lid: 14744 dwParam: 0x6D9 Msg: EEInfo: Status: 1753
Lid: 9624 dwParam: 0x6D9 Msg: EEInfo: Detection location: 501
Lid: 13720 dwParam: 0x6D9 Msg: EEInfo: Flags: 0
Lid: 11672 dwParam: 0x6D9 Msg: EEInfo: NumberOfParameters: 4
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[0]: Unicode string: ncalrpc
Lid: 8856 dwParam: 0x6D9 Msg: EEInfo: prm[1]: Unicode string:
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[2]: Long val: -1988875570
Lid: 12952 dwParam: 0x6D9 Msg: EEInfo: prm[3]: Long val: 382312662
Lid: 24060 StoreEc: 0x80040115
Lid: 23746
Lid: 31938 StoreEc: 0x80040115
Lid: 19650
Lid: 27842 StoreEc: 0x80040115
Lid: 20866
Lid: 29058 StoreEc: 0x80040115
[/box]


Solution

1. On closer inspection, I noticed the Exchange System Attendant was not running, and when I tried to launch it is started then stopped?

2. And the Exchange Information Store service was also not running, (that explains why the database won’t mount).

3. And when I tried to start that:

Error Windows could not start the Microsoft Exchange Information Store on Local Computer. For more information review the System Event Log. If this is a non Microsoft service, contact the service vendor, and refer to server-specific error code -2147221213

4. Fair enough, the Event Viewer yielded this:

Event ID 5003

Error
Unable to initialize the Microsoft Exchange Information Store service because the clocks on the client 
and on the server machine are skewed. This may be caused by a time change either in the client or the 
server machine, and may require a reboot of that machine. Other than that, verify that your domain is 
properly configured and is currently online.

Well the clock on the Exchange server was correct, as were the clocks on the domain controllers they were both sync’d and in the same time zone.

5. The Exchange server is a VMware virtual machine, and even though it is not set to take it’s time from the host, the time on the host was incorrect.

6. Firstly set the time correctly on the ESX host, (below I’ve used an external NTP server, though you can just manually set the time).

7. Then restart the Exchange Active Directory Topology Service, make sure all the services come up correctly, and check the database has mounted.

Related Articles, References, Credits, or External Links

NA

vSphere: Downgrading Guest ‘Hardware Version’

KB ID 0001458

Problem

I always assumed this was either not possible, (without using VMware converter,) or at least very difficult. I downgraded one of my test ESX boxes from 6.5 to 5.5 this week, and needed to lower the hardware versions on some of my VMs accordingly.

Solution

Connect to the host ESX server via SSH, then navigate to the VMFS volumes;

[box]cd /vmfs/volumes[/box]

Change directory so you are in the right ‘datastore’, locate the VMs folder, and change to that directory. You are looking for the VMs .vmx file, (shown below in green).

Edit the file using ‘vi’ and locate the virtualHW.version value, here it’s version 11 (ESX 6.0).

Here I’m changing it to version 10 (ESX 5.5).

Then remove the VM from the inventory, navigate to its .vmx file and select ‘Register VM‘.

Related Articles, References, Credits, or External Links

NA

VMWare vCenter: Cant Remove ‘Orphaned’ VMs

KB ID 0001398

Problem

I noticed I had a VM that was ‘Orphaned’ in my vCenter web console. It was not a production server or anything, I just wanted to delete it. However the option to Delete or Remove from Inventory was not available.

Solution

It turns out, you just need to ‘dig a little deeper’. All Virtual Infrastructure Action > More Uncategorized Actions > Remove from inventory.

Related Articles, References, Credits, or External Links

vSphere – Guest VM is shown as (Orphaned)

VMware – Cannot Delete an ‘Orphaned’ Replica

CentOS / Redhat / Fedora – VMware VMXNET3 Adapter Not Working

KB ID 0001329 

Problem

This has tripped me up a couple of times, and if you Google the problem, you find a load of posts saying ‘Just install VMware tools that will fix the problem’

It Wont!

And I’ll tell you why, run ifconfig

You will notice you have a network card, but you will also notice that it’s got a strange name ‘ens160’ not eth0 as you would normally expect? Anyway let’s prove it’s not a driver issue by issuing a dhclient -v command. This basically forces the NIC up and makes it get a DHCP address, (assuming your NIC is connected to the correct network, and you have DHCP running of course!)

So this tells me it’s not a driver issue, and that installing VMware tools probably wont cure the problem.

It Didn’t!

Also if you reboot, you will find it’s not working again!

Solution

I’m going to use nano in a minute, (other editors are available), so I’ll install that first. (I’m logged in as root, you may need to prefix the following command with sudo if you are not).

[box]

yum install nano

[/box]

Remember my network card had a ‘funny name’, well change directory to the /etc/sysconfig/network-scripts directory, and you will see it’s config file, so let’s edit that, (change the text in red, to reflect your interface name, from the ifconfig command earlier);

[box]

cd /etc/sysconfig/network-scripts
nano ifconfig-ens160

[/box]

Make sure;

BOOTPROTO=dhcp

ONBOOT=yes

Now if you reboot your VM, it should come back up with networking enabled.

 

Related Articles, References, Credits, or External Links

NA

GNS3 Update – Could Not Find a VM Named ‘GNS3 VM’

KB ID 0001160 

Problem

GNS3 had nagged me the last few times I tried to use it about upgrading, so I downloaded and installed the update and it stopped here;

Could not find a VM named ‘GNS3 VM’ is it imported in VMware or Virtualbox

I use both VMware Fusion and Virtualbox. But Virtualbox looks after all the VM’s I use in GNS3. Either way I did not know what I was looking for, and the download (and application folder) did not have a VM within it for me to import?

Solution

It turns out the link for the VM is on the GNS3version download page, (it redirects you  to another site).

Once you have it downloaded, you can import it into either Virtualbox, VMware Fusion or VMware Workstation.

Then you can select it, and progress.

Related Articles, References, Credits, or External Links

NA

Event ID 27 – “The description for Event ID 27 from source e1iexpress cannot be found”

KB ID 0001130 

Problem

I was seeing intermittent network drops on my Server 2012 R2 servers, so when I took a lot in the logs this was what I found;

[box]

Log Name:      System
Source:        e1iexpress
Date:          {time}
Event ID:      27
Task Category: None
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      {host-name}
Description:
The description for Event ID 27 from source e1iexpress cannot be found. Either the component
 that raises this event is not installed on your local computer or the installation corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the 
event.
The following information was included with the event:
Intel(R) 82574L Gigabit Network Connection.
the message resource is present but the message is not found in the string/message table.

[/box]

Solution

I found plenty of people complaining about this error with servers running Intel physical network cards, but this was a virtual machine? Not only that, but a Windows 2012 R2 Datacenter Machine running on ESXi 6. Forums indicated that it was a problem with the NIC/Driver and that replacing the card had helped. I took a look at the vNIC on the virtual server and was surprised to see it was an E1000 card. This is the default in hardware version 11 for server 2012.

Looking in Windows it’s simply listed at an Intel 82574L Gigabit Network Card.

So I added another network card (a VNXNET 3).

Disable the original card. WARNING: Make sure you are on the console and not remotely connected when you do this!

Give the new card the IP of the old one, and don’t be surprised if you see this popup, CLICK NO.

Then you can remove the original E1000 card.

Related Articles, References, Credits, or External Links

NA