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

📄 lsg29.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 2 页
字号:


<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>

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsg30.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg29.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E162" >Configuring the Kernel</A>







<UL>







<LI>







<A HREF="#E69E187" >Understanding Network Drivers</A>







<LI>







<A HREF="#E69E188" >Adding Network Support to the Kernel</A>







<LI>







<A HREF="#E69E189" >Forcing a Network Card Recognition</A></UL>







<LI>







<A HREF="#E68E163" >Setting Up PLIP</A>







<LI>







<A HREF="#E68E164" >Setting Up SLIP and PPP Serial Ports</A>







<LI>







<A HREF="#E68E165" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E33"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 29</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E36"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Configuring Hardware and the Kernel for Networking</B></FONT></CENTER></H2>







<BR>







<P>To network your Linux machine, you need to connect it to others. The last chapter showed you the basics of networking, as well as the different network topologies you can use for local area networks. The next step is to configure the hardware and Linux kernel for networking.







<BR>







<P>This chapter looks at the configuration settings you need to worry about on your Ethernet board (if you are using one) and the changes you need to make to the Linux kernel to invoke networking. Depending on the type of network and version of Linux you are using, the exact steps you need to take may differ slightly from the ones explained in this chapter, but the basic procedures are the same.







<BR>







<BR>







<A NAME="E68E162"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Configuring the Kernel</B></FONT></CENTER></H3>







<BR>







<P>Practically all Linux versions have a number of default configurations built into the boot disks. When you selected a boot kernel, you could have chosen one with the Linux networking drivers already installed and configured. If you knew in advance that you were going to use networking and you chose one of these boot kernels, you have little work to do to complete the configuration.







<BR>







<P>You probably didn't choose a networking kernel when you first installed Linux because you didn't know you would need the drivers for networking or you didn't have the proper configurations available. Luckily, you don't have to go back and reinstall your entire system. Instead, you can link in the networking drivers and rebuild the kernel.(If you have not added any peripherals or saved any files you want to keep, however, reinstalling may be the fastest approach).







<BR>







<P>In order to configure network hardware (an Ethernet board, most likely), you need to install the board in your machine with known IRQ, DMA, and I/O address values. These addresses are usually set on the network board with DIP switches or jumpers or with software (which usually works only under DOS) in more recent boards. Choose values for the IRQ, DMA, and I/O address that do not conflict with other boards or devices in your system.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>If you are unsure of what settings are available, watch the boot messages from Linux or use a utility under DOS like MSD or Norton Utilities to examine the hardware. If these methods don't help you determine available settings, make a good guess and use trial and error. Be warned that some network boards use the same DMA channel as popular SCSI controllers. If your network board is one of these and you don't change its DMA, the network board's instructions may overwrite data on your hard disk.</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<P>Many network boards have default values that work unless your system has a lot of additional cards installed. For example, many Ethernet boards default to values such as 15 for the IRQ and 300H for the I/O address. These values are not commonly used by sound cards, video capture boards, CD-ROM drivers, or SCSI cards. The IRQ setting is usually the easiest to select because a typical PC has only a few IRQ values preassigned, most of which are in the lower values from 1 to 7. The usual IRQ assignments for a basic AT-class machine (as opposed to the older XT class) are as follows:







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IRQ 3







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







COM2 (second serial port)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IRQ 4 







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







COM1 (first serial port)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IRQ 5







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







LPT2 (second parallel port)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IRQ 6







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Floppy controller</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IRQ 7







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







LPT1 (first parallel port)</FONT>







</TABLE><P>Because most machines have two serial ports and at least one parallel port, these IRQ values are not available for you to use. IRQ 5 is often used by bus mouse controller boards if a second parallel port is not installed on your system. SCSI controller boards often default to IRQ 11, and 16-bit sound cards frequently use IRQ 10 as a default value. The most commonly available IRQ for a network board is IRQ 15, which is often the board's default value.







<BR>







