Category Archives: WanEm

Clone Virtual Machine – Linux (debian) – eth0 missing

Today I found a solution for a problem which was bugging me for a while now.  (I encountered this error when I tried to clone my WanEm virtual machine.)

If you clone a virtual machine (created via Hyper-V, Virtualbox, VMWare, …) which is using Linux as an operating system you will notice that the cloned machine is missing the eth0 network interface. That´s strange because you added a network adapter during it´s creation.

If you run the following command in the terminal:

ifconfig eth0 up

You will receive the following error message:

eth0: ERROR while getting interface flags: No such device

So what could have gone wrong? The answer is quite simple: You added a new network adapter with a different MAC address and Linux was not able to detect this change. What can you do to solve this problem? The solution is also quite simple.

Here it is:

Run the following commands:


sudo rm /etc/udev/rules.d/z25-persistent-net.rules
sudo reboot

After the operating system successfully rebooted your problem will be solved.

If you now run

ifconfig -a

you will see that there is an eth0 interface now.

Sources:

http://fl3x.us/blog/2013/08/30/eth0-error-while-getting-interface-flags-no-such-device/

http://chris.dziemborowicz.com/blog/2010/07/25/fix-missing-eth0-when-cloning-ubuntu-vmware-virtual-machines/

http://lostechies.com/derickbailey/2009/06/20/cloning-or-converting-linux-vm-from-vmware-workstation-to-esx-server-eth0-gone-eth1-available/

Tagged , ,

Add www-data user to sudoers file (WANEM)

Hi. In this post I´ll show you how to add the www-data user to the sudoers file. The reason why I am blogging about this is the following: If you followed my Instructions to install WANEM like in my previous post “Installation of WANEM” you will notice that you can not apply settings to your WANEM machine via the configuration website. But why is that so?

Well, you can not apply settings to your WANEM machine via the configuration website because the user www-data who wants to apply your settings for you on the machine does not have the permissions to do so. This can be a very annoying mistake so I decided to write down the solution.

I will show you how you can solve this problem.

Before we begin I recommend that you make a backup of your current sudoers file.

sudo cp /etc/sudoers /etc/sudoers-old

Now we need to edit it.

sudo nano /etc/sudoers

You need to add the following line to the sudoers file to grant the www-data user the appropriate permissions:

www-data ALL=(ALL) NOPASSWD: ALL

That´s it. Now all you need to do is reboot your machine and try to apply your settings. It should work now.

Sources:

http://www.ogris.de/howtos/wanem.html

Tagged

Enable IP Forwarding in WANEM

In this post I will show you how you can enable IP Forwarding permanently in WANEM if you installed it to a hard disk like I have shown you in my last post “Installation of WANEM“.

Important Note: The following steps will only work if you chose debian as System like I did.

You can check if IP Forwarding is enabled with the following command:

sudo cat /proc/sys/net/ipv4/ip_forward

If you receive 0 as an answer it means that IP Forwarding is disabled. If you receive 1 as an answer it means that IP Forwarding is already enabled.

Before you perform the steps to enable IP Forwarding I would recommend you make a backup of the options file in case you want to revert the configuration. You can do this with the following command:

sudo cp /etc/network/options /etc/network/options-old

Ok. Now we will enable IP Forwarding.

The First step is to edit the options file. I used nano to edit the options file.

sudo nano /etc/network/options

You need to change this line from

ip_forward=no

to

ip_forward=yes

Now press Ctrl+O to write the changes to the file and press Ctrl+X to exit nano.

Now the last step is to restart the networking service. You can do this with this command:

sudo /etc/init.d/networking restart

That´s it. IP Forwarding is now enabled.

Sources:

http://step4wd.com/2010/01/18/enable-ip-forwarding-in-linux/

Tagged

Installation of WANEM

WANEM is used to emulate WAN links. It is often used for testing applications over long distances with high delays and packet loss. You can use WANEM running on a physical or virtual machine using the Live CD Image provided here. You can use it as it is or you can install it on your hard disk so you don´t have to do the same configurations every time.

I will show you how to install WANEM on a virtual machine using Microsoft Hyper V.

By the way: I used WANEM v2.3.

The first step is to download the WANEM Image. You can download it from here.

Now you need to create a new virtual machine. I called my virtual machine “WanEm”, assigned 512MB RAM and created a new VHDX hard disk with 10GB capacity.Create_Virtual_Machine_0Create_Virtual_Machine_1Create_Virtual_Machine_2

Now go to you virtual machine´s settings. Since the default Network adapter Hyper V assigns to virtual machines will not work you need to remove it and replace it with a “Legacy Network Adapter“.

Settings_0Settings_1

Now start you virtual machine and insert the WANEM Image you downloaded earlier.

You will be welcomed by the screen below. Press ENTER to continue.

Installation_Step_0

Installation_Step_1

If you are asked if you want to configure all interfaces via DHCP choose no. You will need to configure a static IP address later so you can access the built-in website to configure WANEM.

Installation_Step_2

Hit ESC to Exit.

If you are asked for a password for the user perc just enter a new password and confirm it by retyping it.

Now exit to the Shell by typing

exit2shell

.

To start the installation enter

knx2hd

.

Installation_Step_3

Installation_Step_4

Installation_Step_5

Choose Partition.

Installation_Step_6

Select your hard disk you created earlier. (Use SPACE to select the disk.)

Installation_Step_7

Now create a new partition. I chose to use the Template.

Installation_Step_8

Installation_Step_9

Now choose Configure Installation.

Installation_Step_10

Now choose your system. I chose debian.

Installation_Step_11

Choose the partition you want to install your system to.

Installation_Step_12

Now you will be asked what filesystem-type you want to use. I chose ext3.

After that you will be asked to create a new user and assign that user a password. And you will be asked to assign a new password to the Administrator account (root). And you need to assign a computer name.

Installation_Step_14

Next you will be asked where you want to install the boot-loader. I chose mbr.

Installation_Step_15

Now you can choose Start Installation.

Installation_Step_016

Now is the last chance to check your configuration. If you hit Next the installation will start.

Installation_Step_17

After the installation process has finished you will be asked to insert a floppy into your floppydrive. Ignore this part and choose No.

Installation_Step_18

That´s it. The installation process was successful.

Now enter

reboot

.

Your machine is now ready to use.

If you don´t want to go through all these steps by yourself you can download the VHD Image I prepared for you from here.

Sources:

http://wanem.sourceforge.net/

http://www.ogris.de/howtos/wanem.html

http://blogs.msdn.com/b/kenkilty/archive/2013/02/07/hyper-v-for-developers-part-2.aspx

http://vninja.net/virtualization/installing-and-configuring-wanem-virtual-appliance/

http://www.onemanarmy.biz/ubuntu-debian-wanem-network-setup-briged-interface.php

http://voland.su/wp-content/uploads/2013/02/wanemulator_all_about_v2.0.pdf

http://arashafiei.wordpress.com/2013/04/02/wanem-on-virtualbox/

Tagged ,