⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 63.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 4 页
字号:
-c — 持续更新网络状态(每秒一次)直至被人为中止(^C)<br>
-r — 显示内核路由表<br>
-n — 以数字(原始)格式而不是已解析的名称显示远程和本地地址<br>
-t — 仅显示 TCP 套接字信息(不包括任何 UCP 套接字信息)<br>
-v — 显示 netstat 的版本信息<br>
输入 man netstat 可获得所有可用标志的完整列表和详细说明每个标志的用途。请注意还可以组合这些标志,所以输入 netstat -rn 将以原始的 IP 地址格式显示关于本地和远程主机(n)的系统路由表(r)。<br>
<br>
显示活动的网络连接<br>
<br>
netstat 支持一组显示活动或非活动的套接字的选项:-t、-u、-w 和 -x 分别显示活动的 TCP、UDP、RAW 或 UNIX 套接字连接。如果加上 -a 标志,还会显示等待连接的(换句话说,就是侦听)套接字。这将为您显示现在正在系统上运行的所有服务器。<br>
例如:在主机 phoenix 上输入 netstat -ta 会显示下列内容:<br>
[tom@phoenix tom]$ netstat -ta<br>
Active Internet connections (servers and established)<br>
Proto Recv-Q Send-Q Local Address Foreign Address State<br>
tcp 0 40 phoenix.syroidmanor:ssh 192.168.1.5:1132 ESTABLISHED<br>
tcp 0 0 *:ssh *:* LISTEN<br>
tcp 0 0 phoenix.syroidmano:1028 hydras.syro:netbios-ssn ESTABLISHED<br>
tcp 0 0 phoenix.syroidmano:1027 raidserver:netbios-ssn ESTABLISHED<br>
tcp 0 0 *:printer *:* LISTEN<br>
tcp 0 0 *:auth *:* LISTEN<br>
tcp 0 0 *:1024 *:* LISTEN<br>
tcp 0 0 *:sunrpc *:* LISTEN<br>
上述输出显示大多数的服务器仅仅在等待到来的连接(LISTEN)。但是,第一行显示主机 phoenix 和 IP 地址为 192.168.1.5 之间的连接;第三和第四行显示两个 netbios 连接(Samba SMB 共享)。<br>
<br>
用 netstat 查看路由表<br>
<br>
当使用 -r 标志时,netstat 显示内核中的路由表,这类似于输入 /sbin/route :<br>
[tom@phoenix tom]$ netstat -nr<br>
Kernel IP routing table<br>
Destination Gateway Genmask Flags MSS Window irtt Iface<br>
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo<br>
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0<br>
<br>
-n 选项强制 netstat 以点分四组 IP 数字的形式,而不是主机和网络名称的形式输出地址。当您不想通过网络(例如,用 DNS 或 NIS 服务器)进行地址查询时,这个选项特别有用。<br>
第二列显示路由项中所指向的网关。如果没有使用网关,就会显示星号。第三列是路由的网络掩码。内核在将信息包的 IP 地址与路由的目的地 IP 地址进行比较之前,将 Genmask 值与信息包的 IP 地址逐位进行“与”操作,从而使路由“通用化”。<br>
第四列显示路由的标志:U 表示处于活动状态,H 表示主机,G 表示网关,D 表示动态路由,而 M 表示已经修改过。<br>
<br>
[tom@phoenix tom]$ netstat -nr<br>
Kernel IP routing table<br>
Destination Gateway Genmask Flags MSS Window irtt Iface<br>
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0<br>
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo<br>
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0<br>
接下来的三列显示 MSS、Window 和 irtt,它们将被应用于通过该路由建立的 TCP 连接。MSS(Maximum Segment Size)表示“最大分段尺寸”,也是内核所构建以通过该路由发送的数据报的最大尺寸。Window 表示系统一次从远程主机接收突发的最大量数据。<br>
首字母缩写词 irtt 代表“初始往返时间(initial round trip tim)”。TCP 协议确保主机间可靠地发送数据,如果数据已经丢失,则重新发送。TCP 协议一直对发送给远程端点的数据报和接收到的确认所花费的时间进行记数,以便知道假定要重发数据报前需要等待的时间;这个过程称为往返时间。TCP 协议将使用第一次建立连接时所用时间作为初始往返时间的值。对于大多数类型的网络,用缺省值就够了,但对某些速度较慢的网络(特别是某些业余的分组无线网络),这个时间太短了,会造成不必要的重发。可以使用 route 命令设置 irtt 值。在上面这个路由表中,这些字段均为零值,这表明正在使用缺省值。<br>
最后,最后这个字段表示的是所显示的路由使用的网络接口。<br>
<br>
用 netstat 显示一些网络接口使用的统计信息<br>
<br>
用 -i 选项调用 netstat 可以显示所有已配置接口的一些有用的统计信息 — 这是一个用于排除网络故障的非常有用的工具。有了该命令,很容易检查连接的状态以及连接是否“正常”。<br>
[tom@phoenix tom]$ netstat -i<br>
Kernel Interface table<br>
eth0 Link encap:Ethernet HWaddr 00:10:5A:00:87:22<br>
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0<br>
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:10554374 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:8528339 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:100<br>
Interrupt:19 Base address:0xc800<br>
<br>
lo Link encap:Local Loopback<br>
inet addr:127.0.0.1 Mask:255.0.0.0<br>
UP LOOPBACK RUNNING MTU:3924 Metric:1<br>
RX packets:5612 errors:0 dropped:0 overruns:0 frame:0<br>
TX packets:5612 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0<br>
<br>
RX packets 和 TX packets 行分别显示了已经接收到的信息包或已经发送了的信息包数目以及出错的信息包、丢失的信息包以及溢出的 RX/TX 统计信息。最常见的接口错误都是源于不正确的配置,所以,如果遇到了某些困难,最好再三检查所有的设置来进行诊断。<br>
假使接口已经启动,则应该没有信息包排队等候发送(txqueuelen)— 如果有,则可能是由于网络电缆或网卡有问题。首先换一根备用电缆,然后重新检查连接。RX/TX 错误应该近乎为零。如果 TX 错误过多,则表示网络已经饱和或物理连接有问题;如果 RX 错误过多,则表示网络已经饱和、物理连接有问题或主机过载。如果遇到过高的冲突率(冲突率是输出信息包(output packet)的百分比,而不是从发送/接收信息包的总数中计算得出),它可能也表示网络已经饱和;通过从同一子网上的另一台主机执行 netstat -i 命令并比较结果来证实这一点。<br>
要解决网络中错误,一定要仔细地以及系统地分析接口的所有方面(硬件和软件),这是必要的。不要匆忙行事,……啊……我们提到了总是要先检查网络电缆。在这一点,相信我。<br>
<br>
参考资料<br>
<br>
在网上有:<br>
Linux System Administrator's Guide<br>
学习如何 Easily configure TCP/IP on your AIX system<br>
IBM 提供了一些用于网络监控的工具,譬如 Tivoli NetView Performance Monitor for TCP/IP<br>
访问 TCP/IP for OS/40O 的主页<br>
请阅读关于实现 iSeries 和 AS/400 的 TCP/IP 和因特网访问<br>
如果您可以在线搜索和参考,则我强烈向您推荐 O'Reilly 新的 Safari 订阅服务。您可以完全搜索并选择一些曾经出版过的有关网络方面最好的书籍。<br>
<br>
出版的书籍有:<br>
TCP/IP Network Administration, 2nd Edition,Craig Hunt(O'Reilly)ISBN:1-56592-322-7<br>
Linux in a Nutshell, 3rd Edition,Siever, Spainhour, Figgins, and Hekman(O'Reilly)ISBN:0-596-00025-1<br>
Running Linux, 3rd Edition, Welsh, Dalheimer, and Kaufman(O'Reilly)ISBN:1-56592-469-X
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -