3

We have lots of different servers with different network cards, is there a way to have Ubuntu 20.04 automatically configure the network cards with DHCP? Right now we have to manually change the .yaml file everytime we install a new network card. It would be nice if Ubuntu could just recognize the new networks cards on bootup.

Here is more information, we have an Ubuntu 20.04 image which we install on new servers, is there a way to configure the Ubuntu image to automatically configure the network card so we don't have to manually go into the netplan .yaml file and change the network card name?

Thanks

Will
  • 2,292
Russ
  • 39
  • DHCP network configuration is already the default setting for a newly-installed Ubuntu Server. Are you using some non-standard install method or customized image? – user535733 Nov 05 '21 at 16:37

2 Answers2

5

If you want a generic netplan config then you can try something like the following. It will match all physical wired network cards and use DHCP to configure them.

network:
    version: 2
    ethernets:
        zz-all-en:
            match:
                name: "en*"
            dhcp4: true
        zz-all-eth:
            match:
                name: "eth*"
            dhcp4: true

I am copying this configuration directly from the current server installer configuration.

Links

0

You could use systemd-networkd with a file that "matches" every card in /etc/systemd/network/10-adapter.network. Take a look at this.

an empty [Match] section means the profile will apply in any case (can be compared to the * wildcard)