LXC and NAT

bodhi.zazen

New Member
Feb 23, 2009
18
0
1
I suspect the user case where one has a limited number of ipv4 it is popular to have lxc clients on a private subnet such as 10.0.0.0/24

There does not seem to be any way to do this with the web interface, and documentation seems to be poor.

I am ab bit surprised as I am guessing this is a very very common user case.

Please consider :

1. Adding such support for both KVM and LXC guests on the web interface. Probably need to look at the firewall web interface too.

2. Adding documentation on how to make configuration changes on the host.
 
Thank you fro taking the time to answer.

Yes, I see that information, but it is very basic.

How do you configure the lcx guests or kvm guests to use NAT from the web interface ? The only option I see for LXC is to use a bridge?

If it needs to be configured on the command line in host and or guest it would help if there were additional instructions.

When I edit the lxc config file it gets re-written when I start the guest from the command line pvc start 100 , etc
 
Last edited:
OK, I got it working , but had to make some modifications to what was suggested on the Proxmox web page.

Added the following to /etc/network/interfaces (at the end AFTER vmbr0)

Code:
auto vmbr1
iface vmbr1 inet static
        address  10.10.10.1
        netmask  255.255.255.0
        bridge_ports none
        bridge_stp off
        bridge_fd 0

        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE

Then in the web interface use vmbr1 and set the gateway to 10.10.10.1
 
A whole VM just for routing ? any documentation on that with Proxmox ? no mention of any such thing in the Proxmox documentation.
 
Proxmox is an option for a virtualization platform. When picking it, I think it is assumed that there is basic knowledge about virtualization and/or containers, networking and so on.
The free version is a "bring your own experience to the table". There is also the option to require professional support.
 
I thought these were support forums. If you do not have a solution to offer, keep your arrogant comments to yourself.

Nobody knows everything and we all need help from time to time. Hope you get similar snide comments when you need help .
 

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!