Linux Network Administrator Manual (3)

Source: Internet
Author: User
Article title: Linux Network Administrator Manual (3 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Chapter 3 Configure network hardware
3.1 devices, drivers, etc.
Till now, we have discussed many network interfaces and common TCP/IP problems, but they do not really include
What happens exactly when the "network code" in the kernel accesses a hardware. We will briefly discuss this.
Concepts about interfaces and drivers.
Of course, the first thing is the hardware itself, such as an Ethernet card: this is an epoxy board with many paste
A small digital chip, which is inserted into a slot on your PC. This is what we usually call a device.
To enable you to use this Ethernet card, your kernel must contain some special functions that know how to access
Ask the specific method of the device. These are the so-called device drivers. For example, Linux has several Ethernet card brands
Device drivers, which are similar in functionality. They are well known as "Becker series drivers", and their work
Who has the same name as Donald Becker ). Another example is the D-Link pocket adaptation for processing connections to parallel ports.
The D-Link driver of ingress.
But what do we mean when we say a driver "processes" a device? Let's go back to the Ethernet discussed above
Network card. The driver must be able to communicate with some logical circuits on the peripheral board: it must send messages to the board
And data, and the board should be able to transmit any received data to the driver.
. 1. the relationship between drivers, interfaces, and hardware.
In a PC, communication is performed by ing to the I/O memory (memory) of registers on the board. Kernel sent to board
All commands and data on the card must go through these registers. I/O memory usually uses the given start address or base address (
Base address. The typical base address of an Ethernet board is 0x300 or 0x360.
Generally, you don't have to worry about any hardware issues such as the base address, because the kernel will try to detect the card during boot.
The location of the base address. This is called autoprobing, which means that the kernel reads several memory locations and
The data to be read is compared with the data to be read if an Ethernet card is installed. However, some Ethernet cards cannot
It is detected dynamically. when other manufacturers use inexpensive Ethernet boards that are not completely copied according to standard boards
This may happen sometimes. Similarly, during boot, the kernel will only try to detect an Ethernet device. If you use
With more than one network card, you must explicitly inform the kernel of this network card.
You must tell the kernel another such parameter is the interrupt request channel ). When hard
When parts need to be taken care of, kernel operations are often interrupted, for example, when data arrives, or in a special situation
Birth time. In a PC, an interruption may occur on one of 15 interruption channels, ranging from 0, 1, and 3 to 15. Allocate
The interrupt number for a hardware part is called the interrupt request number or IRQ. [1]
  
As described in chapter 2, the kernel accesses a device through a so-called interface. The interface provides
Abstract function sets with the same hardware type, such as sending or receiving a datagram.
The interface is identified by name. These names are defined in the kernel, rather than in the device file under the/dev directory.
. For Ethernet interfaces, typical names include eth0 and eth1. Device Interface allocation usually depends on
Configure the device sequence. for example, the first installed Ethernet card will be eth0, and the next one will be eth1. This
An exception to a rule is the SLIP interface, which is dynamically allocated. that is, whenever a SLIP connection is established,
Assign an interface to the serial port.
The image shown in. 1 tries to show the relationship between hardware, device drivers, and interfaces.
During boot, the kernel displays the device detected and the interfaces it has installed. The following is a typical boot screen
Excerpt from the screen:
.
.
This processor honors the WP bit even when in supervisor mode. Good.
Floppy drive (s): fd0 is 1.44 M
Swansea University Computer Society NET3.010
IP Protocols: ICMP, UDP, TCP
PPP: version 0.2.1 (4 channels) OPTIMIZE_FLAGS
TCP compression code copyright 1989 Regents of the University of California
PPP line discipline registered.
SLIP: version 0.7.5 (4 channels)
CSLIP: code copyright 1989 Regents of the University of California
Dl0: D-Link DE-600 pocket adapter, Ethernet Address: 00: 80: C8: 71: 76: 95
Checking 386/387 coupling... OK, fpu using exception 16 error reporting.
Linux version 1.1.11 (okir @ monad) #3 Sat May 7 14:57:18 met dst 1994
This indicates that the kernel is compiled in the TCP/IP activation status and contains the SLIP, CSLIP, and PPP drivers. Inverted
The third line indicates that a D-Link pocket adapter is detected and installed as the interface dl0. If you have a different type
The kernel usually prints a line of information starting with eth0, followed by the card type detected.
If an Ethernet card has been installed but no such message is displayed, this indicates that the kernel cannot correctly detect
Output your Nic. This will be discussed in a later section.
3.2 kernel configuration
Most Linux versions have boot disks that can be used on all common PC-type hardware. This indicates that
The kernel on some disks is configured into all types of drivers, some of which you will never use, but they will
A waste of valuable system memory, because some kernels cannot be exchanged. Therefore, you usually configure your own
The core only includes the drivers you actually need or want.
When running a Linux system, you should be familiar with kernel creation. The basic principle of this work is in the "security
The installation and entry-level Manual is explained. This manual is also one of the document plan series. Therefore, in this section
, We will only discuss the configuration options that affect the network.
When running make config, you will first be asked about some common configurations, such as whether you need kernel mathematical simulation or not.
. One of these questions is whether you want TCP/IP network support. You must use y to answer the question to get a kernel that supports network connection.
  
