Score:0

Unmanaged vlan bridges

mr flag

I am trying to add a few unmanaged bridges to LXD. I have 2 NIC's on the server, one is the main Lan for the server and it's own services and the other is meant to be used by LXD exclusively. I want that additional NIC to have a bridge to 3 vlans, one of which is untagged. Creating a bridge for the untagged vlan was easy enough using the below config:

network:
  version: 2

  ethernets:
    enp5s0:
      dhcp4: true
      dhcp6: no

    enx0s0:
      match:
        macaddress: 00:e0:4c:02:61:57
      set-name: enx0s0

  bridges:
    lxdbr1:
      interfaces:
        - enx0s0
      parameters:
        stp: true
        forward-delay: 4
      dhcp4: no
      dhcp6: no

Creating the tagged networks seams to be more difficult. I thought that I could simply add a vlan tag in the container configuration:

devices:
  enp1s0:
    nictype: bridged
    parent: lxdbr1
    type: nic
    vlan: "32"

:

sudo ip link set lxdbr1 type bridge vlan_filtering 1

This did however not work. So I tried creating a bridge over a vlan.

  bridges:
    lxdbr1:
      interfaces:
        - enx0s0.32
      parameters:
        stp: true
        forward-delay: 4
      dhcp4: no
      dhcp6: no

  vlans:
    enx0s0.32:
      accept-ra: no
      id: 32
      link: enx0s0

But unlike my first untagged bridge, this had the same result as adding vlan to the container configuration. It does not work.

I have made a lot of different attempts based on various sources, but I cannot get any vlan connection work.

ec flag
**Welcome to the Ask Ubuntu community.** Glad to hear that you've managed to answer your own question. For completeness, can you please mark this question as answered (details here: https://askubuntu.com/help/self-answer). Thanks
Score:0
mr flag

Damn. This is why you don't work at 2AM. Your eyes can't focus properly. I used the wrong vlan id. 32 should have been 36. The other one does exist, but DHCP is disabled on that one. Of cause it's when you give up and post for help, that you find the problem 2 minutes later.

EDIT:

Seams to be one issue though. Outgoing is working fine. It can get IP assigned from DHCP and connect out through the vlan bridge, but nothing can connect in. So, I can ping other computers on the network from the bridge, but other computers cannot ping whatever is connected to the vlan bridge. This is the same whether I use the bridge on Docker or LXD.

EDIT:

Seams to be Docker creating issues. Stopping Docker service fixes everything. Think I need a new question for this: Add unmanaged bridge to Docker

Pilot6 avatar
cn flag
Is it an answer to your question?
Denny avatar
mr flag
It's a way for others with similar problems, to locate the possible solution, continuing elsewhere.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.