📄 665-667.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:SLIP and PPP</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=38//-->
<!--PAGES=665-667//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch37/662-663.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="667-669.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 38<BR>SLIP and PPP
</FONT></H2>
<P><I>by Tim Parker</I></P>
<DL>
<DT><B>In This Chapter</B>
<DT>• Setting up the dummy interface
<DT>• Setting up SLIP
<DT>• Setting up PPP
<DT>• Using DNS with SLIP and PPP
</DL>
<P>Most UNIX or Linux systems that want to make a connection to the Internet through an ISP or gateway do so with either Serial Line Internet Protocol (SLIP) or Point-to-Point Protocol (PPP). Both SLIP and PPP work through a dialup modem (either asynchronous, synchronous, or ISDN) to establish a link with remote systems. Linux provides both SLIP and PPP as well as an enhanced version of SLIP called CSLIP (Compressed SLIP).
</P>
<P>You can perform SLIP and PPP configurations when you are configuring Linux TCP/IP or you can wait until you need to set them up for Internet access. Most Internet service providers prefer SLIP or PPP access from small systems as they provide fast, efficient transfers, so if you plan on using an ISP you will probably end up configuring the protocols yourself in the end.</P>
<P>The steps to setting up SLIP or PPP on your Linux system are not too complicated. Follow the process shown in this chapter and you’ll have the SLIP or PPP setup completed in a few minutes.</P>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Setting Up the Dummy Interface</FONT></H3>
<P>A dummy interface (also called a loopback interface or device) is used to give your machine an IP address to work with when it uses only SLIP and PPP interfaces. A dummy interface solves the problem of a standalone machine with no network cards connecting it to other machines. Most TCP/IP services and applications need an IP address which is usually lacking in a standalone configuration. For this reason, the loopback driver is configured with a standard IP address (<TT>127.0.0.1</TT>).</P>
<P>Creating a dummy interface is simple. If your machine has an IP address already assigned to it in the <TT>/etc/hosts</TT> file, all you need to do is set up the interface and create a route. For Linux the two commands needed are as follows:</P>
<!-- CODE SNIP //-->
<PRE>
ifconfig dummy machine_name
route add machine_name
</PRE>
<!-- END CODE SNIP //-->
<P><TT>machine_name</TT> is your local machine’s name. This creates a link to your own IP address. If you do not have an IP address for your machine in the <TT>/etc/hosts</TT> file, you should add one before you create the dummy interface by manually editing the <TT>/etc/hosts</TT> file and adding a line like this:</P>
<!-- CODE SNIP //-->
<PRE>
127.0.0.1 loopback
</PRE>
<!-- END CODE SNIP //-->
<P>Some Linux systems do not use the <TT>ifconfig</TT> and <TT>route</TT> utilities, relying instead on a menu-driven user interface to set the same parameters up. In most cases with Linux, the loopback driver is added automatically for you when you install Linux. Check the <TT>/etc/hosts</TT> file for a line with the IP address <TT>127.0.0.1</TT>. If it doesn’t exist, use whatever routine your version of Linux uses to set up new chains or simply use an editor to add it to the file, then reboot the machine to make the changes effective.</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Setting Up SLIP</FONT></H3>
<P>SLIP can be used with many dialup ISPs as well as for networking with other SLIP-equipped machines. When you are establishing a SLIP connection to another machine, the modem establishes a connection as usual, then SLIP takes over and maintains the session for you. The SLIP driver is usually configured as part of the operating system kernel, so it needs to be added if it doesn’t already exist. Most Linux SLIP drivers can also handle CSLIP, a compressed SLIP version that offers higher throughput. (Not all ISPs support CSLIP, so you should check with them before configuring it for your connection.)
</P>
<P>For many Linux operating systems that use SLIP for connections, a serial port has to be dedicated for this reason. This means that a serial port must be specifically configured to use SLIP and cannot be used for any other purpose. The kernel uses a special program usually called SLIPDISC (SLIP discipline) to control the serial port and blocks non-SLIP applications from using it even when the port is not in use by SLIP.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch37/662-663.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="667-669.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -