host IP to LXC container

Readbook1

New Member
Oct 29, 2020
2
0
1
39
Hi!

I have several white IP getting from IPS.
Host setup:
Code:
root@pve:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug enp0s31f6

auto vmbr0
iface vmbr0 inet dhcp
        bridge_ports enp0s31f6
        bridge_stp off
        bridge_fd 0

My host get's IP and several LXC contaner gets their IP via vmbr0 bridge.

How can I provide host IP to one LXC for network?
I'll try add this section to /etc/network/interfaces
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

but after
Code:
systemctl restart networking
I lost ping to all existing LCX.
What I am doing wrong?
 
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!