LINUKS BLOG

Make progress is the topic for ever...

My Photo
Name:
Location: China

It's a fans of computer/ Computer is my favorite/ Making progress is the topic for ever...

Sunday, January 14, 2007

Girl friend

Since the last girl friend,i have no one till now.Sometime,it's a little unconvenice to have a girl friend after the back.But,it's a neccessary to have one in the whole.So i want to have one recently.Not only the psychology,but alse the physiology.
The day before yesterday,a aunt introduce a girl to me.But i have nothing to say for the introdution.Sometimes,i couldn't admit the acknowledge of make friend with female.
Have to learn from now on...
Yesterday:
net comand:under windows 2000 cmd shell
Input netsh,appear netsh>
Input int ip, appear interface ip>
Input dump,appear
# ----------------------------------

  # Interface IP Configuration

  # ----------------------------------

  pushd interface ip

  # Interface IP Configuration for "Local Area Connection"

  set address name = "Local Area Connection" source = static addr = 192.168.1.168

  mask = 255.255.255.0

  add address name = "Local Area Connection" addr = 192.1.1.111 mask = 255.255.255.0

  set address name = "Local Area Connection" gateway = 192.168.1.100 gwmetric = 1

  set dns name = "Local Area Connection" source = static addr = 202.96.209.5

  set wins name = "Local Area Connection" source = static addr = none

  popd

  # End of interface IP configuration
So,we can input the command bellow to change the IP:
"netsh interface ip add address "Local Area Connection" 10.0.0.2 255.0.0.0"
If you can't remember the command of the set ip in dos,you can input the "?" after the interface ip>
使用 ipconfig /all 查看配置

  使用 ipconfig /renew 刷新配置

  使用 ipconfig 管理 DNS 和 DHCP 类别 ID

  使用 Ping 测试连接

  使用 Arp 解决硬件地址问题

  使用 nbtstat 解决 NetBIOS 名称问题

  使用 netstat 显示连接统计

  使用 tracert 跟踪网络连接

  使用 pathping 测试路由器

  使用 ipconfig /all 查看配置

