bridge adapter not working in virtualbox

4

2

NAT works fine and I have internet connection, but bridged connection not working. I have tried quiet a few things, including resetting MAC address for bridged adapter:

enter image description here

when I do ifconfig it does not show eth0

enter image description here

But when I look in interfaces eth0 is in there as shown below:

enter image description here

It was working before so I don't know what could be the issue. I also noticed when I restart VM it stalls for a while saying configuring network settings or something along those lines but I am guessing it never receives the settings.

user2612587

Posted 2013-12-11T02:11:14.460

Reputation: 273

Answers

13

The bridge adapter has nothing to with this. Your VM simply has not started your ethernet interface. You should try manually:

   sudo ip link set dev eth0 up
   sudo dhclient -v eth0
   ping -c1 8.8.4.4

The -v option might have to be removed, depending on your distro. Also, just to be on the safe side, allow the promiscuous mode for VMs only.

MariusMatutiae

Posted 2013-12-11T02:11:14.460

Reputation: 41 321

1would you mind explaining what each of the above commands does? In my case I have enp0s3 instead of eth0. The first command sudo ip link set dev enp0s3 up works. However sudo dhclient -v enp0s3 goes into a inifinite loop saying something like DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 11 (xid=0x5bd18616) for ever.. – alpha_989 – 2018-03-25T16:09:55.147

1@alpha_989 The second command asks for the an IP address to the local DHCP server. If it loops forever, then it means that either there is no DHCP on the LAN, or that there is no network connection whatsoever. If you are sure that there is a DHCP server on your LAN, then it means you have not correctly configured VirtualBox´s interfaces. – MariusMatutiae – 2018-03-26T09:09:59.950

thanks it works. why it just work with dhcp mode ?. i try with no success when trying static ip mode. – Brain90 – 2019-02-01T12:54:55.520

@Brain90 It should work with a static IP as well. But first and foremost, it seems to me your ethernet interface is down, which means it needs to be brought up. If it is down initially, then it means your Network-manager is misconfigured. In order to diagnose that, though, it i sbest to ask a different question, since this really differs from the OP. – MariusMatutiae – 2019-02-01T16:13:48.413