Configuring Network Interfaces in Linux

Posted On 2014-10-05 by dwirch
Tags: Tutorial Networking Linux Commandline Linux
Views: 1582

For us Windows guys, managing Linux systems can be a pain in the butt. Some simple things, like setting or changing network configurations are performed a little differently on Linux systems. Don't let the command line intimidate you, Windows guys! Here are a few ways to manage network settings for Linux boxes that are pretty painless.

This isn't going to be an all-encompassing tutorial on configuration of network interfaces, and won't include things like teaming. It's just a basic intro to configuring an interface for Windows guys. So don't write me hate mail.

Method 1

As described here, IFConfig is used to not only to display current information on network interfaces, but also to configure them.

For example, to configure and interface named eth0 with an IP address of, and a subnet mask of, you would simply enter this command:

# ifconfig eth0 netmask

Method 2

If you have to have some sort of "GUI" you can use the Setup utility or NetConfig. Firing up either of these from a shell will get you text-mode menu-driven method of setting network interface parameters. Using this utilities is simply a friendly way of editing the interface configuration file, located at:


Simply type the word setup at a prompt, and you'll be presented with the main screen. Select Network Configuration, then Edit Devices, then the interface to edit (for example, eth0). Then edit the settings as needed. Save the changes and quit the utiliity.

Note that you'll have to restart the networking stack with this command:

# /etc/init.d/network restart

Method 3

You can also edit the files that configure your network interface directly. For Windows guys, this is akin to editing the registry settings for an interface under: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

First, you'll have to change to the correct directory:

# cd /etc/sysconfig/network-scripts/

I like to use the vi text editor to edit files on a Linux system, and this example will utilize vi. Call me old school. You can use Nano or some other editor if you like.

# vi ifcfg-eth0

Append/modify as follows:

# Intel Corporation 82540EM Gigabit Ethernet Controller

Save and close the file. Define default gateway and hostname in /etc/sysconfig/network configuration file:

# vi /etc/sysconfig/network

Append/modify configuration as follows:


Save and close the file, then restart the networking services:

# /etc/init.d/network restart


And there you have it, three methods of changing the network configuration on just about any Linux system, with using a graphical user interface. Working with Linux is pretty easy, once you learn the basic ins-and-outs of how it works. Becoming a Linux administrator as well as a Windows administrator will help in broadening your toolset and make you more well rounded, and thus more attractive to potential employers, or maybe get you a raise at your current employer.

About the Author

has posted a total of 192 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links