[SOLVED] LXC containers on their own virtual network.

Dnezar

New Member
Jul 5, 2024
8
0
1
Hello,

is it possible to connect my LXC containers to a virtual network outside of my LAN?
Is it possible that only some of them can be accessed on the LAN as well as on the virtual network?
And if so, can someone explain me how to access them through a reverse proxy only?

Thank you.
 
Last edited:
Hello,

Yes, just create a new Linux Bridge with empty Bridge Port setting and use it for network interface in LXC.
Yes, just assign two network interfaces to the LXC, one to the virtual, one to the real LAN.
Reverse Proxy with two interfaces, one to LAN, one to internal (virtual) network, LXC need interface on the same internal network.
 
  • Like
Reactions: Dnezar


Assume your Homelab Lan/Network is 192.168.1.0/24.

Your Uplink Wifi-Router is connected to your Modem and has the IP 192.168.1.1/24

The Proxmox Host is connected to your Wifi-Router via a single Ethernet Port.

You have your Proxmox Webgui connected to your vmbr0 Bridge on 192.168.1.10/24.
The vmbr0 Bridge is connected to the single Ethernet Nic, for example eno0.

So assume your LXC Client is connected to vmbr0 and is given the IPv4 192.168.1.25/24.

A Linux Bridge (for example vmbr0) is in fact a virtual Switch.

Your Laptop is having 192.168.1.130/24.

All 3 Devices can receive Pings and can be accesses via Port 22/ssh as they are on the same subnet.
 
Last edited:
  • Like
Reactions: Dnezar
Assume your Homelab Lan/Network is 192.168.1.0/24.

Your Uplink Wifi-Router is connected to your Modem and has the IP 192.168.1.1/24

The Proxmox Host is connected to your Wifi-Router via a single Ethernet Port.

You have your Proxmox Wegui connected to your vmbr0 Bridge on 192.168.1.10/24.
The vmbr0 Bridge is connected to the single Ethernet Nic, for example eno0.

So assume your LXC Client is connected to vmbr0 and is given the IPv4 192.168.1.25/24.

A Linux Bridge (for example vmbr0) is in fact a virtual Switch.

Your Laptop is havin 192.168.1.130/24.

All 3 Devices can receive Pings and can be accesses via Port 22/ssh as they are on the same subnet.
Thank you.
So I just create a vmbr1 without a gateway and connect containers to that bridge giving them static IP's.
The one I want connected to the LAN too, I connect to both vmbr0 and vmbr1 then?
 
Thank you.
So I just create a vmbr1 without a gateway and connect containers to that bridge giving them static IP's.
The one I want connected to the LAN too, I connect to both vmbr0 and vmbr1 then?

Yep, for example.

The Systems on vmbr1 will be disconnected from your LAN.

The system which will be connected to vmbr0 and vmbr1 will do some kind of routing. i guess.
 
  • Like
Reactions: Dnezar

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!