How to customize network config for LXC? (except using the PVE GUI)

Tony

Renowned Member
Nov 4, 2010
113
10
83
Hi,

I am trying to setup a LXC with a public IP on a node hosted at Hetzner. The network config is somewhat different from the standard way.

My setup is done following this link: Proxmox on Debian at Hetzner with multiple IP addresses – blog.no-panic.at (no-panic.at)

It works fine for a KVM VM, but for a LXC I don't know how to apply the following config to a CT:
Code:
auto eth0
iface eth0 inet static
    address <ONE OF YOUR SUBNET'S IPs>
    netmask 255.255.255.255
    dns-nameservers 213.133.100.100 213.133.98.98 213.133.99.99
    post-up ip route add <YOUR MAIN IP> dev eth0
    post-up ip route add default via <YOUR MAIN IP> dev eth0
    pre-down ip route del default via <YOUR MAIN IP> dev eth0
    pre-down ip route del <YOUR MAIN IP> dev eth0


Any hint please?
 
  1. The blog post you linked has a specific section talking about how to set up container networking, it makes so mention of the snippet you provided
  2. If you're set on using the snippet, you should be able to just configure it in /etc/network/interfaces within your container
 
  • Like
Reactions: selecter and Tony
thank you for your reply. Indeed I missed the section about container settings in the article and solved it by editing /etc/network/interfaces inside the container. Which seems to work, albeit not the best way to do that.
 

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!