327 lines
6.3 KiB
HTML
327 lines
6.3 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Configuring TCP/IP Networking</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux Network Administrators Guide"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Serial Devices and the login: Prompt"
|
|
HREF="x-087-2-serial.getty.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Mounting the /proc Filesystem"
|
|
HREF="x-087-2-iface.procfs.html"></HEAD
|
|
><BODY
|
|
CLASS="CHAPTER"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux Network Administrators Guide</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-serial.getty.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-iface.procfs.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="CHAPTER"
|
|
><H1
|
|
><A
|
|
NAME="X-087-2-IFACE"
|
|
>Chapter 5. Configuring TCP/IP Networking</A
|
|
></H1
|
|
><DIV
|
|
CLASS="TOC"
|
|
><DL
|
|
><DT
|
|
><B
|
|
>Table of Contents</B
|
|
></DT
|
|
><DT
|
|
>5.1. <A
|
|
HREF="x-087-2-iface.procfs.html"
|
|
>Mounting the /proc Filesystem</A
|
|
></DT
|
|
><DT
|
|
>5.2. <A
|
|
HREF="x-087-2-iface.binaries.html"
|
|
>Installing the Binaries</A
|
|
></DT
|
|
><DT
|
|
>5.3. <A
|
|
HREF="x-087-2-iface.hostname.html"
|
|
>Setting the Hostname</A
|
|
></DT
|
|
><DT
|
|
>5.4. <A
|
|
HREF="x-087-2-iface.addresses.html"
|
|
>Assigning IP Addresses</A
|
|
></DT
|
|
><DT
|
|
>5.5. <A
|
|
HREF="x-087-2-create.subnets.html"
|
|
>Creating Subnets</A
|
|
></DT
|
|
><DT
|
|
>5.6. <A
|
|
HREF="x-087-2-iface.simple-resolv.html"
|
|
>Writing hosts and networks Files</A
|
|
></DT
|
|
><DT
|
|
>5.7. <A
|
|
HREF="x-087-2-iface.interface.html"
|
|
>Interface Configuration for IP</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.7.1. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.LOOPBACK"
|
|
>The Loopback Interface</A
|
|
></DT
|
|
><DT
|
|
>5.7.2. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.ETHERNET"
|
|
>Ethernet Interfaces</A
|
|
></DT
|
|
><DT
|
|
>5.7.3. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.GATEWAY"
|
|
>Routing Through a Gateway</A
|
|
></DT
|
|
><DT
|
|
>5.7.4. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.GATEWAY-CONF"
|
|
>Configuring a Gateway</A
|
|
></DT
|
|
><DT
|
|
>5.7.5. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.PLIP"
|
|
>The PLIP Interface</A
|
|
></DT
|
|
><DT
|
|
>5.7.6. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.SLIP"
|
|
>The SLIP and PPP Interfaces</A
|
|
></DT
|
|
><DT
|
|
>5.7.7. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.DUMMY"
|
|
>The Dummy Interface</A
|
|
></DT
|
|
><DT
|
|
>5.7.8. <A
|
|
HREF="x-087-2-iface.interface.html#X-087-2-IFACE.INTERFACE.ALIAS"
|
|
>IP Alias</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
><DT
|
|
>5.8. <A
|
|
HREF="x-087-2-iface.ifconfig.html"
|
|
>All About ifconfig</A
|
|
></DT
|
|
><DT
|
|
>5.9. <A
|
|
HREF="x-087-2-iface.netstat.html"
|
|
>The netstat Command</A
|
|
></DT
|
|
><DD
|
|
><DL
|
|
><DT
|
|
>5.9.1. <A
|
|
HREF="x-087-2-iface.netstat.html#X-087-2-IFACE.NETSTAT.-R"
|
|
>Displaying the Routing Table</A
|
|
></DT
|
|
><DT
|
|
>5.9.2. <A
|
|
HREF="x-087-2-iface.netstat.html#X-087-2-IFACE.NETSTAT.-I"
|
|
>Displaying Interface Statistics</A
|
|
></DT
|
|
><DT
|
|
>5.9.3. <A
|
|
HREF="x-087-2-iface.netstat.html#X-087-2-IFACE.NETSTAT.-T-U-X"
|
|
>Displaying Connections</A
|
|
></DT
|
|
></DL
|
|
></DD
|
|
><DT
|
|
>5.10. <A
|
|
HREF="x-087-2-iface.verify.arp.html"
|
|
>Checking the ARP Tables</A
|
|
></DT
|
|
></DL
|
|
></DIV
|
|
><P
|
|
>
|
|
|
|
|
|
In this chapter, we walk you through all the necessary steps to set up
|
|
TCP/IP networking on your machine. Starting with the assignment of IP
|
|
addresses, we slowly work our way through the configuration of TCP/IP
|
|
network interfaces and introduce a few tools that come in handy when
|
|
hunting down network installation problems.</P
|
|
><P
|
|
>Most of the tasks covered in this chapter will generally have to be
|
|
done only once. Afterward, you have to touch most configuration files
|
|
only when adding a new system to your network or when you reconfigure
|
|
your system entirely. Some of the commands used to configure TCP/IP,
|
|
however, have to be executed each time the system is booted. This is
|
|
usually done by invoking them from the system
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>/etc/rc*</TT
|
|
> scripts.</P
|
|
><P
|
|
> Commonly, the network-specific part of this procedure is contained in
|
|
a script. The name of this script varies in different Linux
|
|
distributions. In many older Linux distributions, it is known as
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>rc.net</TT
|
|
> or <TT
|
|
CLASS="FILENAME"
|
|
>rc.inet</TT
|
|
>. Sometimes
|
|
you will also see two scripts named <TT
|
|
CLASS="FILENAME"
|
|
>rc.inet1</TT
|
|
> and
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>rc.inet2</TT
|
|
> ; the former initializes the
|
|
kernel part of networking and the latter starts basic networking
|
|
services and applications. In modern distributions, the
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>rc</TT
|
|
> files are structured in a more sophisticated
|
|
arrangement; here you may find scripts in the
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>/etc/init.d/</TT
|
|
> (or
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>/etc/rc.d/init.d/</TT
|
|
> ) directory that create
|
|
the network devices and other <TT
|
|
CLASS="FILENAME"
|
|
>rc</TT
|
|
> files that run
|
|
the network application programs. This book's examples are based on
|
|
the latter arrangement.</P
|
|
><P
|
|
>This chapter discusses parts of the script that configure your network
|
|
interfaces, while applications will be covered in later chapters.
|
|
After finishing this chapter, you should have established a sequence
|
|
of commands that properly configure TCP/IP networking on your
|
|
computer. You should then replace any sample commands in your
|
|
configuration scripts with your commands, make sure the script is
|
|
executed from the basic <TT
|
|
CLASS="FILENAME"
|
|
>rc</TT
|
|
> script at startup
|
|
time, and reboot your machine. The networking <TT
|
|
CLASS="FILENAME"
|
|
>rc</TT
|
|
>
|
|
scripts that come along with your favorite Linux distribution should
|
|
provide a solid example from which to work.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-serial.getty.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-iface.procfs.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Serial Devices and the login: Prompt</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Mounting the /proc Filesystem</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |