A CENTOS5 machine is installed in the house and cannot access the Internet. Because there is no time to get this. New jobs are busy. I took the time to get it done this evening.
My motherboard is a AMD690G-AM2.
1. Check whether the NIC is loaded when the system starts.
Dmesg | grep eth0 (because I only have one Nic)
If something is displayed, you don't need to read it because your Nic has already been recorded. That is why you have not configured the IP address and DNS.
2. the kernel source code is required during Nic compilation, and the corresponding GCC compiler is also required.
If not, go to [url] http://www.kernel.org/#/url#to download the corresponding machine. (Run the uname-r command to view the kernel)
I have an RPM package. So I don't need.
Kernel
[Root @ localhost kernel] # rpm-qa | grep kernel
Kernel-xen-devel-2.6.18-8.el5
Kernel-2.6.18-8.el5
Kernel-xen-2.6.18-8.el5
Kernel-headers-2.6.18-8.el5
[Root @ localhost kernel] # rpm-ivh kernel-devel-2.6.18-8.el5.x86_64.rpm
Warning: kernel-devel-2.6.18-8.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ######################################## ### [100%]
1: kernel-devel ##################################### ###### [100%]
In this case, check the/usr/src/directory.
Now your kernel source code is installed.
GCC Section
[Root @ localhost 2.6.18-8. el5] # whereis-B gcc
Gcc:/usr/bin/gcc/usr/lib/gcc/usr/libexec/gcc
If there is no output, you have to install GCC. Go to [url] http://www.gnu.org/#/url#to download the file.
3. Download the NIC Driver. It is best to go to the site corresponding to the chip and decompress the package:
[Root @ localhost David _yeung] # tar jxvf r8169-6.003.00.tar.bz2
.....
4. Read the README files in the directory after the installation is complete (this is a good habit and can solve many Software Installation Problems in LINUX in principle)
Start Compilation
If the previous steps are complete, there will be no errors.
Make
Make install
Depmod-
[Root @ localhost src] # pwd
/Home/David _yeung/r8169-6.003.00/src
[Root @ localhost r8169-6.003.00] # insmod./src/r8169.ko
Check whether the load is successful:
[Root @ localhost r8169-6.003.00] # lsmod | grep r8169
R8169 65936 0
After successful Loading
View information
Because I have already configured the IP address. If no IP address is configured, use netconfig or system-config-network-tui to configure the specific IP address.
[Root @ localhost r8169-6.003.00] # ifconfig-
Eth0 Link encap: Ethernet HWaddr 00: E0: 4C: 41: 17: FF
Inet addr: 192.168.0.131 Bcast: 192.168.0.255 Mask: 255.255.255.0
Up broadcast multicast mtu: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)
Interrupt: 209 Base address: 0xe000
Lo Link encap: Local Loopback
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Inet6 addr: 1/128 Scope: Host
Up loopback running mtu: 16436 Metric: 1
RX packets: 2265 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 2265 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 2748320 (2.6 MiB) TX bytes: 2748320 (2.6 MiB)
Sit0 Link encap: IPv6-in-IPv4
Noarp mtu: 1480 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)
5. Enable Automatic Nic loading with the System
[Root @ localhost src] # vi/etc/modprobe. conf
Alias scsi_hostadapter ahci
Alibaba snd-card-0 snd-hda-intel
Options snd-card-0 index = 0
Options snd-hda-intel index = 0
Remove snd-hda-intel {/usr/sbin/alsactl store 0>/dev/null 2> & 1 || :;}; /sbin/modprobe-r -- ignore-remove snd-hda-intel
Alias eth0 r8169
Add this sentence and then reboot.
This article is from "god, let's see it !" Blog, please be sure to keep this source http://yueliangdao0608.blog.51cto.com/397025/82190