Proxmox and LXC with separate public ip addresses

AxAn

Member
Jan 15, 2020
25
5
8
44
I'm trying to setup Proxmox, with a container (LXC) using 2 public ip's on a cloud-based server. One ip for Proxmox and one ip for the container.
Proxmox is working fine but I can't get the container to access the internet.
I have tried many things but this is my current setup:

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto ens1
iface ens1 inet static
        address 111.111.111.7/24
        gateway 111.111.111.1

auto vmbr0
iface vmbr0 inet static
        address 111.111.111.218/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

In the container .conf file:
Code:
net0: name=eth0,bridge=vmbr0,gw=111.111.111.7,hwaddr=xxxxxxxx,ip=111.111.111.218/24,type=veth

111.111.111.7 is Proxmox.
111.111.111.128 is what I'm trying to get to work with the container.

Can someone see what the problem is?
 
Last edited:
iface vmbr0 inet static address 111.111.111.218/24 bridge-ports none bridge-stp off bridge-fd 0
This assigns 111.111.111.218 to the Proxmox host on vmbr0 and that's not what you want. Don't set an address (for Proxmox) on vmbr0 instead but assign 111.111.111.218/24 to the container in the container network configuration.

How do you intent to route traffic between vmbr0 and the internet? You do not provide a gateway nor any bridge-ports, which prevents traffic from and to the internet.
auto lo iface lo inet loopback auto ens1 iface ens1 inet static auto vmbr0 iface vmbr0 inet static address 111.111.111.7/24 gateway 111.111.111.1 bridge-ports ens1 bridge-stp off bridge-fd 0
This in combination with setting the container IP address in the container Network settings to 111.111.111.218 will probably work. Please note that this part of the forum specializes in network configurations.
 
This assigns 111.111.111.218 to the Proxmox host on vmbr0 and that's not what you want. Don't set an address (for Proxmox) on vmbr0 instead but assign 111.111.111.218/24 to the container in the container network configuration.

How do you intent to route traffic between vmbr0 and the internet? You do not provide a gateway nor any bridge-ports, which prevents traffic from and to the internet.
auto lo iface lo inet loopback auto ens1 iface ens1 inet static auto vmbr0 iface vmbr0 inet static address 111.111.111.7/24 gateway 111.111.111.1 bridge-ports ens1 bridge-stp off bridge-fd 0
This in combination with setting the container IP address in the container Network settings to 111.111.111.218 will probably work. Please note that this part of the forum specializes in network configurations.

What you suggested is what I tried to begin with, which did not work. Then I saw a guide (https://pve.proxmox.com/wiki/Network_Configuration Routed Configuration) and ended up with the above config.
I tried it again, but still does not work:

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto ens1
iface ens1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 111.111.111.7/24
        gateway 111.111.111.1
        bridge-ports ens1
        bridge-stp off
        bridge-fd 0

Container:
Code:
net0: name=eth0,bridge=vmbr0,hwaddr=2A:BD:E2:B6:7C:CE,ip=111.111.111.218/24,type=veth

I should probably post this in the correct part of the forum instead.
 

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!