Installation inside a LXC container

I'm struggling trying to get vlans working on a Openwrt box inside a LXC container.
Does anyone running such configuration post his LXC network profile and his OWRT network config or give me some useful guide/link to follow?

Many thanks

You should say what you did, and what's the problem you encountered.

I did run OpenWrt under PiMox 7 (ARM64) LXC which works, but I know my setup has issue with IPv6 which I don't have time to troubleshoot at the moment. I have not yet tested VLAN, but I believe most issues with LXC are related to permissions.

Currently my setup is:
provider's modem
Openrt box:

  • wan
  • vlan home 192.168.20.X
  • vlan guest 192.168.30.X
    Tp-link managed switch
  • port 1 (OpenWRT) and 2 (dumb AP) tagged 20/30
  • port 3 untagged connected to a
    server hosting services jailed in LXC containers
    My goal is to save a device adding an Openwrt LXC container hosted by the server.
    Since Openwrt box now provides dhcp, dns, firewall.. i don't know if it is possible or recommended move it from the edge to the heart of the network, but in any case I'm facing a lot of issues on the path.
  1. how to set the managed switch? If I connect the server to a tagged 20/30 port it becomes unreachable, I have to route the traffic inside the server? How?
  2. I have to setup vlans in LXC profile then attach the Openwrt guest image, or can I manage vlans directly into Openwrt?

Because of my poor knowledge I don't know where to start over so I asked for a working setup or some useful link to avoid bothering the forum with my (unrealistic???) idea.

My kind regards

How did you setup your LXC? Setting under LXC without root privilege is usually more difficult than setting up under VM.

Also, did you start without VLAN first? Mixing up everything together would make the problem difficult to handle, you should make sure that it works without VLAN before moving on.

LXC container has root privilege.
My Fujitsu Futro comes with 2 ethernet ports.
The wan port is connected to the provider's modem, the lan port is connected to the TP-Link smart managed switch.
I got no problem running OpenWRT with this simple wan/lan setup.
But VLANs are a whole different story.


To be more specific...
Currently my eth0 (lan) is a macvlan attached to main bridge, my eth1 (wan) is a macvlan device attached to the nic.