Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh
点击翻译: |
English {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/af | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Afrikaans| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ar | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|العربية| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/az | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|azərbaycanca| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/bcc | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|جهلسری بلوچی| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/bg | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|български| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/bg|български]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/br | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|brezhoneg| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ca | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|català| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ca|català]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/cs | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|čeština| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/de | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Deutsch| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/el | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Ελληνικά| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/es | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|español| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/es|español]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/fa | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|فارسی| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/fi | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|suomi| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/fr | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|français| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/fr|français]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/gu | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|ગુજરાતી| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/he | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|עברית| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/he|עברית]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/hu | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|magyar| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/id | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Bahasa Indonesia| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/it | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|italiano| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/it|italiano]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ja | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|日本語| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ko | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|한국어| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ksh | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Ripoarisch| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/mr | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|मराठी| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ms | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Bahasa Melayu| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/nl | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Nederlands| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/no | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|norsk| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/no|norsk]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/oc | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|occitan| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/pl | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|polski| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/pl|polski]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/pt | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|português| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/pt|português]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ro | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|română| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ro|română]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/ru | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|русский| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/ru|русский]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/si | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|සිංහල| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/sq | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|shqip| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/sr | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|српски / srpski| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/sv | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|svenska| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/th | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|ไทย| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/tr | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Türkçe| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/vi | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|Tiếng Việt| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/yue | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|粵語| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/zh | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|中文| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/zh|中文]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/zh-hans | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|中文(简体)| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting | Quick HOWTO : Ch04 : Simple Network Troubleshooting | {{#if: | :}}Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh}}/zh-hant | • {{#if: Quick HOWTO : Ch04 : Simple Network Troubleshooting|中文(繁體)| [[::Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:Quick HOWTO : Ch04 : Simple Network Troubleshooting|:Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/zh | | {{#ifexist: Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh/zh | | {{#ifeq: {{#titleparts:Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Quick HOWTO : Ch04 : Simple Network Troubleshooting/zh|1|-1|}} | zh | | }}
Introduction简介
You will eventually find yourself trying to fix a network related problem which usually appears in one of two forms. The first is slow response times from the remote server, and the second is a complete lack of connectivity. These symptoms can be caused by:
你最终会发现你试图修正的网络问题经常以两种形式出现。第一种是来自远程服务器的慢速响应,第二种是完全失去连接。这些症状会是由一下原因引起的:
Sources of Network Slowness 网络慢的根源
- NIC duplex and speed incompatibilities 网卡的双工和速度的不兼容
- Network congestion 网络涌堵
- Poor routing 路由问题
- Bad cabling 线缆问题
- Electrical interference 电阻
- An overloaded server at the remote end of the connection 远端服务器负载过重
- Misconfigured DNS (Covered in Chapter 18, "<a href="Quick HOWTO : Ch18 : Configuring DNS">Configuring DNS</a>" and Chapter 19, "<a href="Quick HOWTO : Ch19 : Dynamic DNS">Dynamic DNS</a>")DNs配置问题(参考18章“配置DNS”和19章“动态DNS”)
Sources of a Lack of Connectivity 连接丢失的根源
All sources of slowness can become so severe that connectivity is lost. Additional sources of disconnections are:
所有网络慢的原因严重时都可以导致连接丢失。额外的原因包括:
- Power failures 电源问题
- The remote server or an application on the remote server being shut down. 远端的服务器或程序被关掉
We discuss how to isolate these problems and more in the following sections.我们会讨论如何隔离这些问题,在以後的章节中会有更详细的讨论。
Doing Basic Cable and Link Tests做一些基本的连接测试
Your server won't be able to communicate with any other device on your network unless the NIC's "link" light is on. This indicates that the connection between your server and the switch/router is functioning correctly.
你的服务器只有在网卡的连接指示灯亮的时候才可以和其他设备进行通信。这个指示灯表明服务器和交换机或路由器的连接是正常的。
In most cases a lack of link is due to the wrong cable type being used. As described in Chapter 2, "<a href="Quick HOWTO : Ch02 : Introduction to Networking">Introduction to Networking</a>", there are two types of Ethernet cables crossover and straight-through. Always make sure you are using the correct type.
在大多数情况下,网络不通是因为用了错误的线缆所致。正如我们在第二章描述的,存在两种线:交叉线和直通线。一定要确保你使用了正确的线缆。
Other sources of link failure include:其他的一些原因包括:
- The cables are bad.线缆坏了。
- The switch or router to which the server is connected is powered down.服务器连接的交换机或路由器停掉了。
- The cables aren't plugged in properly.线缆没有插好。
If you have an extensive network, investment in a battery-operated cable tester for basic connectivity testing is invaluable. More sophisticated models in the market will be able to tell you the approximate location of a cable break and whether an Ethernet cable is too long to be used.
如果你有外网,投资买一个电池驱动的线缆测试仪是非常值得的。市面上一些好的模型可以告诉你线缆坏的大概位置以及用的线缆是否过长。
Testing Your NIC测试你的网卡
It is always a good practice in troubleshooting to be versed in monitoring the status of your NIC card from the command line. The following sections introduce a few commands that will be useful.
在排障的过程中,从命令行监视你网卡的状态是一个很好的习惯。下面的章节将会介绍一些非常有用的命令。
Viewing Your Activated Interfaces查看你激活的网卡。
The ifconfig command without any arguments gives you all the active interfaces on your system. Interfaces will not appear if they are shut down:
ifconfig命令不加任何参数会显示你系统上活动的网卡。那些没有激活的网卡将不会被显示。
[root@bigboy tmp]# ifconfig
Note: Interfaces will appear if they are activated, but have no link. We'll soon discuss how to determine the link status using commands.
注意:那些被激活但没有连接的网卡也会被显示。我们待会讨论如何查看连接的状态。
Viewing All Interfaces 查看所有的网卡。
The ifconfig -a command provides all the network interfaces, whether they are functional or not. Interfaces that are shut down by the systems administrator or are nonfunctional will not show an IP address line and the word UP will not show in the second line of the output. This can be seen in the next examples:
ifconfikg -a 会显示所有的网卡设备,不管他们是否被激活。那些没有被系统管理员激活或没有功用的网卡将不会显示ip地址这一行,同时UP这个词也不会在第二行的输出中显示。下面的例子说明了这个现象:
- Shut Down Interface显示没有激活的网卡
wlan0 Link encap:Ethernet HWaddr 00:06:25:09:6A:D7 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:2924 errors:0 dropped:0 overruns:0 frame:0 TX packets:2287 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:180948 (176.7 Kb) TX bytes:166377 (162.4 Kb) Interrupt:10 Memory:c88b5000-c88b6000
- Active Interface 激活的网卡
wlan0 Link encap:Ethernet HWaddr 00:06:25:09:6A:D7 inet addr:216.10.119.243 Bcast:216.10.119.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2924 errors:0 dropped:0 overruns:0 frame:0 TX packets:2295 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:180948 (176.7 Kb) TX bytes:166521 (162.6 Kb) Interrupt:10 Memory:c88b5000-c88b6000
Testing Link Status from the Command Line从命令行来测试连接的状态
Both the mii-tool and ethtool commands command will provide reports on the link status and duplex settings for supported NICs.
When used without any switches, the mii-tool gives a very brief report. Use it with the -v switch because it provides more information on the supported autonegotiation speeds of the NIC and this can be useful in troubleshooting speed and duplex issues.
The ethtool command provides much more information than mii-tool and should be your command of choice, especially because mii-tool will be soon deprecated in Linux. In both of the following examples the NICs are operating at 100Mbps, full duplex and the link is ok.
mii-tool和ethtool这两个命令会提供一个连接状态和双工设置的报告。
mii-tool不加任何参数会提供一个简短的报告。当加上-v这个参数时,因为它提供了关于网卡是否支持全自动等更详细的信息,这在解决网络速度和双工等排障的过程中非常有用。
ethtool命令相对mii-tool命令提供了更详细的信息,尤其是mii-tool可能将来在linux中不再得到支持的情况下,ethtool应该成为你的不二选择。
下面的两个例子中,网卡都是100Mbps的传输速度,全双工,连接状态是正常的。
Link Status Output from mii-tool mii-tool的连接状态输出
[root@bigboy tmp]# mii-tool -v eth0: 100 Mbit, full duplex, link ok product info: Intel 82555 rev 4 basic mode: 100 Mbit, full duplex basic status: link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 100baseTx-HD [root@bigboy tmp]#
Link Status Output from ethtool ethtool的连接状态输出
[root@bigboy tmp]# ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Advertised auto-negotiation: No Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: internal Auto-negotiation: off Supports Wake-on: g Wake-on: g Current message level: 0x00000007 (7) Link detected: yes [root@bigboy tmp]#
Viewing NIC Errors 查看网卡的错误信息
Errors are a common symptom of slow connectivity due to poor configuration or excessive bandwidth utilization. They should always be corrected whenever possible. Error rates in excess of 0.5% can result in noticeable sluggishness.
错误是网络慢的常见标志,这可能是由不合适的网卡配置和带宽的过度利用造成的。只要在可能的情况下这都应该得到纠正。超过0.5%的错误率会导致显着的缓慢。
Ifconfig Error Output Ifconfig的错误输出
The ifconfig command also shows the number of overrun, carrier, dropped packet and frame errors.
ifconfig命令显示了overrun,carrier,dropped packjet和frame errors的数量
wlan0 Link encap:Ethernet HWaddr 00:06:25:09:6A:D7 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:2924 errors:0 dropped:0 overruns:0 frame:0 TX packets:2287 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:180948 (176.7 Kb) TX bytes:166377 (162.4 Kb) Interrupt:10 Memory:c88b5000-c88b6000
ethtool Error Output ethtool的错误输出
The ethtool command can provide a much more detailed report when used with the -S switch.
ethtool命令当加上-S参数时提供了更详细的信息。
[root@probe-001 root]# ethtool -S eth0 NIC statistics: rx_packets: 1669993 tx_packets: 627631 rx_bytes: 361714034 tx_bytes: 88228145 rx_errors: 0 tx_errors: 0 rx_dropped: 0 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 0 rx_missed_errors: 0 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_deferred: 0 tx_single_collisions: 0 tx_multi_collisions: 0 tx_flow_control_pause: 0 rx_flow_control_pause: 0 rx_flow_control_unsupported: 0 tx_tco_packets: 0 rx_tco_packets: 0 [root@probe-001 root]#
netstat Error Output
The netstat command is very versatile and can provide a limited report when used with the -i switch. This is useful for systems where mii-tool or ethtool are not available.
netstat命令是有非常多用途的命令,当加上-i参数时可以提供一个简短的报告。这在系统缺少mii-tool和ethtool工具时是非常有用的。
[root@bigboy tmp]# netstat -i Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0 1500 0 18976655 2 0 0 21343152 142 0 3 BMRU eth1 1500 0 855154 0 0 0 15196620 0 0 0 BMRU lo 16436 0 1784272 0 0 0 1784272 0 0 0 LRU [root@bigboy tmp]#
Possible Causes of Ethernet Errors
Collisions: Signifies when the NIC card detects itself and another server on the LAN attempting data transmissions at the same time. Collisions can be expected as a normal part of Ethernet operation and are typically below 0.1% of all frames sent. Higher error rates are likely to be caused by faulty NIC cards or poorly terminated cables.
Single Collisions: The Ethernet frame went through after only one collision
Multiple Collisions: The NIC had to attempt multiple times before successfully sending the frame due to collisions.
CRC Errors: Frames were sent but were corrupted in transit. The presence of CRC errors, but not many collisions usually is an indication of electrical noise. Make sure that you are using the correct type of cable, that the cabling is undamaged and that the connectors are securely fastened.
Frame Errors: An incorrect CRC and a non-integer number of bytes are received. This is usually the result of collisions or a bad Ethernet device.
FIFO and Overrun Errors: The number of times that the NIC was unable of handing data to its memory buffers because the data rate the capabilities of the hardware. This is usually a sign of excessive traffic.
Length Errors: The received frame length was less than or exceeded the Ethernet standard. This is most frequently due to incompatible duplex settings.
Carrier Errors: Errors are caused by the NIC card losing its link connection to the hub or switch. Check for faulty cabling or faulty interfaces on the NIC and networking equipment.