Page 1 of 2

Bridged Connection, Local connection but no internet

Posted: 10. May 2012, 02:38
by ninelegs
Forgive me for rehashing this, I have searched the forum but to no avail.
I had a Win7 host and a Ubuntu 12.4 guest. The internet works fine in the guest with NAT enabled but I would like to access the guest over the network. I enabled the bridged adapter to my Intel Pro1000/ Wifi Link 1000BGN adapter. I can now access the guest from the host and the host can ping others on the network including the router but no internet access. Within the ubuntu guest the connection shows up as a wired connection.
Need some help getting this guy on the internet.
Will provide any info I can.
Thanks,
ninelegs :D

Re: Bridged Connection, Local connection but no internet

Posted: 10. May 2012, 05:46
by BillG
Yes, the connection inside the vm will diplay as a wired connection because the emulated NIC is a wired Ethernet card.

The first thing to check is that the guest is getting the correct config from DHCP (although that should be OK if the local networking is working). Compare an ifconfig from the guest with an ipconfig on the host and see if everything matches (except the IP of course) especially the gateway and DNS addresses.

Re: Bridged Connection, Local connection but no internet

Posted: 10. May 2012, 21:47
by hobby16
Hi all,
I have the same config (Virtualbox, Host=Win7, Guest=Ubuntu) as ninelegs... and the same problems
I want all PC on my router to access to Apache & mysql installed on guest.
With "Private Host", I can access guest with phpMyAdmin but only from host, any other PC on the network don't see guest.

1) So I've set up 1 card in "Bridge" mode (some tutorials says I must set up 2 cards : 1 card in NAT and 1 card in "host only", so I still don't know if I must also add 1 card in NAT with 1 card in Bridge, very confusing!)
ifconfig in guest gives no ipv4 interface so I type

Code: Select all

sudo ifconfig eth2 192.168.1.44 255.255.255.0
then ifconfig gives

Code: Select all

eth2      Link encap:Ethernet  HWaddr 08:00:27:9f:96:d9  
          inet addr:192.168.1.44  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe9f:96d9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:852 errors:0 dropped:0 overruns:0 frame:0
          TX packets:142 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:83690 (83.6 KB)  TX bytes:23470 (23.4 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:240 (240.0 B)  TX bytes:240 (240.0 B)
ping Host (192 .168 .1. 99) to Guest (192. 168. 1. 44) : OK
ping Guest to Host : OK
ping Guest to router (192. 168. 1. 1): NO response
ping Guest to google : NO response
ping Host to google : OK
ping Router to Host : OK
ping Router to guest : No response

What am I missing here ? any help is much appreciated, I've spent two days trying to make this work, it's crazy, there is always something missing or too old in various tutorials!
Thank you in advance.

P.S. Using my router's DHCP to give guest an ipv4 address doesn't work either.

Re: Bridged Connection, Local connection but no internet

Posted: 10. May 2012, 22:13
by hobby16
Here is what I tried (with no success) with DHCP instead of static IP addresses

In guest, I put this in /etc/network/interfaces

Code: Select all

auto lo
iface lo inet loopback

auto eth2
iface eth2 inet dhcp
   hostname myhostname # hostname to be requested
Then restarted network with
sudo /etc/init.d/networking restart
but all I have is this :

Code: Select all

 * Reconfiguring network interfaces...                                          
There is already a pid file /var/run/dhclient.eth2.pid with pid 1691
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.2
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.

Listening on LPF/eth2/08:00:27:9f:96:d9
Sending on   LPF/eth2/08:00:27:9f:96:d9
Sending on   Socket/fallback
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 21
At the end, there is no IP address for eth2, just as if the router's DHCP server doesn't see the guest's virtual network card.

Code: Select all

eth2      Link encap:Ethernet  HWaddr 08:00:27:9f:96:d9  
          inet6 addr: fe80::a00:27ff:fe9f:96d9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:990 errors:0 dropped:0 overruns:0 frame:0
          TX packets:196 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:97066 (97.0 KB)  TX bytes:39237 (39.2 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:240 (240.0 B)  TX bytes:240 (240.0 B)

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 01:05
by BillG
hobby16 wrote:Hi all,
I have the same config (Virtualbox, Host=Win7, Guest=Ubuntu) as ninelegs... and the same problems
I want all PC on my router to access to Apache & mysql installed on guest.
With "Private Host", I can access guest with phpMyAdmin but only from host, any other PC on the network don't see guest.

1) So I've set up 1 card in "Bridge" mode (some tutorials says I must set up 2 cards : 1 card in NAT and 1 card in "host only", so I still don't know if I must also add 1 card in NAT with 1 card in Bridge, very confusing!)
It may appear to be confusing, but that is because you are comparing apples and oranges! With a NAT connection you also need a Host Only link if you want the guests to see each other. NAT guests in VirtualBox do not have network access to each other.

Bridged mode is completely different. In bridged mode the NIC in the vm is effectively bridged to the physical NIC in the host. The vm should behave just like an additional physical machine on your LAN. It should get its network config from your DHCP server and just work. If it does not get its config automatically (for whatever reason) manually configuring the NIC in the vm should work if you do it properly.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 01:36
by ninelegs
Ok so in bridged mode my Connection Information is identical to the host (except ip), using dhcp. The subnet mask, default gateway, DNS are all identical.
I can ping the host and others on the network including the router(both the LAN side and the WAN side).
I'm using a comcast modem/router for my connection but have had no other problems. When i do a tracerout from the guest it never makes it past the router. Just to be clear I am only using the one NIC, the same as the host. The router of course sees it as a different NIC.
Any ideas?
ninelegs

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 02:34
by Perryg
Does NAT allow access to the Internet?
Do you have access to the router?
I would look for filters set to keep the second machine from accessing Usually a MAC filter.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 03:16
by ninelegs
NAT does allow access to the internet, but of course no access to the guest from the host or other machines. There is no mac filtering set on the router. The router does show the guest as a dhcp client.
ninelegs

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 03:21
by Perryg
Bridged will appear just like a second PC on the LAN so if NAT works, and Bridged does not then there must be something filtering the access. Look at firewalls, virus software, routers firewall, Etc.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 04:11
by ninelegs
I've disabled the firewall and av on the host to no avail.
I'm a linux noob so is there anything I can check here in ubuntu?

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 04:16
by Perryg
You can use wireshark to see where it is stopping.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 04:30
by BillG
Maybe there is a problem with DNS forwarding. Have you tried hard coding a public DNS server (like your ISP DNS or 4.2.2.2) into the guest?

If that isn't the problem, then a network sniffer (as Perry suggested) is the only thing I can think of. There is something odd happening somewhere in the network.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 10:18
by hobby16
Perryg wrote:Does NAT allow access to the Internet?
Do you have access to the router?
I would look for filters set to keep the second machine from accessing Usually a MAC filter.
With NAT, my guest have access to the Internet, up and working at the outset, no configuring needed.
With Host-Only, my host web browser can access to my guest server (Apache & mysql) and of course, guest can't access Internet. Here too, it's up and working at the outset, no configuring needed.

But with the @#%* Bridge, my guest can't access Internet, can't ping router (can only ping host), my host can't access my guest's web server whereas it should, theorically.
More details : in the above Bridge mode (just one card)
- I configure nothing in my Host (Win7), should I ?
- I configure my guest by adding to /etc/network/interfaces

Code: Select all

iface eth2 inet static
       address 192.168.1.44
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       gateway 192.168.1.1
and by typing sudo ifconfig eth0 192.168.1.44 (don't know what for, just got it from Sasquatch on this forum somewhere, sorry, I'm a linux noob).

BTW, on router, mac filtering has been disabled and DHCP is activated but only for x.x.x.90 to x.x.x.100 interval
Is it all I have to do to get Bridge work or am I missing something ?
BillG recommended "manually configuring the NIC in the vm" but I don't know what to do. With the System/Administration/Network Tools graphical tool of Ubuntu, I can't change anything, only read the NIC's parameters.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 10:22
by hobby16
BillG wrote:Maybe there is a problem with DNS forwarding. Have you tried hard coding a public DNS server (like your ISP DNS or 4.2.2.2) into the guest?
I've tried to give Guest the same DNS server as Host (my provider's DNS ip) but when I ping google, instead of aborting immediately with "ping: unknown host google fr", it takes sometimes before aborting. Anyway, ping failed.

Re: Bridged Connection, Local connection but no internet

Posted: 11. May 2012, 21:08
by hobby16
Some progress, but problem still not solved :
With Bridge mode, in Guest, I have set a fixed ip address with

Code: Select all

ifconfig eth2 192.168.1.44 netmask 255.255.255.0
added the gateway to my router with

Code: Select all

route add default gw 192.168.1.1 eth2
and added DNS server IPs to /etc/resolv.conf

No tutorial on Bridge mode has shown it, I wonder if what I do is correct ?!?

Now I can ping my router from Guest but the router can't ping Guest
On my router there is a list of all connected computers but I can't see Guest's virtual network card
I can access internet from Guest (very slow to discover IP)
My host can access Guest's mysql server but no other physical computer on the same router can access Guest's mysql server and that's precisely the problem I want to solve !
Any help much, much appreciated...