No network access outside of VM/LXC

Stephen Gibson

New Member
Aug 11, 2019
5
0
1
65
I have Promox running in Virtualbox on a windows machine before I move onto replacing my current single system server.

Currently the Virtualbox config for the network adapter is bridged and I have full access to network and internet in the host. I can ping the LXC from the host and I can even ping the LXC from my windows machine

However, trying to run a Ubuntu 18.04 container I can not access anything outside. The container does show up in my router devices but no IPv4 address is assigned.

I currently have a machine acting as my Pihole and DNS server, at address 192.168.1.100.

My host /etc/network/interfaces:

auto lo
iface lo inet loopback

iface enp0s9 inet manual

auto vmbr0
iface vmbr0 inet static
address 192.168.1.44
netmask 255.255.255.0
gateway 192.168.1.254
bridge_ports enp0s9
bridge_stp off
bridge_fd 0

My LXC /etc/netplan/config.yaml:

network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses: [192.168.1.69/24]
gateway4: 192.168.1.254
nameservers:
addresses: [192.168.1.100]
bridges:
vmbr0:
dhcp4: false
interfaces: [eth0]
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
3,009
327
83

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
3,009
327
83
For ubuntu PVE uses systemd-networkd as network configuration - check the files in `/etc/systemd/network`
Also post the output in code tags of:
* `ip link`
* `ip address`
* `ip route`
inside the container once it's started

can you ping the default gateway (192.168.1.254) of the container?
 

Stephen Gibson

New Member
Aug 11, 2019
5
0
1
65
Thanks for helping but I seemed to have magically fixed it...kind of.

I think there was some conflict between Proxmox network and netplan.

And my other configuration has not changed.

What I did was, remove the adaptor from the network tab and re-add it. Deleted all the devices added to my routers devices by dhcp and restarted everything. Working flawlessly now.
 
Last edited:

Stephen Gibson

New Member
Aug 11, 2019
5
0
1
65
I also just spun up another container entering only the config stuff into the network setup step, didn't touch netplan.yaml. All working good.
Do I just not need netplan? That's just what I used on my bare metal server running ubuntu 18.04, so assumed I had to do the same.
 

Stoiko Ivanov

Proxmox Staff Member
Staff member
May 2, 2018
3,009
327
83
* As said, in general PVE takes care of configuring the network of a container, if it knows how to do it (i.e. the 'ostype' is set).
* For Ubuntu (and most distributions which support it) we use systemd-networkd for network-configuration and skip the way through netplan (which afaik renders a fitting systemd-networkd file).
This follows the idea that it would make setting the network configuration quite cumbersome if you need to both set it in the hypervisor and inside the container...

hope this explains it!
 

Stephen Gibson

New Member
Aug 11, 2019
5
0
1
65
It does. Thank you! I shall have a wee peek in the systemd-networkd file to see what's going on there.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!