old-www/FAQ/Linux-FAQ/networking.html

966 lines
18 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Connecting To A Network</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Linux FAQ"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Directory And File Management"
HREF="file-management.html"><LINK
REL="NEXT"
TITLE="Troubleshooting"
HREF="troubleshooting.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Linux FAQ</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="file-management.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="troubleshooting.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="networking"
></A
>11. Connecting To A Network</H1
><DIV
CLASS="qandaset"
><DL
><DT
>Q: <A
HREF="networking.html#get-dial-up-ppp-work"
>How I Configure Dial-up PPP?</A
></DT
><DT
>Q: <A
HREF="networking.html#linux-cable-modem"
>How Do I Use Linux with a Cable Modem?</A
></DT
><DT
>Q: <A
HREF="networking.html#information-about-nfs-compatibility"
>Where Is Information about NFS Compatibility?</A
></DT
><DT
>Q: <A
HREF="networking.html#vfs"
>What Does VFS Stand For?</A
></DT
><DT
>Q: <A
HREF="networking.html#can-linux-access-smb-file-systems"
>Can Linux Access SMB File Systems?</A
></DT
></DL
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="get-dial-up-ppp-work"
></A
><B
>Q: </B
>How I Configure Dial-up PPP?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>This information is mainly for people who do
not have a wrapper utility like <B
CLASS="command"
>kppp</B
> or
<B
CLASS="command"
>pppconfig</B
>, or are not able to get those utilities to work
correctly. If you need to manually configure PPP to dial in to your ISP, you
will need the following information:
</P
><P
></P
><UL
><LI
><P
>The port that your modem is connected to: <TT
CLASS="filename"
>/dev/ttyS0</TT
>-<TT
CLASS="filename"
>/dev/ttyS3</TT
>, which
correspond to COM1-COM4 under MS-DOS.
</P
></LI
><LI
><P
>The phone number of your ISP's data connection.
</P
></LI
><LI
><P
>The user name and password that your ISP gave you.
</P
></LI
><LI
><P
>The IP addresses of the primary and possibly secondary Domain Name Service that
you will use when dialing in to the ISP. This assumes that you will not be
using a DNS that you installed on your system.
</P
><P
>When you have all of this information, make sure that the programs <B
CLASS="command"
>pppd</B
> and
<B
CLASS="command"
>chat</B
>, at the very minimum, are installed correctly. In
most current distributions, they are installed in the
<TT
CLASS="filename"
>/usr/sbin/</TT
> directory, and you will need to be logged in
as root to use them. In addition, the following programs are also useful for
configuring network connections, determining network status, and diagnosing
problems: <TT
CLASS="filename"
>/sbin/ifconfig</TT
>, <TT
CLASS="filename"
>/sbin/route</TT
>, <TT
CLASS="filename"
>/bin/ping</TT
>,
<TT
CLASS="filename"
>/usr/sbin/traceroute</TT
>.
These are the basic steps that you need to follow to configure PPP. You must be logged in as
root.
</P
></LI
><LI
><P
>Make sure that the serial port and modem are operating correctly. Using a program like
<B
CLASS="command"
>minicomm</B
> or <B
CLASS="command"
>kermit</B
>, you should be able
to send <TT
CLASS="literal"
>AT</TT
> commands to the modem and receive the
<TT
CLASS="literal"
>OK</TT
> string in response from the modem.
</P
></LI
><LI
><P
>Enter the primary and possibly secondary Domain Name Server
IP addresses in the <TT
CLASS="filename"
>/etc/resolv.conf</TT
> file, using dotted
quad notation, with the <TT
CLASS="literal"
>nameserver</TT
> label. For example:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> order hosts,bind
nameserver 196.182.101.103
nameserver 196.182.101.104 </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>The nameserver addresses in the example above are examples only.
They don't correspond to actual network hosts.
The first line, <TT
CLASS="literal"
>order hosts,bind</TT
>,
tells your networking software, when it resolves network domain addresses, to
first look in the <TT
CLASS="filename"
>/etc/hosts file</TT
>, and then use the bind
service; i.e., the DNS servers, which are specified on the lines that begin
with nameserver.
</P
></LI
><LI
><P
>Locate the chat script that PPP will use to dial the modem and connect to your ISP.
In many systems, this is either in the <TT
CLASS="filename"
>/etc/chatscripts</TT
> or
<TT
CLASS="filename"
>/etc/ppp</TT
> directory, and will be called <TT
CLASS="filename"
>provider</TT
> or something similar. You can store a
<TT
CLASS="literal"
>chat</TT
> script anywhere, provided that you tell
<B
CLASS="command"
>pppd</B
> to use it rather than the default script. Refer to
the <B
CLASS="command"
>chat</B
> and <B
CLASS="command"
>pppd</B
> manual pages, and the
information below, for details. Here is a sample <TT
CLASS="literal"
>chat</TT
>
script:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
>&#13;ABORT BUSY
ABORT "NO CARRIER"
ABORT VOICE
ABORT "NO DIALTONE"
"" ATDT&#60;your_isp's_phone_number&#62;
ogin &#60;your_user_name&#62;
word &#60;your_password&#62;
</PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>This is a <B
CLASS="command"
>chat</B
> program for a simple, script based login. The
<B
CLASS="command"
>chat</B
> program uses the pair of strings on each line as a
match/response pair. When it starts, it sends the string
"ATDT<EM
>your_isp's_phone_number</EM
>," where you have
substituted the actual phone number of course. It then waits for the string
<TT
CLASS="literal"
>ogin</TT
> (a substring of the word <TT
CLASS="literal"
>login</TT
>)
and sends your user name. It then waits for <TT
CLASS="literal"
>word</TT
> (a
substring of <TT
CLASS="literal"
>password</TT
>) and sends your password. If your
ISP uses a different login and password prompts, and any additional prompts,
you will need to edit the script accordingly. Again, refer to the
<B
CLASS="command"
>chat</B
> manual page for details.
</P
><P
>If your ISP uses PAP or CHAP authentication, you will need to edit the
<TT
CLASS="filename"
>pap-secrets</TT
> or <TT
CLASS="filename"
>chap-secrets</TT
> files
in <TT
CLASS="filename"
>/etc/ppp</TT
> directory as well. Refer to the manual pages
for these files, as well as the instruction in the files themselves.
</P
></LI
><LI
><P
>The configuration of <B
CLASS="command"
>pppd</B
>, the program that maintains the actual connection, is
usually contained in two or three separate files. The first is usually
<TT
CLASS="filename"
>/etc/ppp/options</TT
>, which contains options that all of
your system's PPP connections will use. (Yes, you can have more than one; as
many as your computer has serial ports, generally.)
</P
><P
>Here is a sample <TT
CLASS="filename"
>/etc/ppp/options</TT
> file:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> #/etc/ppp/options
asyncmap
0
auth
crtscts
lock
noipx
# ---&#60;End of File&#62;--- </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>The options may be given on one
line or each on a separate line. Many options files are much longer, and come
with a description of each option. Here, the options mean, in order, don't
remap any characters between the PPP client and server; always use password,
PAP, or CHAP authentication when making a connection; use the modem's
hardware handshake lines for flow control; lock the serial port when in use
so no other programs can access it; and do not use the IPX network protocol.
</P
></LI
><LI
><P
>For connection set-up on each individual
serial port or PPP host, there will either be an
<TT
CLASS="filename"
>/etc/ppp/options.ttyS1</TT
>, for example, options file for
<TT
CLASS="filename"
>/etc/ttyS1</TT
>, or a file for your ISP in the
<TT
CLASS="filename"
>/etc/ppp/peers</TT
> directory. The default is often called
<TT
CLASS="filename"
>/etc/ppp/peers/provider</TT
>. Here is a sample of the default
<TT
CLASS="filename"
>provider</TT
> file:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
defaultroute
/dev/ttyS1
38400
persist
</PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>There might be an explanation of these
and other options in the <TT
CLASS="filename"
>/etc/ppp/peers/provider</TT
> file
itself. You can also refer to the <B
CLASS="command"
>pppd</B
> manual page for
details. Briefly, they mean: do not use PAP authentication for this
connection; use the <B
CLASS="command"
>chat</B
> program and the
<TT
CLASS="filename"
>/etc/chatscripts/provider</TT
> script, which is described
above, to dial the phone and log in; set the network default route to the PPP
connection (so when your network software needs to resolve an network address
that is not on your local machine(s), it will use the PPP connection to the
Internet); use <TT
CLASS="filename"
>/dev/ttyS1</TT
> as the serial port for the
connection; set the modem speed to 38400; and keep the
<B
CLASS="command"
>pppd</B
> daemon running even if the connection fails.
</P
></LI
></UL
><P
>That is all of the configuration you
need. To actually start and stop PPP, there are often
<TT
CLASS="filename"
>/usr/bin/pon</TT
> and <TT
CLASS="filename"
>/usr/bin/poff</TT
>
scripts (in Debian), or something similar, and they are usually very simple,
and only contain the command:
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ /usr/sbin/pppd call ${1:-provider} </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>This will start <B
CLASS="command"
>pppd</B
> and use the <TT
CLASS="literal"
>call</TT
> option to call
the server that you type on the command line, or the provider given in the
<TT
CLASS="filename"
>/etc/ppp/peers/provider</TT
> file if you do not specify a
remote server. After making the call and logging in (about 30 seconds), you
should be able to use the <TT
CLASS="filename"
>/sbin/ifconfig</TT
> program to
determine that the connection really did establish a PPP interface (the first
will be <TT
CLASS="filename"
>ppp0</TT
>, the second will be
<TT
CLASS="filename"
>ppp1</TT
>, etc., depending on how many simultaneous PPP
connections you have. If something goes wrong, you can look at the
<TT
CLASS="filename"
>/var/log/ppp.log</TT
> file to determine what happened. You
can also view the log as the connection is being made, by "tailing" it in
another window; that is, viewing it as pppd logs the connection's status
information. To do this, use the command (again, as root):
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> $ tail -f /var/log/ppp.log </PRE
></FONT
></TD
></TR
></TABLE
>
</P
><P
>On some systems the PPP output is directed to <TT
CLASS="filename"
>/var/log/messages</TT
>,
in which case your system may not have a dedicated PPP log file.
</P
><P
>You should be also able to <B
CLASS="command"
>ping</B
> one of your ISP's domain names (e.g.,
<TT
CLASS="literal"
>mail.isp.com</TT
>) and receive a response.
</P
><P
>These are the most basic steps for configuring a PPP connection. You will also need
to take into account what other network connections may be present (for
example, if there's an Ethernet connection that has already been assigned the
default route), as well as various security measures at your ISP's end. If
you're having trouble making the dial-up connection, usually the best way to
determine what may be going wrong is to use Seyon, minicomm, kermit, or some
other program to dial and log in manually to the ISP, and determine just
exactly what you have to do to log in, then duplicate that in the PPP
scripts.
</P
><P
>Most Linux documentation also has additional
instructions for configuring PPP connections.
</P
><P
>Refer to <A
HREF="linux-distributions.html#get-linux-material-by-ftp"
><I
>Where Are the Linux FTP Archives?</I
></A
> and
<A
HREF="online-resources.html#howtos-and-other-documentation"
><I
>Where Is the Documentation?</I
></A
>.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="linux-cable-modem"
></A
><B
>Q: </B
>How Do I Use Linux with a Cable Modem?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>The www.CablemodemInfo.com and xDSL Web page at
<A
HREF="http://www.cablemodeminfo.com"
TARGET="_top"
><I
CLASS="citetitle"
>http://www.cablemodeminfo.com</I
></A
> has a section devoted to Linux.
</P
><P
>See also the <I
CLASS="citetitle"
>Cable-Modem-HOWTO</I
> at the LDP.
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="information-about-nfs-compatibility"
></A
><B
>Q: </B
>Where Is Information about NFS Compatibility?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>See the <TT
CLASS="filename"
>NFS-HOWTO</TT
> for up to date information.
</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>This information is partly taken from Nicolai Langfeldt's excellent NFS HOWTO,
and is current as of 10/1/1999:
</P
><P
>Most version 2.2.x kernels need a set of patches
to install the <B
CLASS="command"
>knfsd</B
> subsystem, maintained by H.J. Lu, to
communicate efficiently (if at all) with Sparc, IBM RS, and Alpha machines,
and probably others. This package is actually a collection of patches to the
kernel sources. Better support for non-Intel architectures is included in the
2.4 kernels.
</P
><P
>There is also a user-space server. Although it lacks remote file locking,
it is easier to install. It may be equally efficient.
</P
><P
>In the <TT
CLASS="filename"
>Documentation/Changes</TT
>
of recent kernel distributions, there is a list of URL's for both the
<B
CLASS="command"
>knfsd</B
> server and the user-space server.
</P
><P
>In the case of older Solaris releases, the
lack of <TT
CLASS="literal"
>statd</TT
> or <TT
CLASS="literal"
>lockd</TT
> on a client or
server machine may cause incompatibility. On some versions of Solaris,
<TT
CLASS="literal"
>statd</TT
> can be used to exploit features of the automounter.
Sun released a patch to correct this, but <TT
CLASS="literal"
> statd</TT
> still
needs to be started by root on such systems. On recent Solaris systems, refer
to the information in <TT
CLASS="literal"
>/etc/dfs/dfstab</TT
> and the
<TT
CLASS="literal"
>share(1M)</TT
> manual page to enable volume sharing. In
addition, the <TT
CLASS="literal"
>rpcinfo</TT
> program can tell you if
<TT
CLASS="literal"
>statd</TT
> or <TT
CLASS="literal"
>lockd</TT
> are available on the
local or remote machines.
</P
><P
>The <TT
CLASS="literal"
>linux-kernel</TT
> mailing list has on-and-off discussions of the status of the NFS subsystem,
which appears to be changing rapidly.
</P
><P
>[Nicolai Langfeldt, Robert Kiesling, Anders Hammarquist]
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="vfs"
></A
><B
>Q: </B
>What Does VFS Stand For?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
><EM
>Virtual File System</EM
>. It's the abstraction layer between
the user and real file systems like <I
CLASS="citetitle"
>ext2</I
>,
<I
CLASS="citetitle"
>Minix</I
> and <I
CLASS="citetitle"
>MS-DOS</I
>. Among other
things, its job is to flush the read buffer when it detects a disk change on
the floppy disk drive.
</P
><P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="screen"
> VFS: Disk change detected on device 2/0 </PRE
></FONT
></TD
></TR
></TABLE
>
</P
></DIV
></DIV
><DIV
CLASS="qandaentry"
><DIV
CLASS="question"
><P
><A
NAME="can-linux-access-smb-file-systems"
></A
><B
>Q: </B
>Can Linux Access SMB File Systems?</P
></DIV
><DIV
CLASS="answer"
><P
><B
>A: </B
>Linux supports read/write access of
Windows for Workgroups and Windows NT SMB volumes. See the file
Documentation/filesystems/smbfs.txt of the Linux kernel source distribution,
and <A
HREF="development.html#upgrade-recompile-kernel"
><I
>How To Upgrade/Recompile a Kernel</I
></A
>.
</P
><P
>There is also a suite
of programs called Samba which provide support for WfW networked file systems
(provided they're for TCP/IP). Information is available in the
<TT
CLASS="filename"
>README</TT
> file at
<TT
CLASS="filename"
>metalab.unc.edu/pub/Linux/system/network/samba/</TT
>.
</P
><P
>The SMB Web site is <A
HREF="http://www.samba.org"
TARGET="_top"
><I
CLASS="citetitle"
>http://www.samba.org</I
></A
>, and there is also a Web
site at <TT
CLASS="filename"
>samba.anu.edu.au/samba/</TT
>.
</P
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="file-management.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="troubleshooting.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Directory And File Management</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Troubleshooting</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>