Run LXC container in separate VLAN

I want to run my LXC container in separate subnet. I was able to setup LXC container with info found in this forum. I was able to parialy setup networking as well. Now my virtual server is able to to communicate to the internet, but I am not able to communicate from the virtual server to turris itself e.g. for DNS and/or DHCP.

I believe I am facing this issue OpenWRT forum when bridge containing “parent” interface is eating all frames including tagged one.

Please can somebody help me with setup of my LXC containers so all network communication is working fine (and can be controlled via iptables)

[turris omnia]/etc/config/network
---------------------------------------------------------
config interface 'lan'
        option type 'bridge'
        option ifname 'eth0 eth2'
        option proto 'static'
        option ipaddr '192.168.42.254'
        option netmask '255.255.255.0'
        option force_link '1'
        option ip6assign '60'

config interface 'sWiki'
        option type 'bridge'
        option ifname 'eth0.10'
        option proto 'static'
        option ipaddr '192.168.24.2'
        option netmask '255.255.255.252'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option vid '1'
        option ports '0 1 2 3 5' #lan.1

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option vid '2'
        option ports '4 6' #lan.2

config switch_vlan
        option device 'switch0'
        option vlan '10'
        option vid '10'
        option ports '5t' #sWiki

[turris omnia]/srv/lxc/wiki/config
---------------------------------------------------------
# Network configuration
lxc.network.type = veth
lxc.network.link = br-sWiki
lxc.network.flags = up
lxc.network.name = eth0.10
lxc.network.ipv4 = 192.168.24.1/30
lxc.network.ipv4.gateway = 192.168.24.2
lxc.network.script.up = /usr/share/lxc/hooks/tx-off
lxc.network.hwaddr = da:de:00:24:00:01

[LXC wiki]/etc/network/interfaces
---------------------------------------------------------
auto eth0.10
iface eth0.10 inet manual
hostname $(hostname)
1 Like

Everything works fine for me now. However after so many trials and fails (sigh) I am not able to say what exactly was wrong and how I managed to fix it.

1 Like