Linux’s greatest strength is its powerful and robust networking capabilities. The good news is that everything about Linux’s networking setup is open to inspection and completely configurable. Nothing is hidden from the user, and no parameters are forced on you. The challenge is to get the most out of this setup.
Basic networking principles don’t differ much between Windows and Linux, and indeed the principles aren’t unfamiliar. This chapter begins with an overview of networking and then looks in more detail at Linux networking on a local area network (LAN). In the next chapter, you’ll learn about setting up Internet services.
This chapter explains how to set up a LAN that includes a Linux Samba server, which lets Microsoft Windows and Unix systems access shared files and printers across the network. Samba not only lets you share files and printers, it can also be used to back up and restore files via the network. The chapter also explains how to use Neat (Red Hat’s Network Administration Tool)to administer a simple LAN. Administering the network configurations of the hosts on even a modest network can be a headache. This chapter explains how to install and configure a DHCP server that lets you manage network configurations centrally, facilitating network administration.
Most
computers today handle network traffic much as the post office
handles mail. Think, for example, of the steps involved in sending
and receiving a letter. Your postal carrier must know where to drop
off and where to pick up mail. So your home must have some kind of
recognizable interface
; we call this a mailbox.
And whereas your postal carrier may know your neighborhood quite
well, delivery in other areas will require other carriers. Mail is
passed to these other carriers through a
gateway
; we call this the post office. Although
you can think of the whole postal system as one big network,
it’s easier to understand if you think of it as a hierarchy of
subnetworks
(or subnets
):
the postal system is divided into states, states are divided into
counties and cities with a range of Zip Codes, Zip Codes contain a
number of streets, and each street contains a unique set of
addresses.
Computer networking mirrors this model. Let’s trace an email message from you to a coworker. You compose the message and click Send. Your computer passes the message to a network interface. This interface may be a modem by which you dial up an Internet service provider (ISP), or it may be via an Ethernet connection on a LAN. Either way, on the other side of the interface is a gateway machine. The gateway knows how to look at the address of the recipient on the email message and interpret that message in terms of networks and subnets. Using this information, the gateway passes the message to other gateways until the message reaches the gateway for the destination machine. That gateway in turn delivers the message via a recognizable interface (such as a modem or Ethernet link) to the recipient’s inbox.
If you
review this story, you can easily see which parts of networking
you’ll need to configure on your Linux system. You’ll
need to know the address of your machine. Just as the town name
Sebastopol
and the Zip Code 95472
are two different names for the same location, you may
have both a name, called a hostname
, and a
number, called an IP number
or IP
address
,[8] that serve as the address for your
machine.
To translate between these two notations, you may need to know the address of a Domain Name Server (DNS). This is a machine that matches IP addresses with hostnames. You’ll also need to know the address of a gateway machine through which network traffic will be routed. Finally, you’ll need to be able to bring up a network interface on your system, and you’ll need to assign a route from that interface to the gateway.
While all of this can seem complex, it really isn’t any more complex than the postal system, and it functions in much the same way. Fortunately, Linux comes with tools to help you automate network configuration.