⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 447-451.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Using Linux:Managing Network Connections</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!--ISBN=0789716232//-->

<!--TITLE=Using Linux//-->

<!--AUTHOR=William Ball//-->

<!--PUBLISHER=Macmillan Computer Publishing//-->

<!--IMPRINT=Que//-->

<!--CHAPTER=27//-->

<!--PAGES=447-451//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="443-446.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="451-455.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P><FONT SIZE="+1"><B><I>Configuring PPP on a Linux machine</I></B></FONT></P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;The first step is to use the <TT>modemtool</TT> program to create the modem device in the <TT>/dev</TT> directory. To launch <TT>modemtool</TT>, type the following (as root) from the command line:

<!-- CODE SNIP //-->

<PRE>

   <B># modemtool</B>

</PRE>

<!-- END CODE SNIP //-->

<DD><B>2.</B>&nbsp;&nbsp;This opens the window shown in Figure 27.4. Click the COM port to which the modem is connected and then click the <B>OK</B> button to create the appropriate <TT>/dev/modem</TT> file.

<P><A NAME="Fig4"></A><A HREF="javascript:displayWindow('images/27-04.jpg',331,342 )"><IMG SRC="images/27-04t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-04.jpg',331,342)"><FONT COLOR="#000077"><B>Figure 27.4</B></FONT></A>&nbsp;&nbsp;Use the <TT>modemtool</TT> to configure your modem.

</P>

<DD><B>3.</B>&nbsp;&nbsp;Launch <TT>netcfg</TT> and click the <B>Interfaces</B> button. You&#146;ll see the screen shown in Figure 27.5.

<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/27-05.jpg',537,383 )"><IMG SRC="images/27-05t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-05.jpg',537,383)"><FONT COLOR="#000077"><B>Figure 27.5</B></FONT></A>&nbsp;&nbsp;The Interfaces window in <TT>netcfg</TT> contains a list of configured interfaces.

</P>

<DD><B>4.</B>&nbsp;&nbsp;Click the <B>Add</B> button to open the Choose window (see Figure 27.6).

<P><A NAME="Fig6"></A><A HREF="javascript:displayWindow('images/27-06.jpg',124,250 )"><IMG SRC="images/27-06t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-06.jpg',124,250)"><FONT COLOR="#000077"><B>Figure 27.6</B></FONT></A>&nbsp;&nbsp;Select the PPP interface in the Chose Interface Type window.</P>

<DD><B>5.</B>&nbsp;&nbsp;Select <B>PPP</B> and click <B>OK</B>. This opens the Create PPP Interface, shown in Figure 27.7.

<P><A NAME="Fig7"></A><A HREF="javascript:displayWindow('images/27-07.jpg',306,170 )"><IMG SRC="images/27-07t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-07.jpg',306,170)"><FONT COLOR="#000077"><B>Figure 27.7</B></FONT></A>&nbsp;&nbsp;Create a new PPP interface using the Create PPP Interface window.</P>

<DD><B>6.</B>&nbsp;&nbsp;Click the Phone Number field and type the phone number that the modem will dial.

<DD><B>7.</B>&nbsp;&nbsp;Click the PPP logon name field and type the name that PPP should use to log on. This is your user name on the machine that is being called.

<DD><B>8.</B>&nbsp;&nbsp;Click the PPP password field and type the password that PPP should use for the logon you gave. Because the password is entered as clear text, make sure that no one who should not know your password is present when you enter it.

<DD><B>9.</B>&nbsp;&nbsp;Click the <B>Customize</B> button to open the Edit PPP Interface dialog box, shown in Figure 27.8.

<P><A NAME="Fig8"></A><A HREF="javascript:displayWindow('images/27-08.jpg',310,252 )"><IMG SRC="images/27-08t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-08.jpg',310,252)"><FONT COLOR="#000077"><B>Figure 27.8</B></FONT></A>&nbsp;&nbsp;Configure the PPP interface using the Edit PPP Interface window.</P>

<DD><B>10.</B>&nbsp;&nbsp;Select the <B>Use hardware flow control and modem lines</B> option and use the Abort connection on well-known errors option.

<DD><B>11.</B>&nbsp;&nbsp;Set the value in the Line speed to the maximum speed which the computer can communicate with the modem. For most modems, this will be the default value (115200). If a different value for the line speed is given in your modem&#146;s manual, use that value for optimal performance.

<DD><B>12.</B>&nbsp;&nbsp;Make sure the default modem port is configured to <TT>/dev/modem</TT>.

<DD><B>13.</B>&nbsp;&nbsp;Your PPP interface is now configured. If you want a more advanced configuration, click the <B>Networking</B> button. Otherwise, click <B>Done</B>.

<DD><B>14.</B>&nbsp;&nbsp;If you click the <B>Networking</B> button, you&#146;ll see the Edit PPP Interface dialog box, shown in Figure 27.9. In this window, you can set the following parameters:

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;<I>Activate interface at boot time</I>. This means that when your computer boots up, it will dial your modem and establish a PPP link. This is useful if your service provider grants you unlimited connection time.

