0

I have a kvm server that has several vlans on it, and I want to create a bridge for each vlan. Putting together docs from several sites, I've come up with something that sometimes works, and sometimes doesn't. The other thing I need is for br212 (see below) to come up with an IP address. Sometimes it works, sometimes is does not. This is a shortened version, as the actual version has over 30 bridges and vlans.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      dhcp4: no

  bridges:
# 10.66.12.0/22 - dev
    br212:
      interfaces: [vlan212]
      macaddress: "11:22:33:44:55:66"
      dhcp4: true

# 10.5.0.0/16 - cert
    br105:
      interfaces: [vlan105]
      dhcp4: no

# 172.16.0.0/16 - sandbox
    br16:
      interfaces: [vlan16]
      dhcp4: no

# 10.66.6.0/24 - logging
    br206:
      interfaces: [vlan206]
      dhcp4: no

  vlans:
    vlan105:
      accept-ra: no
      id: 105
      link: eno2

    vlan16:
      accept-ra: no
      id: 16
      link: eno2    

    vlan206:
      accept-ra: no
      id: 206
      link: eno2

    vlan212:
      accept-ra: no
      id: 212
      link: eno2
0

Your .yaml file has extra space characters in it. .yaml files are very fussy about indents, spacing, and no tabs. You also didn't include your en02: code. Try this skeleton, and see if it works for you.

network: 
  version: 2
  renderer: networkd
  ethernets: 
    eno1: 
      optional: true
    en02: 
      match: 
        macaddress: "11:22:33:44:55:66"
      optional: true
  bridges: 
    br212: 
      interfaces: [vlan212]
      dhcp4: true
  vlans: 
    vlan212: 
      accept-ra: no
      id: 212
      link: eno2
  • So I actually want to specify the mac address for the 212 bridge, otherwise, I can't get a predictable dhcp address. As for spaces, that's probably a cut and paste victim. – rory toma Apr 1 at 21:40
  • @rorytoma As far as I can make out... the macaddress "selects a subset of available physical devices by various hardware properties". That's why I placed it, with associated "match" into the en02 definition. Why don't you set the proper MAC address, and try my skeleton script the way it is, and see what happens. – heynnema Apr 1 at 22:24
  • @rorytoma status please... – heynnema Apr 3 at 2:53
0

OK, I have solved this. Step 1 - make sure your network gear is properly set for trunking and has a natively tagged vlan...

Step 2 - the file:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eno2:
      optional: true

  bridges:
# 10.66.12.0/22 - dev
    br212:
      interfaces: [vlan212]
      macaddress: "00:20:3e:42:0e:64"
      dhcp4: true

# 10.5.0.0/16 - cert
    br105:
      interfaces: [vlan105]
      dhcp4: no

# 172.16.0.0/16 - sandbox
    br16:
      interfaces: [vlan16]
      dhcp4: no

# 10.66.6.0/24 - logging
    br206:
      interfaces: [vlan206]
      dhcp4: no

# 10.66.8.0/22 - dev
    br208:
      interfaces: [vlan208]
      dhcp4: no

  vlans:
    vlan105:
      accept-ra: no
      id: 105
      link: eno2

    vlan16:
      accept-ra: no
      id: 16
      link: eno2

    vlan206:
      accept-ra: no
      id: 206
      link: eno2

    vlan208:
      accept-ra: no
      id: 208
      link: eno2

    vlan212:
      accept-ra: no
      id: 212
      link: eno2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.