Having trouble with docker container VLANs on a VM with a different VLAN

littleblue50

New Member
Mar 8, 2024
1
0
1
So I've been struggling with this the past few days and any help would be greatly appreciated.

I have my proxmox server on VLAN 10 and a bunch of LXCs and VMs on a variety of VLANs with no issues. I also have an Ubuntu VM to host my docker containers, with the network device using the vmbr0 bridge and also tagged with VLAN 10 in proxmox. This far has no issues.

I want to run a docker container on this VM in VLAN 30 and have set up a macvlan on ens18.30@ens18 using

Code:
docker network create -d macvlan --subnet=10.0.30.0/24 --gateway=10.0.30.1 -o parent=ens18.30 vlan30

in my docker-compose I am using

Code:
networks:
  vlan30:
    name: vlan30
    external: true
services:
  ...
    networks:
      vlan30:
        ipv4_address: 10.0.30.20

The problem is when I bring it up, it cant ping out from the container and the container cant be pinged or connected to in this state, though checking ip addr does show the container thinks it is using the right interface. However, if I remove the VLAN tag from the docker VM for testing in an "allow all" rule, the docker container does then send out its traffic and is connectable on the right VLAN.

I've been pulling my hair out for a couple of days with this and got nowhere. Any advice on what I've missed? There is an LXC on VLAN 30 on the proxmox box which is working fine so it doesn't seem to be firewall rules for the VLAN itself
 

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!