1

How to automatically generate a netplan .yaml file?

Repurposing an old laptop for Ubuntu test server. No Ethernet port.

Installed Ubuntu server from thumb drive then searched for *deb packages to make WiFi work, copied them to thumb drive and installed. WiFi works. Have connectivity.

Have gotten USB Ethernet dongle so don't need to run WiFi. When connected the dongle has link and activity light however ip -br a shows the Ethernet interface down and no IP address. ip -br a

Am in very early stages of experimenting with the server. Even so would prefer not to start install again just to get a netplan .yaml for the Ethernet dongle.

What I would like to learn is how to "automatically" generate a .yaml file. Similar to what happens during install, how to generate a .yaml that includes the Ethernet dongle?

Any suggestions where to look or good search fu to find the information?

All searches I've tried with terms "netplan generate yaml" or "netplan create yaml" or variations lead me back to the netplan generate... command which seems is definitely NOT what I'm looking for.

p.s. I've confirmed the USB Ethernet is detected and handled properly by booting the laptop from a thumb drive with Ubuntu desktop 22.04. The Ethernet dongle is detected and gets a DHCP address. The WiFi is not detected, still need those separate .debs.

p.p.s. The netplan .yaml generated by the 22.04 desktop boot is simple...

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Suggestions how to make Ubuntu create/modify the existing netplan .yaml to incorporate the USB Ethernet dongle?

Yes, I can edit it. But I'd like to figure out how to make Ubuntu do the work.

2
  • Since the dongle can be unplugged --intentionally or not-- NetworkManager seems the appropriate tool for your use case.
    – user535733
    Jul 12, 2022 at 2:49
  • Using networkmanager does not address the question of how to generate a new netplan .yaml file. Aside from my USB Ethernet situation, any host that an additional Ethernet is installed on would need a new or modified netplan .yaml for the new Ehternet.
    – Alan
    Jul 16, 2022 at 19:49

0

You must log in to answer this question.

Browse other questions tagged .