Article Title: Linux system network interface card installation and configuration introduction. 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.
You can use the following command to view your system version!
[Root @ localhost root] # uname-
Linux localhost 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
The NIC chips supported by linux after version 2.4 are already very comprehensive. Apart from some miscellaneous cards, the mainstream and second-stream are supported. You can use the following command to view the NIC chip driver supported by the system.
[Root @ localhost root] # ls/lib/modules/2.4.20-8/kernel/drivers/net/
3c501. o acenic. o de4x5. o eepro100.o hamradio ne. o ppp_synctty.o smc-ultra.o tun. o
3c503. o aironet4500_card.o de600.o eepro. o hp100.o netconsole. o r8169.o starfire. o via-rhine.o
3c505. o aironet4500_core.o de6316o eexpress. o hp. o ni5010.o rcpci. o strip. o wan
3c507. o aironet4500_proc.o defxx. o epic100.o hp-plus.o ni52.o sb1000.o sundance. o wavelan. o
3c509. o amd8111e. o depca. o eql. o irda ni65.o shaper. o sungem. o wd. o
3c515. o appletalk dgrs. o es3210.o lance. o ns83820.o sis900.o sunhme. o winbond-840.o
3c59x. o arlan. o dl2k. o eth16i. o lne390.o pcmcia sk98lin tc35815.o wireless
8139cp. o arlan-proc.o dmfe. o ethertap. o lp486e. o pcnet32.o skfp tg3.o wireless_old
8139too. o at1700.o dummy. o ewrk3.o mii. o plip. o slhc. o tlan. o yellowfin. o
82596. o atp. o e100 fc natsemi. o ppp_async.o slip. o tokenring
8390. o bonding. o e1000 fealnx. o ne2k-pci.o ppp_deflate.o smc9194.o tulip
Ac3200.o cs89x0. o e2100.o hamachi. o ne3210.o ppp_generic.o smc-ultra32.o (tulip_old)
Above. The o suffix file is the driver, and the directory without the suffix is used.
Generally, the NIC Driver Module is automatically loaded when the system starts. Sometimes, because the system does not have your chip driver, it is impossible for the system to load the NIC Driver Module. For beginners, it may have been debugging for a long time, but debugging is not good. In the end, the hard-installed linux system was deleted due to the inability to access the Internet. You can run the following command to check whether the NIC Driver Module is loaded.
[Root @ localhost root] # lsmod
Module Size Used by Not tainted
Es1371 30792 0 (autoclean)
Ac97_codec 13640 0 (autoclean) [es1371]
Gameport 3364 0 (autoclean) [es1371]
Soundcore 6404 4 (autoclean) [es1371]
Ppp_synctty 7904 0 (unused)
Ppp_async 9440 1
Ppp_generic 24444 3 [ppp_synctty ppp_async]
Slhc 6740 0 [ppp_generic]
Parport_pc 19076 1 (autoclean)
Lp 8996 0 (autoclean)
Parport 37056 1 (autoclean) [parport_pc lp]
Autofs 13268 0 (autoclean) (unused)
PC 32 18240 1
Mii 3976 0 [pcnet32]
Ipt_REJECT 3928 6 (autoclean)
Iptable_filter 2412 1 (autoclean)
Ip_tables 15096 2 [ipt_REJECT iptable_filter]
Sr_mod 18136 0 (autoclean)
Ide-scsi 12208 0
Ide-cd 35708 0
Cdrom 33728 0 [sr_mod ide-cd]
Keybdev 2944 0 (unused)
Mousedev 5492 1
Hid 22148 0 (unused)
Input 5856 0 [keybdev mousedev hid]
Usb-uhci 26348 0 (unused)
Usb core 78784 1 [hid usb-uhci]
Ext3 70784 2
Jbd 51892 2 [ext3]
Mptscsih 37392 3
Mptbase 41792 3 [mptscsih]
Sd_mod 13452 6
Scsi_mod 107128 4 [sr_mod ide-scsi mptscsih sd_mod]
The red part is my Nic, Because I installed it on a virtual machine. Therefore, the module name is pcnet32. Find the NIC module and see that there is no (unused) at the end. This indicates that the network adapter has been loaded successfully. You may ask, how can I know the name of the NIC Driver Module? It is actually found by command. The command is as follows:
[Root @ localhost root] # lspci
00:00. 0 Host bridge: Intel Corp. Sort BX/ZX/DX-Sort 43bx/ZX/DX Host bridge (rev 01)
00:01. 0 PCI bridge: Intel Corp. Sort BX/ZX/DX-Sort 43bx/ZX/dx agp bridge (rev 01)
00:07. 0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 08)
. 1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07. 2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB
. 3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 08)
00: 0f. 0 VGA compatible controller: VMWare Inc: Unknown device 0405
00:10. 0 SCSI storage controller: LSI Logic/Symbios Logic 53c1030 (rev 01)
. 0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
. 0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
If you see the network card type, but it is not loaded, you can use the following command to load
[Root @ localhost root] # modprobe pcnet32
If an error occurs, the module does not exist. In this case, you should find the correct module and recompile it. If your Nic is a miscellaneous card, you cannot find the driver for linux on the official website. Then you can copy the largest chip model on your network card. Find the compatible chip driver!
Now the NIC driver is installed and loaded. Then, you need to set the IP address information. You can set IP addresses for linux NICs as needed. I will introduce three methods.
1. Command mode
[Root @ localhost root] # ifconfig eth0 192.168.0.1 netmask 255.255.255.0
The command mode is valid only for this start. You must reset the command to shut down or restart the instance.
2. Text Graphics Mode
[Root @ localhost root] # netconfig
This method is permanently saved.
3. Graphic Interface
[Root @ localhost root] # neat
This method is used by most people, because it is set in the graphic interface, and you can set ADSL and other ways to access the Internet. Of course there are other methods, such as modifying the configuration file! But I will not write it here.