0

I have to create my own network between three virtual machines. One would be the machine that will act as the host and the rest will be connected to it.

The three virtual machines that I have to connect are:

  • Windows Server 2008 (host)
  • Windows 7
  • Ubuntu 14.04

I was able to connect Windows 7 virtual machine with Windows Server 2008 and have connection to Internet in both of them but I am getting troubles with the last one.

I have to use the following configuration:

                  Windows 7            Ubuntu            Windows Server

IP               192.168.1.3         192.168.1.4         192.168.1.5
Subnet mask      255.255.255.0       255.255.255.0       255.255.255.0
Gateway          192.168.1.1         192.168.1.1         192.168.1.1
Main DNS         192.168.1.5         192.168.1.5         127.0.0.1
Secondary DNS      8.8.8.8             8.8.8.8             8.8.8.8

On Ubuntu virtual machine is where I am getting problems so I am going to describe the process that I use to configure the network on it.

I have used the following command to configure the interface:

sudo nano /etc/network/interfaces

and I have edited the file as follows:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.4
netmask 255.255.255.0
gateway 192.168.1.1
nameserver 192.168.1.5 8.8.8.8

And I tried to restart the network to save the changes with the following command:

sudo /etc/init.d/networking restart

but I am getting the following error:

stop: Job failed while stopping

start: Job is already running: networking

I thought that the problem was here because it gave to me that error but if I use the command ifconfig I am getting the configuration that I have already configurated.

I do not have access to Internet, though.

Am I missing some configuration? Am I configurating my network in the wrong way?

EDIT: This is the output when I use ifconfig eth0:

Direc. inet: 192.168.1.4 Difus: 192.168.1.255  Masc: 255.255.255.0
....................................
Packages RX:535 errors: 0 lost: 0 overruns: 0 frame: 0
Packages TX:87 errors: 0 lost: 0 overruns: 0 carrier: 0
colisions: 0 long.colaTX: 1000
Bytes RX: 41785 (41.7 KB)   TX bytes: 10286 (10.2 KB)

Thanks in advance!

  • To restart the network, use sudo service network-manager restart. Also please post the output of ifconfig eth0 – Gansheim Apr 10 '17 at 20:35
  • @hamiheim I have used both commands and I have edited my question with the output of ifconfig eth0. – Error404 Apr 10 '17 at 21:37
  • And you got the same error both times? No change after system reboot? – Gansheim Apr 10 '17 at 21:41
  • @hamiheim What do you mean? I have used sudo service network-manager restart and I did not have any error there. After that I reboot the virtual machine but I still do not have connection to Internet – Error404 Apr 10 '17 at 21:44
  • Does your Hyper Visor see the IP of that VM as 192.168.1.4? – Gansheim Apr 10 '17 at 21:48
2

Your issue is with DNS resolution. Change your interfaces file to reflect the following:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.4
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameserver 192.168.1.5 8.8.8.8

Then run sudo service network-manager restart to reload interface with updated nameserver. You should have internet access.

  • Now I have connection to Internet. Thank you very much! Just as a note: you set a typo in your answer manager and that I had to reboot the VM after doing the changes and restarting the network. Thanks again! – Error404 Apr 11 '17 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.