<DD><B>&#149;</B>&nbsp;&nbsp;<I>Set default route when making connection</I>. This means that all packets requested by your machine for addresses other than the local host will be sent to the PPP interface. This is useful when PPP is the main network connection for your machine.

<DD><B>&#149;</B>&nbsp;&nbsp;<I>Restart PPP when connection fails</I>. This useful option prevents you from having to restart PPP every time the connection fails.

<DD><B>&#149;</B>&nbsp;&nbsp;<I>MRU</I>. The maximum receive unit is the maximum size in bytes of a packet that can be sent and received by your machine. The allowable range is 296 bytes to 1,500 bytes. The value you enter depends on the quality of your phone line. Noisy lines require smaller numbers, and clean lines can use larger numbers.

<DD><B>&#149;</B>&nbsp;&nbsp;<I>Local IP address and Remote IP address</I>. These options are useful only for machines with static IP addresses. If you have a static IP address, these values will be provided to you by your company or service provider.

</DL>

<P><A NAME="Fig9"></A><A HREF="javascript:displayWindow('images/27-09.jpg',377,266 )"><IMG SRC="images/27-09t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-09.jpg',377,266)"><FONT COLOR="#000077"><B>Figure 27.9</B></FONT></A>&nbsp;&nbsp;Set the appropriate PPP options using the Networking options window.</P>

<DD><B>15.</B>&nbsp;&nbsp;After these configuration options are entered, click the <B>Done</B> button. In the dialog box that asks whether you want to save the configuration, click <B>Yes</B>. The Edit PPP Interface dialog box disappears, and a new entry (<TT>PPP0</TT>) is added to the Interfaces screen (refer to Figure 27.5). Click on the <B>Save</B> button in the Interfaces screen to save the changes.

</DL>

<P>After your PPP interface is configured, you&#146;ll want to test it to make sure it works the way you want.

</P>

<P><FONT SIZE="+1"><B><I>Testing the PPP interface</I></B></FONT></P>

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Click the <B>Activate</B> button in the Interfaces screen. You should hear your modem dialing and connecting to your service provider.

<DD><B>2.</B>&nbsp;&nbsp;After the connection is established, ping a well-known host (for example, try pinging <TT>192.31.7.130</TT>, which is <A HREF="www.cisco.com">www.cisco.com</A>):

<!-- CODE //-->

<PRE>

   <B>kanchi 1555$ ping -c 3 192.31.7.130</B>

   PING 192.31.7.130 (192.31.7.130): 56 data bytes

   64 bytes from 192.31.7.130: icmp_seq=0 ttl=248

   time=38.5 ms

   64 bytes from 192.31.7.130: icmp_seq=1 ttl=249

   time=32.5 ms

   64 bytes from 192.31.7.130: icmp_seq=2 ttl=249

   time=30.7 ms



   --- 192.31.7.130 ping statistics ---

   3 packets transmitted, 3 packets received, 0% packet

   loss

   round-trip min/avg/max = 30.7/33.9/38.5 ms

</PRE>

<!-- END CODE //-->

<BR>If your output is similar to this, your connection is working correctly.

</DL>

<P>To easily activate and deactivate a PPP interface, bash and ksh users can add the following aliases to their profile:

</P>

<!-- CODE SNIP //-->

<PRE>

alias activate-ppp=&#238;/etc/sysconfig/network-scripts/ifup-PPP&#238;

alias deactivate-ppp=&#238;/etc/sysconfig/network-scripts/ifdown-

PPP&#238;

</PRE>

<!-- END CODE SNIP //-->

<P>Users of csh and tcsh can add the following aliases to their .cshrc, to easily activate and deactivate the PPP interface:

</P>

<!-- CODE SNIP //-->

<PRE>

alias activate-ppp &#238;/etc/sysconfig/network-scripts/ifup-PPP&#238;

alias deactivate-ppp &#238;/etc/sysconfig/network-scripts/ifdown-

PPP&#238;

</PRE>

<!-- END CODE SNIP //-->



<TABLE BORDER="2" BORDERCOLOR="#0000" ALIGN="CENTER">

<TR><TD><FONT SIZE="+1"><B>Activating and deactivating an interface</B></FONT>

<BR>If the <TT>netcfg</TT> Interfaces window shows an interface as inactive, the window can be made active by clicking on the <B>Activate</B> button. Activating an interface is referred to as bringing up an interface.

<P>Similarly, if the Interfaces window shows an interface as active, the interface can be made inactive by clicking the <B>Deactivate</B> button in the Interfaces screen. Deactivating an interface is referred to as bringing an interface down.</TABLE>



</P>

<H3><A NAME="Heading7"></A><FONT COLOR="#000077">Adding a SLIP Interface</FONT></H3>

<P>The Serial Line Internet Protocol (SLIP) is another way of connecting two computers using IP. Setting up a SLIP interface is similar to setting up a PPP interface.

</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="443-446.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="451-455.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 + -