How to configure 802.1ad (VLAN) tagging in Ubuntu 18.04

Asked by Edwin Mallette

With the Netplan changes I am struggling to configure my VLAN tag such that it tags the appropriate value of an S-Tag (802.1AD).
network:
    version: 2
    renderer: networkd
    ethernets:
        eno1:
            dhcp4: false
    vlans:
        vlan.4090:
            id: 4090
            link: eno1
            dhcp4: no
    bridges:
        br4090:
            dhcp4: false
            interfaces:
               - vlan.4090

As I couldn't figure out a way to set the VLAN protocol type in Netplan I used ip link set...
ip -d link show vlan.4090
7: vlan.4090@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br4090 state UP mode DEFAULT group default qlen 1000
    link/ether 94:c6:91:ae:70:c0 brd ff:ff:ff:ff:ff:ff promiscuity 1
    vlan protocol 802.1Q id 4090 <REORDER_HDR>

This is before I issue the command to set the protocol.

sudo ip link set vlan.4090 type vlan 4090 proto 802.1ad
7: vlan.4090@eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br4090 state UP mode DEFAULT group default qlen 1000
    link/ether 94:c6:91:ae:70:c0 brd ff:ff:ff:ff:ff:ff promiscuity 1
    vlan protocol 802.1Q id 4090 <REORDER_HDR>

I verified that other changes I make are appropriately reflected - such as I disabled reorder header, as an example. Any help or guidance would be appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Edwin Mallette
Solved:
Last query:
Last reply:
Revision history for this message
Edwin Mallette (edwin.mallette) said :
#1

I figured out what I was doing wrong...

Since I had the VLAN interface I was interested in setting as 802.1AD managed in Netplan I was (for some reason) unable to change the tagging protocol. Once I deleted the vlan interface from the netplan YAML file I was able to create the link and attach it to the bridge as I desired. This is volatile - but I knew that even if I was able to make the adjustment using the ip link set commands it was always going to be volatile.

I guess I will add the commands to the startup script...

sudo ip link add link eno1 name s4090
sudo ip link set s4090 type vlan id 4090 proto 802.1ad
sudo ip link set s4090 up
brctl addif br4090 s4090