Detailed explanation of Linux system configuration network

Time:2022-5-2

IinstallAnd configurationnetworkequipment

IninstallIn Linux, if you have a network card,installThe program will prompt you to give the configuration parameters of TCP / IP network, such as local IP address, default gateway IP address, DNS IP address, etc According to these configuration parameters,installThe program will automatically compile the driver of the network card (first supported by Linux system) into the kernel However, we must understand the process of loading the network card driver, so it will be easy for us to change the network card and use multiple network cards in the futureoperationThe driver of the network card is loaded into the kernel as a module. All the network card drivers supported by Linux are stored in the directory / lib / modules / (Linux version number) / net /. For example, the driver of the 82559 series 10 / 100M adaptive boot network card of Inter is eepro100 o. The driver of 3Com’s isa network card is 3c509 o. The driver of dlink PCI 10 network card is via Rhine o. The driver of NE2000 compatible network card is ne2k PCI O and ne o. After we change the network card or add the basic driver file

  1. Modify the / etc / conf.modules file
This configuration file is an important parameter file for loading modules. Let’s take a look at an example file first
  #/etc/conf.modules
  alias eth0 eepro100
  alias eth1 eepro100
This file is the content of conf.modules in a Linux system with two inter 82559 series network cards The alias command indicates the name of the driver of the Ethernet port (such as eth0). Alias eth0 eepro100 indicates that the driver to be loaded on Ethernet port zero is eepro100 o. When using the command modprobe eth0,systemWill automatically eepro100 O load into the kernel For PCI network card, becausesystemThe IO address and interrupt number of the network card will be found automatically, so it is not necessary to use the option options in conf.modules to specify the IO address and interrupt number of the network card However, corresponding to the ISA network card, you must specify the IO address or interrupt number of the hardware in conf.modules, as shown below, indicating the conf.modules file of an ne isa network card
  alias eth0 ne
  options ne io=0x300 irq=5
After modifying the conf.modules file, you can use the command to load the module, such as the second network card to be inserted into the inter:
  #insmod /lib/modules/2.2.14/net/eepro100.o
In this way, the module eepro100 can be loaded on the Ethernet port o. At the same time, you can also use the command to view the currently loaded module information:
  [[email protected] /etc]# lsmod
  Module Size Used by
  eepro100 15652 2 (autoclean)
The returned result means that the currently loaded module is eepro100, with a size of 15652 bytes and two users. The method is automatic clearing