Virtual Box Bridged network failed to get IP (DHCP) No DHCPOFFERS received

10,377

Configuring bridge in your situation is not trivial, because there is no dhcp and because the IP address you wish to have for your VM is a public address, not a private one. I strongly suggest you use NAT instead, because in this case I am sure there are no legal implications.

If you insist in using a public IP address for your guest (and, I, repeat, you are doing this against my advice), you may use the same technique one uses when it is legal to do so, i.e. for instance when you are trying to occupy a private address.

You will have to find an IP which is not already occupied. Let us suppose that you have determined that X is a free IP address within your range. Then all you have to do is to set up the guest for a static IP.

Edit the guest's /etc/network/interfaces file, and make it look as follows:

 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet static
    address X
    netmask 255.255.255.0
    gateway TheIP.Of.Your.Gateway
    dns-nameservers 8.8.8.8 8.8.4.4

The above assumes that eth0 is the name of the ethernet card of the guest, if it is not use the appropriate one (enp3s0?). Now reboot your VM guest, and you should be good to go.

How do you find out the address X? First of all you will have to sniff traffic on your regular (enp3s0) interface. Use wireshark for this, you may google to find out how to use it. Then you have two options.

  1. use a free X ip address, i.e. one that you have never seen used. It is possible your provider has countermeasures to block this, after all your traffic has to go through his gateway and, if he does not want you to steal a public IP address, I could not possibly blame him.

  2. use an occupied IP address. Take note of both IP address and MAC address of a pc in your IP range, then spoof it. In other words, in VirtualBox's networking panel, insert the spoofed MAC address for the MAC address of the guest' NIC, and use the IP address as your X address above. This contraption will work fine when the original machine is idle, but will surely cause problems in the other situations because of the conflict inherent in having two machines with the same MAC and IP addresses.

Let me also add that there techniques to trace back the use of a spoofed IP address to you.

For these reasons, and for legal reasons, I strongly urge you to use NAT instead.

Share:
10,377

Related videos on Youtube

CROSP
Author by

CROSP

Updated on September 18, 2022

Comments

  • CROSP
    CROSP over 1 year

    I am newbie in networking and virtual box configuration, I have spent several days dealing with this problem. My goal is to get Bridged network working.
    When I try to UP interface in my Virtual Box VM, it tries some DHCPDISCOVER messages, but eventually I get No DHCPOFFERS received.
    I find where is the problem.
    On my host machine I have following network interface configuration (interface I want to have bridge with).

    HWADDR=5c:9a:d8:68:45:ff
    DEFROUTE=yes
    PEERDNS=yes
    PEERROUTES=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_PEERDNS=yes
    IPV6_PEERROUTES=yes
    IPV6_FAILURE_FATAL=no
    NAME=enp3s0
    DEVICE=enp3s0
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=static
    IPADDR=195.XX.YY.ZZ
    NETMASK=255.255.255.0
    NETWORK=195.XX.YY.0
    GATEWAY=195.XX.YY.GGG
    BROADCAST=195.XX.YY.255
    DNS1=195.XX.YY.DDD
    DNS2=8.8.8.8
    DOMAIN=some.domain.com
    

    So configuration is static.
    If use BridgedAdapter on interface that in turn uses dhcp to get access to the Internet everything works great. as expected.
    I guess that I have missed something or configuration should be done in another way, to be honest, I don't really understand how bridged network works internally.
    Maybe problem can easily solved, but have not enough knowledge know to fix it by myself, so I am asking here.
    Please help to solve this problem. Thanks everyone in advance for any help

    • MariusMatutiae
      MariusMatutiae almost 9 years
      Your interface enp3s0 (Fedora or Arch?) has a public IP, and your gateway and network all belong to the public domain. It is quite possible that there is no dhcp server. Have you tried to get an IP address from dhcp on enp3s0, outside VirtualBox?
    • CROSP
      CROSP almost 9 years
      There is no dhcp in my public network, how can I configure bridge with this configuration ?