Note: 1. The dual system is installed on the computer: xp and centos5.12. you can access the Internet under xp, but you cannot access the Internet under centos5.1. 3. In centos5.1, you cannot ping the gateway. 4. In xp, the NIC is set to ip: 192.168.1.57 mask: 255.255.255.0 Gateway: 192.168.1.10DNS: 192.168.1.10. In centos5.1, the NIC information is [root @ localhost ~]. # Ifconfig-aeth0 Link encap: Ethernet HWaddr 00: E0: 4C: 2A: 2E: 0C inet addr: 192.168.1.57 Bcast: 192.168.1.255 Mask: 255.255.0 inet6 addr: fe80: 2e0: 4cff: fe2a: 2e0c/64 Scope: Link up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 1511 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 304 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 0 RX bytes: 139496 (136.2 KiB) TX bytes: 3292 2 (32.1 KiB) view Gateway: [root @ localhost ~] # Vi/etc/sysconfig/network-scripts/ifcfg-eth0 # Realtek semiconduco ., ltd. RTL8101E PCI Express Fast Ethernet controllerDEVICE = eth0ONBOOT = yesBOOTPROTO = noneHWADDR = 00: e0: 4c: 2a: 2e: 0 cTYPE = ethernetmask = 255.255.255.0IPADDR = 192.168.1.57GATEWAY = 192.168.1.1USERCTL = no00006init = noPEERDNS = yes view DNS: [root @ localhost ~] # Cat/etc/resolv. confsearch localdomain you can find that the original gateway and DNS are incorrect. After the change, restart the network service: [root @ localhost ~] # Service network restartShutting down interface eth0: [OK] Shutting down loopback interface: [OK] Disabling IPv4 packet forwarding: net. ipv4.ip _ forward = 0 [OK] Bringing up loopback interface: [OK] Bringing up interface eth0: [OK] [root @ localhost ~] # Ping 192.168.1.10PING 192.168.1.10 (192.168.1.10) 56 (84) bytes of data.64 bytes from 192.168.1.10: icmp_seq = 1 ttl = 64 time = 0.475 ms64 bytes from 192.168.1.10: icmp_seq = 2 ttl = 64 time = 0.324 MS --- 192.168.1.10 ping statistics --- 2 packets transmitted, 2 pinned ed, 0% packet loss, time 999 msrtt min/avg/max/mdev = 0.324/0.399/0.475/0.078 MS [root @ localhost ~] # Ping www. baidu. comPING www.a.shifen.com (119.75.217.56) 56 (84) bytes of data.64 bytes from 119.75.217.56: icmp_seq = 1 ttl = 54 time = 22.8 ms64 bytes from 119.75.217.56: icmp_seq = 2 ttl = 54 time = 25.3 ms64 bytes from 119.75.217.56: icmp_seq = 3 ttl = 54 time = 25.2 MS --- www.a.shifen.com ping statistics --- 3 packets transmitted, 3 encoded ed, 0% packet loss, time 1998 msrtt min/avg/max/mdev = 22.829/24.474/25.332/1.170 MS author xiangbei1573