📄 lsg29.htm
字号:
<P>Following the TCP/IP question, Linux's configuration routine asks more questions. The exact questions differ depending on the version of Linux you have. Usually, you are asked whether you want support for several different types of networking, including whether you want network board TCP/IP network support (if you use a network card, such as an Ethernet board, answer y), SLIP and CSLIP support (if you plan on using SLIP, answer y), PPP support (again, if you plan to use PPP, answer y), and PLIP. (PLIP is a parallel-port version of SLIP/PPP, which is seldom used. Answer n unless you are only connecting two machines. See "Setting Up PLIP.") For most installations, answer y to all prompts for support except PLIP to configure your network any way you want. You will probably use SLIP and PPP at some time.
<BR>
<P>Versions of Linux later than 1.1.14 add more specific questions about network support, such as whether you want IP forwarding and gatewaying (answer n for this question unless your system acts as a gateway to another network). Your Linux version may ask about PC/TCP compatibility modes. Answer this question with n; it refers to an old incompatibility with ftp Software's PC/TCP PC client software product.
<BR>
<P>Some versions of Linux ask whether you want to enable RARP (Reverse Address Resolution Protocol), which allows remote terminals to obtain their IP addresses when they boot. In most cases, answer n to this question. The exception is if you have X terminals or diskless workstations attached directly to your Linux system. Another question asked with later versions of Linux relates to IPX protocol support. The IPX protocol is used with Novell NetWare; you can ignore it unless your Linux system is part of a NetWare network that doesn't use TCP/IP.
<BR>
<P>Other questions that may get asked relate to network masks, algorithms used, and dummy driver support, which is a loopback mechanism. In almost all cases, you are safe using the default answers provided by the configuration routine unless you specifically want to override a setting. If you indicated that your system is using a network adapter board, you are asked more questions about the type of support you need for the board. Most versions of Linux go through a series of popular network cards and ask which one you want support for. Choose the network card that matches yours, or choose one that is supported by emulation.
<BR>
<P>After you have specified all the protocols you want to support, the kernel rebuilds. The rebuilt kernel doesn't enable all the protocols, but it does add the drivers to the kernel. You still have to activate the protocols in the configuration routines and startup process.
<BR>
<BR>
<A NAME="E69E189"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Forcing a Network Card Recognition</B></FONT></CENTER></H4>
<BR>
<P>If the autoprobe routine in the Linux kernel doesn't recognize your network card, you must specifically tell it the network card's configuration. You can do this task by adding information to the boot process or by embedding configuration information within the startup information the kernel uses.
<BR>
<P>To add network card information to the boot process, use LILO. The routine lilo.conf (see <A HREF="lsg04.htm">Chapter 4</A>, "LILO") enables you to issue an append instruction, after which you can enter a line that provides the device parameters. The format for the instruction to add an Ethernet card is as follows:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">ether=IRQ,ADDRESS,PARM1,PARM2,NAME</FONT></PRE>
<P>In this code, IRQ is the IRQ setting, Address is the base I/O address of the network board, PARM1 and PARM2 are optional parameters that some boards use, and NAME is the name of the device. Usually boards use the optional parameters to set starting and ending addresses of shared memory boards (if they are supported), although some boards use them to set a debug level. For more information on the values to use for these parameters, see the list of network cards supported by Linux that is included with your Linux distribution, or check BBSs, FTP sites, or the Linux newsgroups on USENET.
<BR>
<P>This command format is quite easy to use. For example, after issuing the append instruction in lilo.conf, you can specify the following line:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">ether=5,0x220,0,0,eth0</FONT></PRE>
<P>This line sets the device /dev/eth0 with IRQ 5 and base address 220H. The zeros for the parameters mean no value for most boards. If you want LILO to invoke the kernel's autoprobe routine, leave the values for IRQ and the I/O address set to zero.
<BR>
<P>To embed configuration information within the startup information the kernel uses, edit the file drivers/net/Space.c in the kernel source code directory. (Some Linux versions use a different path, but the file Space.c should exist). Use this approach only if you are familiar with network boards and their settings. The LILO approach is much more preferable.
<BR>
<P>When you have the Linux kernel configured to handle the network board, reset the machine and watch the startup messages. These messages should include a message indicating the network board has been successfully found. (If the messages scroll by too quickly for you to read, use the dmesg command to recall them from the shell prompt.) For example, the following prompts are displayed during system boot to indicate recognition of a Novell NE2000 Ethernet card:
<BR>
<PRE>
<FONT COLOR="#000080">NE*000 ethercard probe at 0x300: 00 00 6e 24 1e 3e
eth0: NE2000 found at 0x300, using IRQ 15.</FONT></PRE>
<P>This message shows that the NE2000 card was found to have an IRQ of 15 and an I/O address of 300H.
<BR>
<BR>
<A NAME="E68E163"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Setting Up PLIP</B></FONT></CENTER></H3>
<BR>
<P>PLIP (Parallel Line IP) is a method of networking two machines together using their parallel ports. PLIP uses a special cable that allows sustained transfer speeds up to 20kbps. The cable required is a null printer cable that crosses some pins. The cables from parallel port versions of some PC-to-PC software packages like LapLink also work.
<BR>
<P>If you want to make your own PLIP cable, use the following pin-out settings at each end:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
connector 1 pin
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
connector 2 pin</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
2
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
15</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
3
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
13</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
4
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
12</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
5
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
10</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
6
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
11</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
1
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
5</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
1
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
6</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
12
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
4</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
13
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
3</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
15
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
2</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
25
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
25</FONT>
</TABLE><P>All other pins are unconnected. Disconnect the shielding at one end as well.
<BR>
<P>If you select the PLIP option in the kernel configuration, the device drivers for PLIP are set up as /dev/plip0 (IRQ 7, I/O 3BC), /dev/plip1 (IRQ 7, I/O 378), and /dev/plip2 (IRQ 5, I/O 278). The IRQ and base I/O address settings<A NAME="I2"></A> are those of the normal parallel port IRQs and addresses on a PC and shouldn't be changed unless you modified the parallel port settings in the Linux kernel. When you connect your machine to another machine, your machine's /dev/plip0 connects to /dev/plip1 on the other machine, and the other machine's /dev/plip0 connects to your machine's /dev/plip1.
<BR>
<BR>
<A NAME="E68E164"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Setting Up SLIP and PPP Serial Ports</B></FONT></CENTER></H3>
<BR>
<P>Both SLIP and PPP use a serial port that is already configured on the Linux system, so no hardware configuration is required. Before running SLIP or PPP, however, you should check that the serial ports are configured properly. The serial ports on the PC are recognized as /dev/cua when used to drive modems, so you can perform a quick directory check to see whether they are already configured for you. Use the command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">ls -l /dev/cua*</FONT></PRE>
<P>to display all the serial modem devices. You should see four devices configured, with the output shown like the following listing:
<BR>
<PRE>
<FONT COLOR="#000080">crw-rw-rw- 1 root root 5, 64 Mar 14 12:26 /dev/cua0
crw-rw-rw- 1 root root 5, 65 Mar 14 12:26 /dev/cua1
crw-rw-rw- 1 root root 5, 66 Mar 14 12:26 /dev/cua2
crw-rw-rw- 1 root root 5, 67 Mar 14 12:26 /dev/cua3</FONT></PRE>
<P>The dates and creation times may be different, but the device major and minor numbers, as well as the device names, should be the same. If these devices do not show up in your /dev directory, create them with the mknod command (see <A HREF="lsg06.htm">Chapter 6</A>, "Devices and Device Drivers"). For example, to set up the four devices shown in the preceding code, issue the following commands:
<BR>
<PRE>
<FONT COLOR="#000080">mknod -m 666 /dev/cua0 c 5 64
mknod -m 666 /dev/cua1 c 5 65
mknod -m 666 /dev/cua2 c 5 66
mknod -m 666 /dev/cua3 c 5 67
chown root.root /dev/cua*</FONT></PRE>
<P>The last command changes the ownerships of the device drivers. You can also set up a link to the device name /dev/modem with the following command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">ln /dev/cua0 /dev/modem</FONT></PRE>
<P>Substitute whichever device is your default modem device, such as /dev/cua1 if you haven't created a link between the device and /dev/modem. If you have a link between the modem device and the device called /dev/modem, don't use both /dev/modem and the actual device names intermingled in your software or device conflicts can occur. When you start one software application that uses /dev/modem, it creates a set of lock files for /dev/modem. If you then start another application using the device's real name, such as /dev/cua1, the second application creates lock files for /dev/cua1, not realizing the device is already in use under the name /dev/modem.
<BR>
<P>When Linux restarts, you should see messages during the system boot that show the PPP, PLIP, or SLIP device drivers (whichever were linked into the kernel) being loaded. You can replay the boot messages with the dmesg command. The following startup messages show the PPP and SLIP drivers:
<BR>
<PRE>
<FONT COLOR="#000080">PPP: version 0.2.7 (4 channels) NEW_TTY_DRIVERS OPTIMIZE_FLAGS
PPP line discipline registered.
SLIP: version 0.8.3-NET3.019-NEWTTY (4 channels) (6 bit encapsulation enabled)</FONT></PRE>
<P>Copyright messages and other status information may also be displayed, depending on the version of drivers your system is using.
<BR>
<BR>
<A NAME="E68E165"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>This chapter examined the changes that you must make to the kernel to provide networking support and create the hardware and device driver files necessary to run networks. After you reconfigure and reboot the kernel, and the kernel properly recognizes the new devices, you can go on to configure the network software.
<P ALIGN=LEFT>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -