Score:1

Automatic network card configuration?

us flag

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

user535733 avatar
cn flag
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?
Score:1
jp flag

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

Score:0
pk flag

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)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.