Page 1 of 1

Connectivity Problems

Posted: 16. Sep 2015, 11:21
by domobcn
Hi,
my name is Alberto and I am trying to connect my host computer to the virtual machine.

I have a Windows 7 Installed and in the Virtual Machine i've installed a Ubuntu 14.04 Server 32-bit.

My /etc/network/interfaces configuration looks like:
-----------------------------------------
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.56.101
network 192.168.56.0
netmask 255.255.255.0
broadcast 192.168.56.255
gateway 192.168.56.1

auto eth1
iface eth1 inet dhcp
--------------------------------

In /etc/resolv.conf there's nothing (well a commented text with #)

I've looked through internet and so and some people are talking about /etc/udev/rules.d/70-persistent-net.rules, but I don't have this file

My configuration on Oracle VM Virtualbox looks like this:

Adapter 1:
Adapter Host only
VirtualBox Host-only Adapter
Adapter type: Intel Pro/1000MT Desktop (82540EM)
Promiscuous mode: Allow everything
Cable connected (option marked)

Adapter2:
NAT
(Same Type of Adapter...83540EM)
Promiscuous mode Deny
Cable Connected
Port forwaridng option:
Rule 1 TCP (blank on both IP addresses) Host port 2525, Guest Port 22)

Also there is another place where to configure
Virtualbox->File->Preferences (CTRL+G)-> Network
Nat Network:
One Nat network added and checkbox marked with the same port forwarding configuration as in the other place with the nat, dhcp allowed, ipv6 not
and in host only adapter
Virtualbox ethernet adapter without dhcp server and address 192.168.56.1
mask: 255.255.255.0

Also when I start my Ubuntu no network interfaces except from loopback could be seen, when I force it (eth0 up) they appear without IP addres, no ping to any network.


I have added some pics about it to make it easily but I couldn't put them in any order (sorry).

Re: Connectivity Problems

Posted: 16. Sep 2015, 11:24
by domobcn
I am adding some pics since there are only 3 visible per post

Re: Connectivity Problems

Posted: 16. Sep 2015, 11:26
by domobcn
And some more...

Re: Connectivity Problems

Posted: 16. Sep 2015, 11:28
by domobcn
And the last ones...

Re: Connectivity Problems

Posted: 16. Sep 2015, 19:55
by noteirak
All I can tell you is that your guest configuration is not correct for eth0.
You need to remove the gateway - Host-Only mode does not offer a gateway and so nothing will go throught there. It might block other requests until you do so.
I would also advise on setting the IP to 192.168.56.2 and not 101 - this overlap with the DHCP range of the Host-Only interface which is never a good idea.

Re: Connectivity Problems

Posted: 17. Sep 2015, 12:17
by domobcn
Hi noteirak,

Thank you for answering my question, I went to /etc/network/interfaces and erased the gateway and also changed the ip address to 192.168.56.2, but it didn't work for me :(

Ifconfig result is only loopback and when I attempt to "ifconfig -a" there are no ip addresses on eth0 eth1. I have the dhcp server in host-only empty. Should I put something there?

Eth1 (Nat) doesn't have any Ip also.

I'm getting stuck in this and I am not sure what am I doing wrong, please help.

Thank you!

Re: Connectivity Problems

Posted: 17. Sep 2015, 12:41
by noteirak
Moved to "Linux Guests".

try the following command:

Code: Select all

sudo ifconfig eth1 down
sudo ifconfig eth1 192.168.56.2 netmask 255.255.255.0
sudo ifconfig eth1 up
sudo route -n
What is the output?

Re: Connectivity Problems

Posted: 18. Sep 2015, 12:49
by domobcn
Hi noteirak!

Everything works now!! :D

How it has been solved: ( I feel kind of ashamed because it was a stupid mistake)

in the /etc/network interfaces I deleted a '#' (comment character) at the beginning of the file (second line), while i was putting some IP addresses and the keyboard was with the Bloq Num, so I moved to start and end of the /etc/network/interfaces file while I tried to put the Ip and each time I write the point 192.168.... my keyboard supress some characters :D

So, my configuration has ended this way:
1st Adapter: //my network
Bridge Adapter //network access
Promiscuous mode: Everything
2nd Adapter:
Nat //internet Access
(with the port forwarding
3rd Adapter: //host access with putty
Host-only Adapter
Promiscuous mode: Everything

And my /etc/network/interfaces looks like:

Code: Select all

nagios@ubuntu:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
#ad how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
 auto eth0
 iface eth0 inet static
 address 192.168.0.25
 network 192.168.0.0
 netmask 255.255.255.0
 broadcast 192.168.0.255
 gateway 192.168.0.9
 dns-nameservers 8.8.8.8 8.8.4.4


# The secondary network interface
auto eth1
iface eth1 inet dhcp

# The tertiary network interface
auto eth2
iface eth2 inet static
address 192.168.56.101
netmask 255.255.255.0

IMPORTANT:
I put the eth0 into the same network my host is working.
I am still trying how to connect with putty from another computer (in my network) directly to the guest machine.

Thank you for your pacience, specially noteirak. I hope this post help somehow.

Re: Connectivity Problems

Posted: 19. Sep 2015, 01:24
by noteirak
I had a feeling it was something like that, that's why I asked you to do it manually. Glad it's working now!

I see you have setup 3 adapters now, one with NAT and another with Bridged - BEWARE! if your Bridged gets a gateway via DHCP (or you configure one) you'll get network problems when trying to connect to/from the VM. Make sure only one gateway exists.