Washtenaw Linux Users Group
● ... stands for interface configurator
● ... is part of the original internet toolkit
● ... has versions available for Linux, BSD,
Solaris, and Mac OSX
● Ifconfig is used to configure the kernel-resident
network interfaces. It is used at boot time to set
up interfaces as necessary. After that, it is
usually only needed when debugging or when
system tuning is needed.
man page 2
● If no arguments are given, ifconfig displays
the status of the currently active interfaces. If
a single interface argument is given, it
displays the status of the given interface
only; if a single -a argument is given, it
displays the status of all interfaces, even
those that are down. Otherwise, it configures
What is it saying?
● eth0 is the interface it is reporting on. It is the
first of the ethernet interfaces on this
● The Hardware Address is 00:0F:20:CF:8B:42.
This is sometimes called the MAC address
(Media Access Control), and is a
hexadecimal number assigned to the
ethernet card at the factory.
● The internet address is 172.16.1.2. This is
the address assigned to this computer.
What is it saying? 2
● The Broadcast Address is 172.16.1.255. This
is an address that can be used to send
messages to every computer on the same
subnet as this computer.
● The Subnet Mask is 255.255.255.0. This can
be thought of as defining or identifying the
subnet this computer is part of.
● The rest of it tells about packets sent,
received, dropped, etc.
Use for information
● The first thing most beginners will want to do
is use this for information.
● If you find you are not connected to the
Internet, use this command to see if your
interface is configured and active.
● You can use this to check on your IP
address and subnet mask.
● There is an equivalent for wireless
interfaces, called iwconfig.
Parallels for newbies
● Windows 95 through ME had a command
● Windows NT through Windows Vista have
● These are essentially similar to the Unix
● ifconfig interface [address [parameters]]
● interface is the interface name, such as eth0
(first ethernet device) or lo (local host)
● address is the IP address assigned to the
interface. This can be specified as a dotted
quad address, or as a name that can be
looked up in /etc/hosts.
● up – Makes an interface accessible to the IP
● down – Makes an interface inaccessible to
the IP layer, i.e. stops all traffic through this
● netmask mask – Sets the subnet mask to be
used by the interface.
● broadcast address – Sets the broadcast
● If you are not a network administrator, be
very careful about setting addresses from the
command line. Even people with some
experience can get confused setting a
subnet mask. You don't want your interface
to stop working in some mysterious way.
● Using this command to get information is
● If you do want to experiment (a very good
way to learn about these things), just make
sure you are not using a mission-critical
computer. Whatever you screw up you will
need to unscrew.☺
More on this command
● There are other parameters and options
available for this command, but they go
beyond the requirements for this
presentation. Consult Google or the man
page for more information.
● A good readable guide to the basics can be
found at http://tldp.org/LDP/nag2/x-087-2-
● ifconfig eth0 – View the network settings on
the first Ethernet adapter installed in the
● ifconfig -a – Display information on all
network interfaces on the computer, active or
● ifconfig eth0 down – Would take down the
interface, and no packets would be sent or
● ifconfig eth0 up – Would bring the interface
back up so it could send and receive data. 15
● ifconfig eth0 192.168.1.102 netmask
255.255.255.0 broadcast 192.168.1.255 –
This would assign these values to the first
Ethernet device installed in the computer. Be