1

In sort of a unique position here...maybe. I know how to add vlans to existing netplan configs when the default is say, 192.168.1.1 (untagged)...but what about the reverse?

My netplan config:

network:
  version: 2
  renderer: networkd
  ethernets:
    #eno1:
    ens3f0:
      dhcp4: no
      addresses: [192.168.4.2/29]
      gateway4: 192.168.4.1
      nameservers:
              addresses: [1.1.1.1]

I'm using a mikrotik switch, and it's configured to allow VLAN 1 and 4 on the port. enter image description here

I'm also setting vlan 4 (the vlan for kubernetes, as the default vlan ID: enter image description here

Since this is the default vlan ID, I do not have to tag the traffic coming out of the port with vlan 4, it the switch does it. my question is, if I now want to add an additional IP using netplan, would I create a vlan in netplan with the id 1? like this?

vlans:
      vlan.1:
          id: 1
          link: ens3f0
          dhcp4: no
          addressses: [192.168.1.x/24]

I've never done this in reverse. Also, I read here: how to use Ubuntu 18.04 (netplan) with a VLan that it seems I need to add a bridge, is this true? It seems to work, as when I do a netplan apply, i get the following:

vlan.1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.200  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::56ab:3aff:fe09:8c95  prefixlen 64  scopeid 0x20<link>
        ether 54:ab:3a:09:8c:95  txqueuelen 1000  (Ethernet)
        RX packets 97693  bytes 11189422 (11.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 184138  bytes 67563509 (67.5 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

When I try applying this config, everything seems to work, except my BGP data doesn't seem to work (BGP now goes over the 192.168.1.200 ip instead of the original 192.168.4.2 ip. Is a Bridge required, and do I need to add a vlan block for vlan 4, even if it's the default vlan on the port? Thanks!

Evan R.
  • 111

0 Answers0