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

📄 443-446.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=443-446//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch26/439-442.html">Previous</A></TD>

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

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

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H2><A NAME="Heading1"></A><FONT COLOR="#000077">CHAPTER 27<BR>Managing Network Connections

</FONT></H2>

<P><I>By Sriranga Veeraraghaven</I></P>

<DL>

<DD>Setting the hostname

<DD>Enabling the loopback interface

<DD>Adding a PPP interface

<DD>Adding a SLIP interface

<DD>Adding a PLIP interface

<DD>Adding an ethernet interface

</DL>

<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Configuring Network Connections</FONT></H3>

<P>Managing network connections with Red Hat Linux is straightforward, thanks to the user-friendly Network Configuration tool <TT>netcfg</TT>. This tool provides for the enabling and configuring of network connections in a graphical interface.</P>

<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">Using the Network Configuration Tool</FONT></H4>

<P>To launch <TT>netcfg</TT>, type the following at root&#146;s prompt:</P>

<!-- CODE SNIP //-->

<PRE>

<B># netcfg</B>

</PRE>

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

<P>When <TT>netcfg</TT> launches, the following is displayed in the terminal window:</P>

<!-- CODE SNIP //-->

<PRE>

Red Hat Linux netcfg 2.13

Copyright (C) 1996 Red Hat Software

Redistributable under the terms of the GNU General Public

License

</PRE>

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



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

<TR><TD>

<P><B>Run <TT>netcfg as root</TT></B><BR>It is important that root run <TT>netcfg</TT>; otherwise, the modifications made to the network will not be applied.</TABLE>



</P>

<P>After the program finishes loading, the Network Configurator window (shown in Figure 27.1) is displayed.</P>

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

<BR><A HREF="javascript:displayWindow('images/27-01.jpg',537,383)"><FONT COLOR="#000077"><B>Figure 27.1</B></FONT></A>&nbsp;&nbsp;This screen shows the main netcfg window.</P>

<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">Setting the Hostname and the Domain Name</FONT></H4>

<P>When <TT>netcfg</TT> is running, setting a machine&#146;s hostname is simple. Just click in the Hostname text field and type the name you want to give the machine. To save the hostname, click the <B>Save</B> button.</P>

<P>To set the domain name, click in the Domain text field and type your domain. To save the domain name, click the <B>Save</B> button.</P>

<P>In addition to setting the hostname and the domain name, the main window enables you to set the name servers that the local machine uses to translate hostnames into IP addresses. To add a name server, click in the Nameservers text area and type the IP address of your name server (this address should be given to you by your ISP or company).</P>



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

<TR><TD><FONT SIZE="+1"><B>Set the hostname and domain name correctly</B></FONT>

<BR>For most people, hostnames and domain names are provided by their Internet service provider or their school/business. In such cases, it is important that the name entered in the Hostname and the Domain field is the same as the name provided by the ISP or other entity.</TABLE>



<H4 ALIGN="LEFT"><A NAME="Heading5"></A><FONT COLOR="#000077">Enabling the Loopback Interface</FONT></H4>

<P>The loopback interface is used by the computer to make connections to itself. Information requests made by computers using the Internet Protocol go through interfaces. If a computer wants to get information from itself, the fastest way to obtain this information is to have a software interface. 

</P>

<P>The easiest way to set up this interface is to use the <TT>ifconfig</TT> and <TT>route</TT> commands, like so:</P>

<!-- CODE SNIP //-->

<PRE>

# ifconfig lo 127.0.0.1

# route add -host 127.0.0.1 lo

</PRE>

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

<P>The <TT>ifconfig</TT> command tells the computer to enable the interface <TT>lo</TT> (short for loopback) with an IP address of 127.0.0.1. The <TT>route</TT> command tells the computer to add a route to the host 127.0.0.1 through the interface <TT>lo</TT>. When these commands have been executed, you can test whether the loopback address is working by typing the following:</P>

<!-- CODE SNIP //-->

<PRE>

<B># ping 127.0.0.1</B>

</PRE>

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

<P>This results in the following output:

</P>

<!-- CODE SNIP //-->

<PRE>

127.0.0.1 is alive

</PRE>

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

<P>When the loopback interface has been configured, it must be named.

</P>



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

<TR><TD><FONT SIZE="+1"><B>Make sure the loopback interface has the right IP address</B></FONT>

<BR>The loopback interface is always assigned the IP address 127.0.0.1. This standardization means you can be sure that connections made to the IP address 127.0.0.1 are always made to the local computer, not some other computer.</TABLE>



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

<DL>

<DD><B>1.</B>&nbsp;&nbsp;Launch <TT>netcfg</TT> and click the <B>Hosts</B> button in the main window. You&#146;ll see the screen shown in Figure 27.2.

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

<BR><A HREF="javascript:displayWindow('images/27-02.jpg',537,383)"><FONT COLOR="#000077"><B>Figure 27.2</B></FONT></A>&nbsp;&nbsp;This <TT>netcfg</TT> window is used to configure Host attributes.

</P>

<DD><B>2.</B>&nbsp;&nbsp;Click the entry for <TT>127.0.0.1</TT>. The Edit/etc/hosts Window, shown in Figure 27.3, appears.

<P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/27-03.jpg',271,134 )"><IMG SRC="images/27-03t.jpg"></A>

<BR><A HREF="javascript:displayWindow('images/27-03.jpg',271,134)"><FONT COLOR="#000077"><B>Figure 27.3</B></FONT></A>&nbsp;&nbsp;Give the loopback interface a name.</P>

<DD><B>3.</B>&nbsp;&nbsp;Type <B>localhost</B> in the Name field. Optionally, type <B>loopback</B> in the Nicknames field.

<DD><B>4.</B>&nbsp;&nbsp;Click <B>Done</B>, and then click the <B>Save</B> button. The changes you made will be saved.

</DL>

<P>This process can be used to give names to other IP addresses as well, but very few IP addresses need to be named on systems using name servers.

</P>

<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Adding a PPP Interface</FONT></H4>

<P>The Point-to-Point Protocol (PPP) is a method of creating and running IP over a serial link made using modems and phone lines. With PPP, a client connects to a PPP server. When connected, the client can access resources on the PPP server&#146;s network as though it were connected directly to the network. PPP is one of the most common ways for personal computers to connect to the Internet.

</P>



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

<TR><TD><FONT SIZE="+1"><B>TCP/IP connections over serial lines</B></FONT>

<BR>The three common protocols for running TCP/IP on serial or parallel lines are the Point-to-Point Protocol (PPP), the Serial Line Internet Protocol (SLIP), and the Parallel Line Internet Protocol (PLIP).

<P>Of these, SLIP is the oldest and has problems dealing with noisy low-speed telephone lines. SLIP predates the standardization process for protocols, so it is not considered one of the Internet standard protocols.

</P>

<P>The Internet standard replacement for SLIP is PPP. This protocol provides similar functionality to SLIP, but in a reliable manner over all types of phone lines. Currently, PPP is the most widely used protocol for running TCP/IP over phone lines.</P>

<P>PLIP is a variant of SLIP, which enables TCP/IP to be run over the parallel port of a computer. PLIP is faster than PPP or SLIP but is not widely used for connecting computers over phone lines.</TABLE>



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

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="../ch26/439-442.html">Previous</A></TD>

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

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