3.2.1 kernel options for Linux 1.0 and later
After the common options are complete, the configuration continues to ask you about various features, such as the SCSI driver. Subsequent columns
Problems related to network support have occurred. Due to ongoing development and development, the exact configuration option set is constantly changing.
Moving. A typical list of options provided by most kernel versions 1.0 to 1.1 looks like this (annotations are Italic
Output ):
*
* Network device support
*
Network device support? (CONFIG_ETHERCARDS) [y]
Whatever the macro name in square brackets (macro name) is, if you want to use any type of connected devices, you
You must use y to answer this question, regardless of whether it is Ethernet, SLIP, or PPP. When you use y to answer this question
Support for Ethernet devices is automatically activated. Activation of other network driver types is required:
  
SLIP (serial line) support? (CONFIG_SLIP) [y]
SLIP compressed headers (SL_COMPRESSED) [y]
PPP (point-to-point) support (CONFIG_PPP) [y]
PLIP (parallel port) support (CONFIG_PLIP) [n]
These problems involve various link layer protocols supported by Linux. SLIP enables you to transmit IP datagram over a serial line.
The compression header option provides support for CSLIP, a technology that compresses the TCP/IP Header into only three bytes. Inside
The core option does not automatically open CSLIP, which only provides it with the required kernel functions.
PPP is another protocol for transmitting network traffic over a serial line. It is more flexible than SLIP and is not limited to IP addresses.
Once the development is complete, IPX is also supported. Since PPP support is only recently completed, this option may not appear in your
In the kernel.
PLIP provides a method to issue IP data packets over parallel port connections. It is mainly used to communicate with a PC running DOS
.
The following problems involve the Ethernet cards of various vendors. As more drivers are developed, you may see more
Many problems are added to this section. If you want to build a kernel that can be used on many different machines, you can activate
A driver.
NE2000/NE1000 support (CONFIG_NE2000) [y]
WD80 * 3 support (CONFIG_WD80x3) [n]
SMC Ultra support (CONFIG_ULTRA) [n]
3c501 support (CONFIG_EL1) [n]
3c503 support (CONFIG_EL2) [n]
3c509/32.169 support (CONFIG_EL3) [n]
Hp pclan support (fig) [n]
AT1500 and NE2100 (LANCE and Pcnet-ISA) support (CONFIG_LANCE) [n]
AT1700 support (CONFIG_AT1700) [n]
DEPCA support (CONFIG_DEPCA) [n]
D-Link DE600 pocket adaptor support (CONFIG_DE600) [y]
AT-LAN-TEC/RealTek poket adaptor support (CONFIG_ATP) [n]
*
* CD-ROM drivers
*
...
Finally, in the file system section, the configuration script will ask if you need to support NFS and network file systems. NFS allows
You output the file system to several hosts, which makes the files appear as if they are on a common hard disk of the host.
.
NFS filesystem support (CONFIG_NFS_FS) [y]
3.2.2 kernel options for Linux 1.1.14 and later
From Linux 1.1.14, where alpha support for IPX is added, the configuration process has changed slightly. In normal options
I will ask you if you need universal network support. This problem immediately becomes a problem with various network connection options.
*
* Networking options
*
TCP/IP networking (CONFIG_INET) [y]
To use a TCP/IP network, you must use y to answer this question. However, if you answer n, you will still be able to compile
Kernel with IPX.
IP forwarding/gatewaying (CONFIG_IP_FORWARD) [n]
You must activate this option if your system will be between two Ethernet networks or any Ethernet and SLIP links
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.