[SOLVED] Route network with LXC

stephane_c

New Member
Sep 18, 2015
8
3
1
Hello,
I test the new version of Proxmox, and I want to migrate all my KVM to LXC containers.

I have two network on the proxmox serveur :
VMBR0 bridged on eth0
VMBR2 bridged, with IP : 192.168.2.1.


Actually, with proxmox 3, I have iptables on proxmox and routing for all my internals VMs :
On proxmox : "/sbin/iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o vmbr0 -j MASQUERADE"
Network on KVM :
Code:
auto eth0
iface eth0 inet static
        address 192.168.2.2
        broadcast 192.168.2.2
        post-up route add PROXMOX_IP dev eth0
        post-up route add default gw PROXMOX_IP
        post-down route del PROXMOX_IP dev eth0
        post-down route del default gw PROXMOX_IP

So, my kvm have an internal IP and can access to internet.

I search the same work, but with LXC containers. If I create a container with the vmbr2 network, I can't route the traffic to internet. The container can ping the internal IP PROXMOX (192.168.2.1) but not public IP.

Can anyone help me ?


EDIT :
Just forget to uncomment the "net.ipv4.ip_forward=1" in /etc/sysctl.conf ...

Thank,
Stephane
 
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!