Score:0

Ubuntu VLAN configuration problems

cn flag

I've an Ubuntu box that is directly connecting to a port of firewall appliance running OPNSense. This port is running a DHCP on VLAN (say 10) and I need to configure the Ubuntu box to connect to it.

I tried several combination of code in Ubuntu's /etc/netplan/00-installer-config.yaml:

network:
  ethernets:
    eno1:
  version: 2
  vlans:
    vlan10:
      id: 10
      link: eno1
      dhcp4: yes
      routes:
        - to: default
          via: 192.168.10.1

But executing "netplan try" command always gives an error :

/etc/netplan/00-installer-config.yaml:3:10: Error in network definition: expected mapping (check indentation) eno1: 

I'm not sure what I need to write for "eno1" as I do not want any untagged interface on this port.

Any pointers would be appreciated!

rfm avatar
mk flag
rfm
That's a pretty garbled bit of yaml. I'd suggest looking at https://netplan.io/examples for what the netplan yaml defs look like; there are some specific examples for connecting to a VLAN.
Pankaj avatar
cn flag
My bad, the first line got indented out but I've fixed it and the code should read fine now. The examples in netplan do not give any instance where the interface is "tagged" only running on VLAN specific DHCP.
rfm avatar
mk flag
rfm
Looks like yaml doesn't like the eno1: label with no contents. I put "optional: true" there and netplan try would take it. Don't have a VLAN capable switch so I couldn't test if it actually worked.
rfm avatar
mk flag
rfm
I don't know how to ensure there's no untagged interface; what I'd try is dhcp4: no and set no addresses, then at least nothing should be sent through the bare interface.
Score:0
sr flag

Thanks RFM, adding "dhcp4: no" did the trick and VLAN is working now!

network:
  ethernets:
    eno1:
      dhcp4: no
  version: 2
  vlans:
    vlan10:
      id: 10
      link: eno1
      dhcp4: yes
      routes:
        - to: default
          via: 192.168.10.1
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.