A quick guide to Linux networking
IBM e-business architect Chris Walden is your guide through a nine-part developerWorks series on moving your operational skills from a Windows to a Linux environment. In this part, we explore networking, which is one of the things that Linux does best.
It is almost inconceivable to run a computer in this age without being connected to a network. E-mail, Web browsing, and file sharing are all as expected as printing and viewing information on a screen.
Fortunately, Linux was made for the network from the very beginning. In fact, networking is one of the things that Linux does best. Linux supports the popular networking protocols such as TCP/IP and SMB (NetBIOS). Linux also has sophisticated tools for monitoring and filtering network traffic. Services such as FTP, Windows file and print sharing, and Web serving are available. Linux even provides facilities for centralized directory services, Virtual Private Networking (VPN), and remote procedure calls.
Linux can work with any network hardware for which it has a driver. Linux drivers are compiled into the kernel, either monolithically or as loadable modules. Many popular network cards are supported by default in the Linux kernel. When selecting network hardware, it is always good to use a device listed on the "Hardware Compatibility List" (see Resources for links). Use the most up-to-date version for your Linux distribution.
Generally, if you are using compatible network hardware, your card will
be automatically recognized when you install the system. You can check the
network hardware found on your system by using the
ifconfig command. By default,
ifconfig shows you active network devices. You see
all network devices by adding the
In the listing above, there is only one network card in the system,
identified as eth0. The
lo adapter is a loopback, used by Linux to
talk to itself. We'll look more at the
Network device names
When they are configured, Linux network devices are given aliases, which consist of a descriptive abbreviation and a number. The first device of a type is numbered 0, and the others are numbered 1, 2, 3, etc. The following naming conventions are used. The information is taken from the Linux Network Administrator's Guide (see the Resources section at the end of this article for links).
- eth0, eth1 ...
These are the Ethernet card interfaces. They are used for most Ethernet cards, including many of the parallel port Ethernet cards.
- tr0, tr1 ...
These are the Token Ring card interfaces. They are used for most Token Ring cards, including non-IBM manufactured cards.
- s10, s11 ...
These are the SLIP interfaces. SLIP interfaces are associated with serial lines in the order in which they are allocated for SLIP.
- ppp0, ppp1 ...
These are the PPP interfaces. Just like SLIP interfaces, a PPP interface is associated with a serial line once it is converted to PPP mode.
- plip0. plip1 ...
These are the PLIP interfaces. PLIP transports IP datagrams over parallel lines. The interfaces are allocated by the PLIP driver at system boot time and are mapped onto parallel ports. In the 2.0.x kernels, there is a direct relationship between the device name and the I/O port of the parallel port, but in later kernels, the device names are allocated sequentially, just as for SLIP and PPP devices.
- ax0, ax1 ...
These are the AX.25 interfaces. AX.25 is the primary protocol used by amateur radio operators. AX.25 interfaces are allocated and mapped in a similar fashion to SLIP devices.
There are many other types of interfaces available for other network drivers. We've listed only the most common ones.
Since Ethernet is the most common configuration, we will focus on that. For more information about other kinds of connections, see the Resources at the end of this article.