ping IP_address

  使用 Ping 时应该执行以下步骤:

  Ping 环回地址验证是否在本地计算机上安装 TCP/IP 以及配置是否正确。

  ping 127.0.0.1

  Ping 本地计算机的 IP 地址验证是否正确地添加到网络。

  ping IP_address_of_local_host

  Ping 默认网关的 IP 地址验证默认网关是否运行以及能否与本地网络上的本地主机通讯。

  ping IP_address_of_default_gateway

  Ping 远程主机的 IP 地址验证能否通过路由器通讯。

  ping IP_address_of_remote_host

  Ping 命令用 Windows 套接字样式的名称解析将计算机名解析成 IP 地址,所以如果用地址成功,但是用名称 Ping 失败,则问题出在地址或名称解析上,而不是网络连通性的问题。详细信息,请参阅使用 Arp 解决硬件地址问题。

  如果在任何点上都无法成功地使用 Ping,请确认:

  安装和配置 TCP/IP 之后重新启动计算机。

  "Internet 协议 (TCP/IP) 属性"对话框"常规"选项卡上的本地计算机的 IP 地址有效而且正确。

  启用 IP 路由,并且路由器之间的链路是可用的。

  您可以使用 Ping 命令的不同选项来指定要使用的数据包大小、要发送多少数据包、是否记录用过的路由、要使用的生存时间 (TTL) 值以及是否设置"不分段"标志。可以键入 ping -? 查看这些选项。

  下例说明如何向 IP 地址 172.16.48.10 发送两个 Ping,每个都是 1,450 字节:

  C:\>ping -n 2 -l 1450 172.16.48.10

  Pinging 172.16.48.10 with 1450 bytes of data:

  Reply from 172.16.48.10:bytes=1450 time<10ms TTL=32

  Reply from 172.16.48.10:bytes=1450 time<10ms TTL=32

  Ping statistics for 157.59.8.1 :

  Packets:Sent = 2, Received = 2, Lost = 0 (0% loss),

  Approximate roundtrip times in milli-seconds:

  Minimum = 0ms, Maximum = 10ms, Average = 2ms

  默认情况下,在显示"请求超时"之前,Ping 等待 1,000 毫秒(1 秒)的时间让每个响应返回。如果通过 Ping 探测的远程系统经过长时间延迟的链路,如卫星链路,则响应可能会花更长的时间才能返回。可以使用 -w (等待)选项指定更长时间的超时。

  使用 Arp 解决硬件地址问题

  "地址解析协议 (ARP)"允许主机查找同一物理网络上的主机的媒体访问控制地址,如果给出后者的 IP 地址。为使 ARP 更加有效,每个计算机缓存 IP 到媒体访问控制地址映射消除重复的 ARP 广播请求。

  可以使用 arp 命令查看和修改本地计算机上的 ARP 表项。arp 命令对于查看 ARP 缓存和解决地址解析问题非常有用。

  详细信息,请参阅查看"地址解析协议 (ARP)"缓存和添加静态 ARP 缓存项目。

  使用 nbtstat 解决 NetBIOS 名称问题

  TCP/IP 上的 NetBIOS (NetBT) 将 NetBIOS 名称解析成 IP 地址。TCP/IP 为 NetBIOS 名称解析提供了很多选项,包括本地缓存搜索、WINS 服务器查询、广播、DNS 服务器查询以及 Lmhosts 和主机文件搜索。

  Nbtstat 是解决 NetBIOS 名称解析问题的有用工具。可以使用nbtstat 命令删除或更正预加载的项目:

  nbtstat -n 显示由服务器或重定向器之类的程序在系统上本地注册的名称。

  nbtstat -c 显示 NetBIOS 名称缓存,包含其他计算机的名称对地址映射。

  nbtstat -R 清除名称缓存,然后从 Lmhosts 文件重新加载。

  nbtstat -RR 释放在 WINS 服务器上注册的 NetBIOS 名称,然后刷新它们的注册。

  nbtstat -a name 对 name 指定的计算机执行 NetBIOS 适配器状态命令。适配器状态命令将返回计算机的本地 NetBIOS 名称表,以及适配器的媒体访问控制地址。

  nbtstat -S 列出当前的 NetBIOS 会话及其状态(包括统计),如下例所示:

  NetBIOS connection table

  Local name State In/out Remote Host Input Output

  ------------------------------------------------------------------

  CORP1 <00> Connected Out CORPSUP1<20> 6MB 5MB

  CORP1 <00> Connected Out CORPPRINT<20> 108KB 116KB

  CORP1 <00> Connected Out CORPSRC1<20> 299KB 19KB

  CORP1 <00> Connected Out CORPEMAIL1<20> 324KB 19KB

  CORP1 <03> Listening

  使用 netstat 显示连接统计

  可以使用 netstat 命令显示协议统计信息和当前的 TCP/IP 连接。netstat -a 命令将显示所有连接,而 netstat -r 显示路由表和活动连接。netstat -e 命令将显示Ethernet 统计信息,而 netstat -s 显示每个协议的统计信息。如果使用 netstat -n,则不能将地址和端口号转换成名称。下面是 netstat 的输出示例:

  C:\>netstat -e

  Interface Statistics

  Received Sent

  Bytes 3995837940 47224622

  Unicast packets 120099 131015

  Non-unicast packets 7579544 3823

  Discards 0 0

  Errors 0 0

  Unknown protocols 363054211

  C:\>netstat -a

  Active Connections

  Proto Local Address Foreign Address State

  TCP CORP1:1572 172.16.48.10:nbsession ESTABLISHED

  TCP CORP1:1589 172.16.48.10:nbsession ESTABLISHED

  TCP CORP1:1606 172.16.105.245:nbsession ESTABLISHED

  TCP CORP1:1632 172.16.48.213:nbsession ESTABLISHED

  TCP CORP1:1659 172.16.48.169:nbsession ESTABLISHED

  TCP CORP1:1714 172.16.48.203:nbsession ESTABLISHED

  TCP CORP1:1719 172.16.48.36:nbsession ESTABLISHED

  TCP CORP1:1241 172.16.48.101:nbsession ESTABLISHED

  UDP CORP1:1025 *:*

  UDP CORP1:snmp *:*

  UDP CORP1:nbname *:*

  UDP CORP1:nbdatagram *:*

  UDP CORP1:nbname *:*

  UDP CORP1:nbdatagram *:*

  C:\>netstat -s

  IP Statistics

  Packets Received = 5378528

  Received Header Errors = 738854

  Received Address Errors = 23150

  Datagrams Forwarded = 0

  Unknown Protocols Received = 0

  Received Packets Discarded = 0

  Received Packets Delivered = 4616524

  Output Requests = 132702

  Routing Discards = 157

  Discarded Output Packets = 0

  Output Packet No Route = 0

  Reassembly Required = 0

  Reassembly Successful = 0

  Reassembly Failures =

  Datagrams Successfully Fragmented = 0

  Datagrams Failing Fragmentation = 0

  Fragments Created = 0

  ICMP Statistics

  Received Sent

  Messages 693 4

  Errors 0 0

  Destination Unreachable 685 0

  Time Exceeded 0 0

  Parameter Problems 0 0

  Source Quenches 0 0

  Redirects 0 0

  Echoes 4 0

  Echo Replies 0 4

  Timestamps 0 0

  Timestamp Replies 0 0

  Address Masks 0 0

  Address Mask Replies 0 0

  TCP Statistics

  Active Opens = 597

  Passive Opens = 135

  Failed Connection Attempts = 107

  Reset Connections = 91

  Current Connections = 8

  Segments Received = 106770

  Segments Sent = 118431

  Segments Retransmitted = 461

  UDP Statistics

  Datagrams Received = 4157136

  No Ports = 351928

  Receive Errors = 2

  Datagrams Sent = 13809

  使用 tracert 跟踪网络连接

  Tracert(跟踪路由)是路由跟踪实用程序,用于确定 IP 数据报访问目标所采取的路径。Tracert 命令用 IP 生存时间 (TTL) 字段和 ICMP 错误消息来确定从一个主机到网络上其他主机的路由。

  Tracert 工作原理

  通过向目标发送不同 IP 生存时间 (TTL) 值的"Internet 控制消息协议 (ICMP)"回应数据包,    Tracert 诊断程序确定到目标所采取的路由。要求路径上的每个路由器在转发数据包之前至少将数据包上的 TTL 递减 1。数据包上的 TTL 减为 0 时,路由器应该将"ICMP 已超时"的消息发回源系统。

  Tracert 先发送 TTL 为 1 的回应数据包,并在随后的每次发送过程将 TTL 递增 1,直到目标响应或 TTL 达到最大值,从而确定路由。通过检查中间路由器发回的"ICMP 已超时"的消息确定路由。某些路由器不经询问直接丢弃 TTL 过期的数据包,这在Tracert 实用程序中看不到。

  Tracert 命令按顺序打印出返回"ICMP 已超时"消息的路径中的近端路由器接口列表。如果使用 -d 选项,则 Tracert 实用程序不在每个 IP 地址上查询 DNS。

  在下例中,数据包必须通过两个路由器(10.0.0.1192.168.0.1)才能到达主机172.16.0.99 。主机的默认网关是 10.0.0.1,192.168.0.0 网络上的路由器的 IP地址是 192.168.0.1

  C:\>tracert 172.16.0.99 -d

  Tracing route to 172.16.0.99 over a maximum of 30 hops

  1 2s 3s 2s 10,0.0,1

  2 75 ms 83 ms 88 ms 192.168.0.1

  3 73 ms 79 ms 93 ms 172.16.0.99

  Trace complete.

  用 tracert 解决问题

  可以使用 tracert 命令确定数据包在网络上的停止位置。下例中,默认网关确定 192.168.10.99 主机没有有效路径。这可能是路由器配置的问题,或者是 192.168.10.0 网络不存在(错误的 IP 地址)。

  C:\>tracert 192.168.10.99

  Tracing route to 192.168.10.99 over a maximum of 30 hops

  1 10.0.0.1 reportsestination net unreachable.

  Trace complete.

  Tracert 实用程序对于解决大网络问题非常有用,此时可以采取几条路径到达同一个点。

  Tracert 命令行选项

  Tracert 命令支持多种选项,如下表所示。

  tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

  选项 描述

  -d 指定不将 IP 地址解析到主机名称。

  -h maximum_hops 指定跃点数以跟踪到称为 target_name 的主机的路由。

  -j host-list 指定 Tracert 实用程序数据包所采用路径中的路由器接口列表。

  -w timeout 等待 timeout 为每次回复所指定的毫秒数。

  target_name 目标主机的名称或 IP地址。

  详细信息,请参阅使用 tracert 命令跟踪路径。

  使用 pathping 测试路由器

  pathping 命令是一个路由跟踪工具,它将 ping 和 tracert 命令的功能和这两个工具所不提供的其他信息结合起来。pathping 命令在一段时间内将数据包发送到到达最终目标的路径上的每个路由器,然后基于数据包的计算机结果从每个跃点返回。由于命令显示数据包在任何给定路由器或链接上丢失的程度,因此可以很容易地确定可能导致网络问题的路由器或链接。某些选项是可用的,如下表所示。

  选项 名称 功能

  -n Hostnames 不将地址解析成主机名。

  -h Maximum hops 搜索目标的最大跃点数。

  -g Host-list 沿着路由列表释放源路由。

  -p Period 在 ping 之间等待的毫秒数。

  -q Num_queries 每个跃点的查询数。

  -w Time-out 为每次回复所等待的毫秒数。

  -T Layer 2 tag 将第 2 层优先级标记(例如,对于 IEEE 802.1p)连接到数据包并将它发送到路径中的每个网络设备。这有助于标识没有正确配置第 2 层优先级的网络设备。-T 开关用于测试服务质量 (QoS) 连通性。

  -R RSVP isbase Che检查以确定路径中的每个路由器是否支持"资源保留协议 (RSVP)",此协议允许主机为数据流保留一定量的带宽。 -R 开关用于测试服务质量 (QoS) 连通性。

  默认的跃点数是 30,并且超时前的默认等待时间是 3 秒。默认时间是 250 毫秒,并且沿着路径对每个路由器进行查询的次数是 100。

  以下是典型的 pathping 报告。跃点列表后所编辑的统计信息表明在每个独立路由器上数据包丢失的情况。

  D:\>pathping -n msw

  Tracing route to msw [ 7.54.1.196]

  over a maximum of 30 hops:

  0 172.16.87.35

  1 172.16.87.218

  2 192.68.52.1

  3 192.68.80.1

  4 7.54.247.14

  5 7.54.1.196

  Computing statistics for 125 seconds...

  Source to Here This Node/Link

  Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address

  0 172.16.87.35

  0/ 100 = 0% |

  1 41ms 0/ 100 = 0% 0/ 100 = 0% 172.16.87.21813/ 100 = 13% |

  2 22ms 16/ 100 = 16% 3/ 100 = 3% 192.68.52.10/ 100 = 0% |

  3 24ms 13/ 100 = 13% 0/ 100 = 0% 192.68.80.1 0/ 100 = 0% |

  4 21ms 14/ 100 = 14% 1/ 100 = 1% 10.54.247.14 0/ 100 = 0% |

  5 24ms 13/ 100 = 13% 0/ 100 = 0% 10.54.1.196

  Trace complete.

  当运行 pathping 时,在测试问题时首先查看路由的结果。此路径与 tracert 命令所显示的路径相同。然后 pathping 命令对下一个 125 毫秒显示忙消息(此时间根据跃点计数变化)。在此期间,pathping 从以前列出的所有路由器和它们之间的链接之间收集信息。在此期间结束时,它显示测试结果。

  最右边的两栏 This Node/Link Lost/Sent=Pct 和 Address 包含的信息最有用。 172.16.87.218(跃点 1)和 192.68.52.1(跃点 2)丢失 13% 的数据包。 所有其他链接工作正常。在跃点 2 和 4 中的路由器也丢失寻址到它们的数据包(如 This Node /Link 栏中所示),但是该丢失不会影响转发的路径。

  对链接显示的丢失率(在最右边的栏中标记为 |)表明沿路径转发丢失的数据包。该丢失表明链接阻塞。对路由器显示的丢失率(通过最右边栏中的 IP 地址显示)表明这些路由器的 CPU 可能超负荷运行。这些阻塞的路由器可能也是端对端问题的一个因素,尤其是在软件路由器转发数据包时。

--
Right or wrong decide by yourself, praise or blame listen to the others, gain or loss placid as usual, success or failure return to the zero.

0 Comments:

Post a Comment

<< Home