Distributed Networks Home
DBWebApplications eWebProgrammer
prev next prev next
Course navigation
Lesson 6 Listing configuration interfaces
Objective Use ifconfig command to list all currently configured interfaces on system
How do I use the ifconfig command to list all currently configured interfaces on the system?
Now that you have seen which network interfaces are available on your system, you can learn how to configure them. To configure a TCP/IP network interface, you must program it with its IP address and netmask. The command for working with network interfaces under UNIX is ifconfig. The ifconfig command has three purposes: listing configured interfaces, bringing interfaces up and down, and setting the IP address and netmask.
Listing configured interfaces
If run with no arguments, ifconfig will list all currently configured interfaces on the system and basic status information about each interface.
Point to Point Protocol
listing vmo
Click the link above to examine the following output from a Linux machine, which shows a configured PPP interface.
Solaris

The Solaris version of this command is slightly less informative, and requires the option -a.
Click the View Code link below to view the example.
Solaris Commands
In this example, we see two configured interfaces. The first, lo0, is the loopback address; we can tell from its inet address of 127.0.0.1 and from the LOOPBACK flag shown.
The second, hme0, is an ethernet card with IP address 131.183.175.221, netmask ffffff00=255.255.255.0, and MTU 1500. (Notice that in this example, Solaris ifconfig does not report the ethernet address of hme0. Some versions of Solaris ifconfig, however, will list ethernet addresses, so your listing may differ slightly.)
Loopback address: 127.0.0.1. This address is used for diagnostics.
Bringing interfaces up and down
The ifconfig command may be used to activate and deactivate a network interface. For example, to toggle the state of the eth0 device, use:
host# /sbin/ifconfig eth0 down
host# /sbin/ifconfig eth0 up
Note that root permissions are necessary to bring an interface up or down.
Configuring Interface - Quiz
Click the Quiz button to take a short multiple-choice quiz on configuring an interface.
Configuring Interface - Quiz
Course navigation