adding an LXC with a different subnet

krikey

Renowned Member
Aug 15, 2018
142
30
68
UK
I have PVE 8.2.x running with the following configuration:

Code:
iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address x.x.x.13/24
        gateway x.x.x.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

I'd like my LXC to use y.y.y.63/24, gateway y.y.y.1

The gateway is upstream and not within my control.

I've tried adding the following to PVE but still not able to reach the WAN from the LXC

Code:
iptables -t nat -A POSTROUTING -s y.y.y.63/24 -o vmbr0 -j MASQUERADE

Here's the .conf file for the LXC

Code:
arch: amd64
cores: 1
features: nesting=1
hostname: test
memory: 512
net0: name=eth0,bridge=vmbr0,gw=y.y.y.1,hwaddr=11:22:33:44:55:66,ip=y.y.y.63/24,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-100-disk-0,size=8G
swap: 512
unprivileged: 1

Can anyone assist with this?
 
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!