Software & AppsOperating SystemLinux

Fixing “A start job is running for wait for network to be configured” error in Ubuntu Server 20.04

ubuntu 2

In this article, we will be addressing a common issue encountered by many Ubuntu Server 20.04 users – the “A start job is running for wait for network to be configured” error. This error typically arises due to misconfiguration in the netplan configuration file.

Quick Answer

To fix the "A start job is running for wait for network to be configured" error in Ubuntu Server 20.04, you need to open the netplan configuration file, choose the appropriate network configuration (DHCP or static IP), save the changes, generate and apply the netplan configuration, and reboot your system.

What is Netplan?

Netplan is a utility for easily configuring networking on a Linux system. You simply create a YAML description of the required network interfaces and what each should be configured to do. From this description, Netplan will generate all the necessary configuration for your chosen renderer tool.

Understanding the Error

The error “A start job is running for wait for network to be configured” is usually indicative of a problem with the network configuration. In Ubuntu Server 20.04, the ‘optional’ key is not recognized in the netplan configuration file. This means that the previous post’s answer is not relevant for Ubuntu 20.04.

Steps to Fix the Error

Step 1: Open the Netplan Configuration File

The first step is to open the netplan configuration file using a text editor. The file is typically located at /etc/netplan/01-netcfg.yaml.

Step 2: Check the Contents of the File

You can check the contents of the file by running the command cat /etc/netplan/01-netcfg.yaml. If the file is empty, you need to create it and add the necessary configuration.

Step 3: Choose the Right Configuration

Based on your requirements, you need to choose either the DHCP or static IP configuration.

For DHCP, use the following configuration:

network:
 version: 2
 renderer: networkd
 ethernets:
 enp0s3:
 dhcp4: true

For static IP (bridged network), use the following configuration:

network:
 version: 2
 renderer: networkd
 ethernets:
 enp0s3:
 addresses:
 - 192.168.x.xxx/24
 gateway4: 192.168.x.1
 nameservers:
 search: [mydomain, otherdomain]
 addresses: [8.8.8.8, 8.8.4.4]

In both configurations, replace enp0s3 with the appropriate interface name for your system.

Step 4: Save the Changes

After you’ve made the necessary changes, save the netplan configuration file.

Step 5: Generate and Apply the Netplan Configuration

Next, generate and apply the netplan configuration by running the following commands:

sudo netplan generate
sudo netplan apply

The sudo netplan generate command is used to generate the configuration files, and the sudo netplan apply command is used to apply the changes made in the configuration file.

Step 6: Reboot Your System

Finally, reboot your system to apply the changes.

Conclusion

This should resolve the “wait for network to be configured” issue. If you have multiple network interfaces and want to mark one as optional, you can add the optional: true line to the respective interface in the netplan configuration.

Remember to replace the placeholder values (e.g., 192.168.x.xxx) with the actual IP address and adjust the configuration according to your network setup.

By following these steps, you should be able to resolve the “A start job is running for wait for network to be configured” error in Ubuntu Server 20.04. If you encounter any issues, refer to the official Ubuntu documentation for more information.

How do I open the netplan configuration file?

You can open the netplan configuration file by using a text editor such as nano or vim. For example, you can use the command sudo nano /etc/netplan/01-netcfg.yaml to open the file with the nano editor.

What should I do if the netplan configuration file is empty?

If the netplan configuration file is empty, you need to create it and add the necessary configuration. You can use the command sudo nano /etc/netplan/01-netcfg.yaml to create and open the file in the nano editor, and then add the appropriate configuration as mentioned in the article.

How do I find the appropriate interface name for my system?

You can find the appropriate interface name for your system by running the command ip addr show or ifconfig -a in the terminal. Look for the interface that matches your network configuration, such as enp0s3 or eth0.

Can I have multiple network interfaces with different configurations?

Yes, you can have multiple network interfaces with different configurations. Simply add the respective interface names and their configurations in the netplan configuration file. Each interface should have its own set of configuration parameters, such as IP address, gateway, and DNS servers.

How can I mark a network interface as optional?

To mark a network interface as optional, you can add the line optional: true under the respective interface in the netplan configuration file. This allows the system to continue booting even if the optional interface is not available.

What should I do if I encounter any issues after applying the netplan configuration changes?

If you encounter any issues after applying the netplan configuration changes, you can try reverting back to the previous configuration by opening the netplan configuration file and removing or modifying the problematic lines. Alternatively, you can seek assistance from the official Ubuntu documentation or community forums for further troubleshooting.

Leave a Comment

Your email address will not be published. Required fields are marked *