How to Manage Network Interfaces on AlmaLinux 9

Managing network interfaces on AlmaLinux 9 is essential for configuring networking settings on your system.

To manage network interfaces, follow these steps:

Step 1: Use the ip Command

The ip command is a powerful tool for managing network interfaces. To display the current network configuration, use:

For a more concise output, you can use the shorthand command:

Step 2: Bring Down and Up a Specific Interface

To deactivate and reactivate a network interface (e.g., enp0s3), use:

Alternatively, you can use the deprecated ifconfig command. However, it is recommended to use ip for modern Linux distributions.

Step 3: Use the ifconfig Command

While ifconfig is still available, it is considered legacy. To display interface information, run:

For a quick overview of all interfaces, you can use the following command:

Step 4: Restart a Specific Interface

To restart a network interface using ifconfig (e.g., enp0s3), you can run:

Conclusion

By following these steps, you can effectively manage network interfaces on AlmaLinux 9 using either the modern ip command or the traditional ifconfig command.