Can I Enable Dhcp4 on All Interfaces Globally Without Knowing the Interface Names with Netplan and Networkd?

Can I enable DHCP4on all interfaces globally without knowing the interface names with netplan? I might add any USB connected ethernet NIC, and I just want any of them to get the network config via DHCP4. I know it works with NetworkManager. But I would rather use the networkd renderer.

4

1 Answer

It is possible to enable wifi on an interface without knowing the exact interface name by using the match syntax:

network:
  version: 2
  renderer: networkd
  ethernets:
    alleths:
      match:
        name: en*
      dhcp4: true

Be sure to avoid any settings that would collide between multiple interfaces (and do not use set-name).

2

Your Answer

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

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest