Netplan giving headaches

I’m trying to wrap my head around the new netplan system on ubuntu server and am making progress. If you can (and if allowed) please submit your YAML files so we can compare and share how our setups are and how they work. I think if we compile a large database of examples we all can learn from unique situations. Here is my file:

network:
version: 2
ethernets:
enp4s0:
dhcp4: false
dhcp6: false
bridges:
br0:
interfaces: [enp4s0]
addresses: [10.56.57.169/24]
gateway4: 10.56.57.160
nameservers:
addresses: [1.1.1.1,1.0.0.1,8.8.8.8,8.8.4.4]
parameters:
stp: true
forward-delay: 4
dhcp4: false
dhcp6: false

so for my setup my server is running a single nic and has the address of 10.56.57.169/24 im also trying to set up virtual machines that should have their own ip addresses but still learning that part. So what examples do you guys have and want to share?

There are quite a few good examples at https://netplan.io/examples

If that’s sort of what you’re looking for.

1 Like

I’ve read them and it’s close but not quite my situation. I’m still surfing around looking for a good video on the subject.

I was setting up a guest vm the other week, and had minor problems. Mostly due to incorrect format/structure in my YAML config. Im new to netplan and YAML.

For my configuration, Setting up a tagged vlan and using DHCP to grab the address, as well as setting the dns:

If the vlan was .70, the dns was 10.200.0.1 and the domain was test.lab, and we wanted the address via dhcp, then:

network:
    version: 2
    ethernets:
      eno1:
        addresses: []
    vlans:
      vlan.70:
        id: 70
        link: eno1
        dhcp4: yes
        gateway4: 10.200.0.1
        nameservers:
          search: [ test.lab ]
          addresses: [ 10.200.0.1 ]

ok so does the host pc use the “70” nic or just a vm? Also would the host be getting ip from dhcp as well?

Hi @TheSirLogan.

The Host Machine has a trunked connection to the nic.
Thus all Tagged Vlans can pass through to the guests.

For this vm, vlan 70 was passed through from the host side (Host is proxmox).

And I have all my Machines (Host & Guests) using DHCP.
Addresses are statically mapped.

I know my setup is probably not the norm, but its what works well for me in my lab. :slight_smile:

I just need to look into ansible, and automate creating vm’s/lxc, and statically mapping them on my router/dns. Sorry unrelated extra info.

thats ok if i can find a soultion that works for me as well all the better lol