Spiegato, Home

Technology and Gadgets

How do I Configure a Network Card with Linux®?

  • Published by Spiegato
  • 2 min read

Setting up a network card with Linux® is often done automatically through the hardware detection software that comes with most modern Linux® distributions. There may be occasions, however, when the network card isn’t automatically configured properly, or when you want to configure a second network card with Linux®. In any case, there are a couple primary means to work with the network card’s configuration, either by way of a graphical user interface (GUI) or the command line interface (CLI).

Using your Linux® distribution’s GUI will provide the most user-friendly and straightforward means for configuring your network card with Linux®. This may vary, however, depending on the Linux® desktop environment for your distribution. In most cases, Linux® distributions will use either the Gnome® or K Desktop Environment (KDE®) desktop environments, each of which has a software GUI for configuring your network. The KNetworkManager software does this work for the KDE® desktop, while in Gnome® it is called NetworkManager. Both offer the ability to configure an already detected network card with network parameters, IP address information, as well as add a new network card.

Working from the CLI to setup your network card with Linux®, however, you’ll first want to discover whether your network card is already up and running by issuing the ifconfig command in the terminal application. If the command is entered without any arguments, it will output all of the current interfaces and their settings. The two most common are eth0, which is the first Ethernet network card on the system, and lo, the loopback interface, which is a virtual software interface. The ifconfig command can then be used to enable or disable an interface as well as change the IP address or other network information. For example, to set the eth0 interface IP address, you would issue the following ifconfig command.

ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up

In order from left to right, the first parameter is the interface to modify, eth0, then the IP address to assign to it, and then the subnetwork that the computer belongs to. The final parameter given to ifconfig is either “up” or “down,” which tells the computer to enable or disable the network card. Be sure to check the appropriate settings for your network, such as the type of network, the subnetwork, any gateway routers to compose the proper command.

Of course, this command will only configure your network card with Linux® for the current session and would need to be entered after every time you log in on the computer. To work around this, Linux® distributions implement various scripts and files that will do this for you automatically every time the computer starts up. The locations and names of these scripts and configuration files will vary according to your Linux® distribution, so be sure to check it for which files to modify. By editing these configuration files in a text editor, the operating system will then load the appropriate network configuration automatically.

Key terms in this article

Related articles

  • What is a Network Configuration?

    A network configuration is the overall design of some type of communications network. As part of this configuration, both software and hardware are…

  • What are Network Card Drivers?

    Network card drivers are a type of computer file that allow a computer’s operating system (OS) to properly recognize and interact with an installed…

  • What is a Network Controller Card?

    A network controller card is an internal or external piece of computer hardware engineered to establish and maintain a continuous connection to either a…

  • How do I Replace a Network Card?

    The steps taken to replace a network card may vary depending on the manufacturer of the network card, and whenever possible the specific instructions…

  • What is an Integrated Network Card?

    An integrated network card is an internal computer component that gives the machine the ability to connect to a network. The component might be designed…