Introduction to Linux Nic Configuration

Source: Internet
Author: User

Linux supports NICs through the kernel. In the early days, many people directly add Nic support during compilation. However, with the increase of NIC types, few have used this thankless method. Currently, most people use the NIC module to drive the NIC. In order to join the network card, you must first know the network card type. in Linux, the support for the broken "NE 2000 compatible" network card is indeed good, but it is not easy to say about a MB Nic. You can always select a suitable product through experiments. First, you need to know the chip model of the NIC. Because the hardware vendor generally does not provide the Linux driver of the NIC, You must select the correct driver for the NIC. Many people like to say "ah, it's D-Link." This is probably the most annoying statement you can hear in Linux, similar to the famous "in the air" answer, it is absolutely correct and absolutely meaningless. You can first check the type of your network card. If it is a 3COM 3C series "Hardcore" product, you do not need to know more about the model. There will certainly be a corresponding driver in Linux. Go to/lib/modules/x. x. xx/net (x. x. xx is the Linux kernel version number in Linux) to check whether the driver should be used. For example, the 3C509 driver is 3c509. o if it is ne2000 compatible, then generally you only need to use the ne2000 driver, the name of this driver is ne. o, there are also many 10 mb pci NICs that belong to the "NE2000-PCI" compatible type, the corresponding driver name is ne2k-pci.o. If not, you need to guess a suitable Nic model. The main controller chip of the NIC is usually the largest one.) The Model of the chip is marked, next, go to/lib/modules/2.2.14/net (I am using the 2.2.14 kernel, your kernel version may be different) and find the appropriate driver name. The next step is to test the NIC. For example, my NIC Driver is rtl8139.o, which is a pci m Nic, therefore, run the/sbin/modprobe rtl8139 path name/lib/modules/2.2.14/net and the extension. o can be omitted. In this case, this command returns directly without generating any output, indicating that the module has been correctly loaded into the kernel storage zone. If you want to confirm, you can use the dmesg command to check the kernel output. There will be such content: rtl8139.c: v1.07 5/6/99 Donald Becker restart RealTek RTL8139 Fast Ethernet at 0xd800, IRQ 19, 00: 50: ba: d0: 8d: ec. this indicates that the NIC has been activated. Some ISA NICs, especially ne2000 compatible NICs, need to explicitly provide some configuration parameters. For example, to activate a ne2000 compatible Nic, you need to provide an I/O address. You can use this format: /sbin/modprobe ne io = 0x300 it is assumed that the ne2000 compatible Nic is at the I/O address 0x300. IRQ does not need to be specified. Linux returns the correct value. For specific Nic parameters, refer to the driver source code. If the NIC driver program is incorrect or the parameters are incorrect, the error message [openlab] #/sbin/modprobe 3c509/lib/modules/2.2.14/net/3c509 is displayed. o: init_module: Device or resource busy in some systems, use/etc/conf. the modules file to set the default Nic parameters, for example, $ cat conf. the modulesalias eth0 neoptions ne io = 0x300options command provides the default parameters for the module. In the future, you only need to execute/sbin/modprobe ne or/sbin/modprobe eth0 to automatically use the parameter. If you have determined the NIC Driver through the above process and the test is correct, you should put it in the system startup script. As mentioned above, for RedHat or Slackware, the module files you choose can usually be stored in/etc/rc. d/rc. in modules, the content is simply the command used to load the module. For example, my system has two NICs that use the rtl8139 and ne2000 drivers respectively, the I/O address of the ne2000 compatible Nic is 0x300. the content of modules is [openlab] # cat/etc/rc. d/rc. modules/sbin/modprobe rtl8139/sbin/modprobe ne io = 0x300 do not forget to set the executable attributes of this script. When the system restarts, it will automatically execute this script. You can use dmesg to check whether the execution is correct after the system starts. If your Linux Startup Script does not use rc. modules, you can always put it in rc. sysinit or rc.

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.