Proxmox on local network - No IP for the containers

TH3Mjuss

New Member
Aug 16, 2017
9
0
1
29
France / Sweden
Hi guys,
I recently discovered the existence of Proxmox, and before putting that on a dedicated server, I wanted to test this at home.

To do this, I put a pve 5 ISO on VirtualBox and assigned it an IP accessible from my router - with the router as gateway.

Pve works fine, and I can connect to the internet with it. On the other hand, it's not the same for my containers. If I assign my containers an IP by DHCP, it doesn't have any IP. If I give an IP from my router's, with as gateway pve, it is not connected to the internet.

How can pve and my containers be connected to the internet, and accessible on my local network?

Below are my /etc/network/interfaces files, which should be useful.

/etc/network/intefaces container:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
   address 10.96.101.31
   netmask 255.255.255.0
   gateway 10.96.101.30


/etc/network/interfaces PVE:
Code:
auto lo
iface lo inet loopback

iface enp0s3 inet manual

auto vmbr0
iface vmbr0 inet static
   address 10.96.101.30
   netmask 255.255.255.0
   gateway 10.96.101.107
   bridge_ports enp0s3
   bridge_stp off bridge_fd 0
 
If you have two network interfaces on your server, you need to connect both to your local network. Otherwise you need to remove the IP from eth0 and set it onto the bridge vmbr0 (needs to be the same IP) and then set bridge_ports to include eth0.
 
Thanks for your reply Alwin ! I'm not sure I understood your solutions..
How can I bridge vmbr0 to eth0 ? Should I create a eth0 interface in my pve /etc/network/interfaces files ? If so, what should the /etc/network/intefaces file look like in my CT ?
 
My mistake, I didn't see your comment above the network settings. Your gateway in the container is still the router, as you are bridging and not routing your traffic.
 
My mistake, I didn't see your comment above the network settings. Your gateway in the container is still the router, as you are bridging and not routing your traffic.
Even, if I set the router as gateway on the CT, I don't get any IP by DHCP or by assigning a static one..
 
Is the connection to the network working with a static IP? If so, then set in the PVE GUI the network to DHCP for the CT and check if the container gets a IP.
 
Is the connection to the network working with a static IP? If so, then set in the PVE GUI the network to DHCP for the CT and check if the container gets a IP.
I guess the connection to the network is working, since I assigned a static IP to PVE and PVE is pinging fine any website or devices on my LAN. But if I set the CT network to DHCP, it doesn't get any IP.

Here's what I get if I set my CT network to DHCP:
Code:
root@debian:~# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
        valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
6: eth0@if7: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 82:2c:2d:7b:4f:54 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::802c:2dff:fe7b:4f54/64 scope link
        valid_lft forever preferred_lft forever

EDIT:
I just realized when having a look on my router's control panel that the device having the mac adress 82:2c:2d:7b:4f:54 had the IP: 10.96.101.164. It means that my CT gets an IP from my router's DHCP server.... So I don't understand why I don't have any connection noor IP on my CT.
 
Last edited:
How does your CT config look like? And is "bridge_stp off bridge_fd 0" on two separate lines?
 
This is my current CT config:
Code:
auto lo
iface lo inet loopback 

auto eth0
iface eth0 inet static
    address 10.96.101.31
    netmask 255.255.255.0 
    gateway 10.96.101.107 
    bridge_stp off 
    bridge_fd 0

When I pingPVE, it works. when I ping my router, I get "Destination host unreachable" - even if the CT is detecteed by the router. If i ping google, I get "unkown host google.com".
 
The container config is found under /etc/pve/lxc/<ctid>.conf
 
The container config is found under /etc/pve/lxc/<ctid>.conf

My bad, I read too fast. Here's my CT config:
Code:
arch: amd64
cores: 1
hostname: debian
memory: 512
net0: name=eth0,bridge=vmbr0,gw=10.96.101.107,hwaddr=82:2C:2D:7B:4F:54,ip=10.96.101.31/24,type=veth
ostype: debian
rootfs: local-lvm:vm-100-disk-1,size=8G
swap: 512
 
bridge_stp off bridge_fd 0 are for the vmbr0 and not for eth0 inside your CT.

They should look like this:
Code:
bridge_stp off
bridge_fd 0
Correct this and try with a freshly created container.
 
I made two new containers - one using DHCP, the other one with a static IP. Both are giving me the same result: No internet connection. And they are seen on my router's control panel.
 
Can you access the local network? If so, then you need to check your router, if it allows the containers to reach the internet.
 
Check your local network configuration and/or firewalls.
 
  • Do a ping from your workstation to the PVE server -> works? -> yes.
  • Do a ping from your workstation to a container -> works? -> yes.
Then you can not access the internet and you need to check at your router.
  • Do a ping from your workstation to the PVE server -> works? -> no.
Check your network config on PVE and your workstation.
  • Do a ping from your workstation to a container -> works? -> no.
Check your network config on PVE and the container.

Most common are typos in the config. Ping is a good tool to find out if a host is reachable.
 
You have to install VirtualBox guest on your Proxmox VM and set your adapter type to virtio-net with promiscuous mode set to allow all. Your containers will now work as expected.

Edit: Your host shouldn't be connected via Wi-Fi, as your router may be blocking other MAC addresses.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!