[SOLVED] Getting DHCP IP but no network

TLDR; Scroll down for answer :slight_smile:

So I setup a clean VM in VirtualBox. I setup bridge devices as described by several tutorials. I create a VM, I get a DHCP address. But after that I got no ping from the container to any IP on the local network, let alone outside. I can ping the VM from my host though.

So the question remains, what am I doing wrong? I’m running both host and VM Ubuntu 16.04 LTS, with LXD 2.0.8:

root@ubuntu:/home/test# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

The loopback network interface

auto lo
iface lo inet loopback

The primary network interface

auto enp0s3
iface enp0s3 inet manual

auto br0
iface br0 inet dhcp
bridge_ports enp0s3
root@ubuntu:/home/test# lxc profile list
default
docker
root@ubuntu:/home/test# lxc profile show default
config:
environment.http_proxy: “”
user.network_mode: “”
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
name: default
used_by:
root@ubuntu:/home/test#

root@ubuntu:/home/test# lxc list
±-----±--------±----------------------±-----±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±-----±--------±----------------------±-----±-----------±----------+
| u1 | RUNNING | 192.168.192.12 (eth0) | | PERSISTENT | 0 |
±-----±--------±----------------------±-----±-----------±----------+
Any help is appreciated, as I’m going completely nuts. Thanks!

My IPtables:

iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT udp – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all – anywhere anywhere
ACCEPT udp – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

EDIT: Fixed; image

Set Promiscuous Mode to ‘Allow All’!

Some virtual machine managers are known to block additional MAC addresses from being used within the virtual machine. I’m not familiar with VirtualBox but this may be the problem you’re running into there.

Would you by any chance happen to know if this is the case for VMware? If not, I’ll give VMware a try…

Why would I be getting a DHCP IP though?

Thank you!

VMWare defeinitely does that. You need to do some fancy vswitch configuration (or whatever it’s called these days) to turn off that MAC filtering. I remember at some point the only option was to use promiscuous mode on the whole bridge which kinda sucked for performance.

Depending on your network, a router approach to this problem may be easier.
See How to access Container via 10.xx subnet on 192.xx subnet for example.

Thank you very much. I’ll just host it on a VMware vSphere VPS then, see if that works!
At least I’m not getting crazy.

Solved! Set ‘Promiscuous Mode’ to Allow All, and it works.
Both on VMware and Oracle Virtualbox!

image

1 Like