<P>I/O addresses for network boards are usually restricted to a few settings, and you have to choose one that doesn't conflict with other devices. The most common setting is 300-31FH (300 to 31F hexadecimal), although this setting is often used by default settings on sound cards. The only commonly reserved I/O address on PC machines is 360-37FH, which is used by LPT2, the second parallel port. If you have a sound card installed at 300H, switch your network card to use an alternate address such as 320-33FH or 340-35FH. Both address blocks are usually available on a PC unless you have installed special hardware.







<BR>







<P>Many recent network boards allow you to select between 8-bit and 16-bit modes. The 16-bit mode is the fastest and most versatile and is therefore the default for most network boards. If you have only an 8-bit slot available for the network board, set your board to use 8-bits only (many boards detect this change automatically).







<BR>







<P>Many Linux kernel network drivers use an autoprobe routine that can detect the network board and its settings at boot time. The autoprobe routine uses a set of checks for network board addresses. If this routine succeeds in finding your network card, you see messages about the driver during the boot stage. You can redisplay the boot messages at any time with the dmesg command. Sometimes the autoprobe routine doesn't work or causes problems. In that case, be ready to enter the IRQ, DMA, and I/O address in the configuration files manually.(See the section &quot;Forcing a Network Card Recognition&quot; for more information.)







<BR>







<BR>







<A NAME="E69E187"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Understanding Network Drivers</B></FONT></CENTER></H4>







<BR>







<P>The Linux kernel accesses network connections (whether an Ethernet board or a modem) through a device driver, which acts as an interface to the network service. Because the kernel can have many of these interfaces defined, including more than one per device driver, talking in terms of interfaces instead of device drivers helps to keep the concepts clear.







<BR>







<P>Each interface corresponds to a device driver file in the /dev directory. (The exception is SLIP device drivers, which are assigned dynamically and don't have a dedicated device driver file.) The Ethernet device drivers are usually called /dev/eth0, /dev/eth1, and so on. Each device driver can correspond to a different kind of device, so /dev/eth0 may be a device driver for an Intel Ethernet board, /dev/eth1 may be a device driver for a Novell Ethernet board, and so on. Alternatively, two or more boards can share the same device driver if they are the same kind of board. Usually, of course, a typical system has only one Ethernet board, and the device driver is designed for that board.







<BR>







<P>You may run into several different device driver names when using Linux. Knowing what the names mean helps you understand how they relate to the network protocols. The device driver names commonly encountered with Linux are as follows:







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







dl







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







D-Link DE-600 pocket adapters (an Ethernet device connecting to the parallel port)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







eth







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Ethernet boards</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







lo







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







A loopback driver (used primarily for testing and to maintain the network daemons when the network isn't active)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







ipx







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







IPX interfaces (for Novell NetWare compatibility)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







plip







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







PLIP interfaces (a parallel-port version of SLIP)</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







ppp







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







PPP interfaces</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







sl







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







SLIP interfaces</FONT>







</TABLE><P>All these device driver names are followed by a number, such as /dev/ppp0 /dev/ppp1, and so on to indicate whether it is the first, second, or higher device driver of that type. A few other device drivers are appearing for ISDN, X.25, and similar high-speed protocols, although they are not a part of most Linux distributions yet. You can usually obtain the latest device drivers from FTP or BBS sites.







<BR>







<BR>







<A NAME="E69E188"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Adding Network Support to the Kernel</B></FONT></CENTER></H4>







<BR>







<P>If you need to add or configure network drivers because the kernel doesn't have them or the autoprobe routine didn't work, run the kernel building routines again. (If you are not familiar with the kernel build process, check the documentation that came with your Linux system.) Change to the directory used to store your Linux source files, which usually is /usr/src/Linux, and then start the kernel build process with the command







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">make config</FONT></PRE>







<P>During the build routine (on all Linux kernels from version 1.0 and later), you are asked whether you want to include TCP/IP network support. Answer y to this question or the kernel will not be built with networking support.







<BR>







⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -