<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacklog &#187; 计算机网络</title>
	<atom:link href="http://ihacklog.com/cat/net/feed" rel="self" type="application/rss+xml" />
	<link>http://ihacklog.com</link>
	<description>荒野无灯weblog</description>
	<lastBuildDate>Sat, 04 Feb 2012 12:30:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Time to live exceeded</title>
		<link>http://ihacklog.com/net/time-to-live-exceeded.html</link>
		<comments>http://ihacklog.com/net/time-to-live-exceeded.html#comments</comments>
		<pubDate>Sun, 12 Jun 2011 06:10:23 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>
		<category><![CDATA[exceeded]]></category>
		<category><![CDATA[TTL]]></category>
		<category><![CDATA[环路]]></category>

		<guid isPermaLink="false">http://ihacklog.com/net/time-to-live-exceeded.html</guid>
		<description><![CDATA[(注：现已能正常访问） 今天和往常一样，打开wordpress.org.cn ，想看下有没有什么新帖，还有就是删除一些 AD。却发现网站打不开了，于是ping之： 123456789&#91;admin@huangye ~&#93;$ ping -c4 wordpress.org.cn PING wordpress.org.cn &#40;111.67.203.153&#41; 56&#40;84&#41; bytes of data. From bj141-142-81.bjtelecom.net &#...]]></description>
			<content:encoded><![CDATA[<p>(注：现已能正常访问）<br />
今天和往常一样，打开wordpress.org.cn ，想看下有没有什么新帖，还有就是删除一些<br />
AD。却发现网站打不开了，于是ping之：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>admin<span style="color: #000000; font-weight: bold;">@</span>huangye ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-c4</span> wordpress.org.cn<br />
PING wordpress.org.cn <span style="color: #7a0874; font-weight: bold;">&#40;</span>111.67.203.153<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">56</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">84</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.<br />
From bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">1</span> Time to live exceeded<br />
From bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">2</span> Time to live exceeded<br />
From bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">3</span> Time to live exceeded<br />
From bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">4</span> Time to live exceeded<br />
<br />
<span style="color: #660033;">---</span> wordpress.org.cn <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span><br />
<span style="color: #000000;">4</span> packets transmitted, <span style="color: #000000;">0</span> received, +<span style="color: #000000;">4</span> errors, <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 3004ms</div></td></tr></tbody></table></div>
<blockquote><p>从错误信息可看出，是由于生存时间的问题导致的。<br />
TTL是生存时间的意思，就是说这个ping的数据包能在网络上存在多少时间。当我们对<br />
网络上的主机进行ping操作的时候，我们本地机器会发出一个数据包，数据包经过一<br />
定数量的路由器传送到目的主机，但是由于很多的原因，一些数据包不能正常传送到<br />
目的主机，那如果不给这些数据包一个生存时间的话，这些数据包会一直在网络上传<br />
送，导致网络开销的增大。当数据包传送到一个路由器之后，TTL就自动减1，如果减<br />
到0了还是没有传送到目的主机，那么就自动丢失。<br />
当TTL被扣到0时，最后一个经手的路由器就会给源主机发来一个Time to live<br />
exceeded的ICMP信息。
</p></blockquote>
<p>很有可能是形成了路由环路，导致TTL变为0了。。。验证下：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>admin<span style="color: #000000; font-weight: bold;">@</span>huangye ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># traceroute wordpress.org.cn</span><br />
traceroute to wordpress.org.cn <span style="color: #7a0874; font-weight: bold;">&#40;</span>111.67.203.153<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">30</span> hops max, <span style="color: #000000;">40</span> byte packets<br />
&nbsp;<span style="color: #000000;">1</span> &nbsp;172.30.16.254 <span style="color: #7a0874; font-weight: bold;">&#40;</span>172.30.16.254<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">1.042</span> ms &nbsp;<span style="color: #000000;">1.085</span> ms &nbsp;<span style="color: #000000;">1.039</span> ms<br />
&nbsp;<span style="color: #000000;">2</span> &nbsp;10.10.20.1 <span style="color: #7a0874; font-weight: bold;">&#40;</span>10.10.20.1<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">0.966</span> ms &nbsp;<span style="color: #000000;">6.717</span> ms &nbsp;<span style="color: #000000;">0.789</span> ms<br />
&nbsp;<span style="color: #000000;">3</span> &nbsp;10.0.2.253 <span style="color: #7a0874; font-weight: bold;">&#40;</span>10.0.2.253<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">0.496</span> ms &nbsp;<span style="color: #000000;">0.391</span> ms &nbsp;<span style="color: #000000;">0.489</span> ms<br />
&nbsp;<span style="color: #000000;">4</span> &nbsp;211.143.30.233 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.143.30.233<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">1.630</span> ms &nbsp;<span style="color: #000000;">1.591</span> ms &nbsp;<span style="color: #000000;">1.563</span> ms<br />
&nbsp;<span style="color: #000000;">5</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span><br />
&nbsp;<span style="color: #000000;">6</span> &nbsp;111.8.1.205 <span style="color: #7a0874; font-weight: bold;">&#40;</span>111.8.1.205<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">1.074</span> ms &nbsp;<span style="color: #000000;">1.046</span> ms &nbsp;<span style="color: #000000;">0.912</span> ms<br />
&nbsp;<span style="color: #000000;">7</span> &nbsp;211.142.210.57 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.142.210.57<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">1.542</span> ms &nbsp;<span style="color: #000000;">1.146</span> ms &nbsp;<span style="color: #000000;">1.319</span> ms<br />
&nbsp;<span style="color: #000000;">8</span> &nbsp;211.142.209.109 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.142.209.109<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">7.200</span> ms &nbsp;<span style="color: #000000;">7.068</span> ms &nbsp;<span style="color: #000000;">7.410</span> ms<br />
&nbsp;<span style="color: #000000;">9</span> &nbsp;211.136.7.61 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.136.7.61<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">7.090</span> ms &nbsp;<span style="color: #000000;">7.075</span> ms &nbsp;<span style="color: #000000;">7.117</span> ms<br />
<span style="color: #000000;">10</span> &nbsp;211.136.4.73 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.136.4.73<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">11.880</span> ms &nbsp;<span style="color: #000000;">11.912</span> ms &nbsp;<span style="color: #000000;">12.040</span> ms<br />
<span style="color: #000000;">11</span> &nbsp;211.136.2.117 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.136.2.117<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">26.609</span> ms &nbsp;<span style="color: #000000;">26.505</span> ms &nbsp;<span style="color: #000000;">26.808</span> ms<br />
<span style="color: #000000;">12</span> &nbsp;211.136.2.94 <span style="color: #7a0874; font-weight: bold;">&#40;</span>211.136.2.94<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">38.777</span> ms &nbsp;<span style="color: #000000;">26.582</span> ms &nbsp;<span style="color: #000000;">30.270</span> ms<br />
<span style="color: #000000;">13</span> &nbsp;202.97.15.177 <span style="color: #7a0874; font-weight: bold;">&#40;</span>202.97.15.177<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">83.794</span> ms &nbsp;<span style="color: #000000;">35.866</span> ms &nbsp;<span style="color: #000000;">59.902</span> ms<br />
<span style="color: #000000;">14</span> &nbsp;202.97.37.217 <span style="color: #7a0874; font-weight: bold;">&#40;</span>202.97.37.217<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">90.400</span> ms &nbsp;<span style="color: #000000;">82.311</span> ms &nbsp;<span style="color: #000000;">82.739</span> ms<br />
<span style="color: #000000;">15</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span><br />
<span style="color: #000000;">16</span> &nbsp;bj141-<span style="color: #000000;">131</span>-<span style="color: #000000;">154</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.131.154<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">85.439</span> ms &nbsp;<span style="color: #000000;">86.455</span> ms &nbsp;<span style="color: #000000;">86.333</span> ms<br />
<span style="color: #000000;">17</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">87.638</span> ms &nbsp;<span style="color: #000000;">88.488</span> ms &nbsp;<span style="color: #000000;">90.518</span> ms<br />
<span style="color: #000000;">18</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">91.957</span> ms &nbsp;<span style="color: #000000;">89.232</span> ms &nbsp;<span style="color: #000000;">89.453</span> ms<br />
<span style="color: #000000;">19</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">89.192</span> ms &nbsp;<span style="color: #000000;">91.656</span> ms &nbsp;<span style="color: #000000;">92.655</span> ms<br />
<span style="color: #000000;">20</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">94.187</span> ms &nbsp;<span style="color: #000000;">96.127</span> ms <span style="color: #000000; font-weight: bold;">*</span><br />
<span style="color: #000000;">21</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">83.935</span> ms &nbsp;<span style="color: #000000;">124.042</span> ms &nbsp;<span style="color: #000000;">88.559</span> ms<br />
<span style="color: #000000;">22</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">86.935</span> ms <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span><br />
<span style="color: #000000;">23</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">82.130</span> ms &nbsp;<span style="color: #000000;">80.930</span> ms &nbsp;<span style="color: #000000;">79.260</span> ms<br />
<span style="color: #000000;">24</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">76.603</span> ms<br />
<span style="color: #000000;">25</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">74.600</span> ms &nbsp;<span style="color: #000000;">74.593</span> ms &nbsp;<span style="color: #000000;">72.562</span> ms<br />
<span style="color: #000000;">26</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">83.662</span> ms &nbsp;<span style="color: #000000;">84.107</span> ms<br />
<span style="color: #000000;">27</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">86.217</span> ms &nbsp;<span style="color: #000000;">85.530</span> ms &nbsp;<span style="color: #000000;">85.025</span> ms<br />
<span style="color: #000000;">28</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">84.426</span> ms &nbsp;<span style="color: #000000;">84.454</span> ms &nbsp;<span style="color: #000000;">85.539</span> ms<br />
<span style="color: #000000;">29</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">86.675</span> ms &nbsp;<span style="color: #000000;">87.725</span> ms &nbsp;<span style="color: #000000;">87.278</span> ms<br />
<span style="color: #000000;">30</span> &nbsp;bj141-<span style="color: #000000;">142</span>-<span style="color: #000000;">81</span>.bjtelecom.net <span style="color: #7a0874; font-weight: bold;">&#40;</span>219.141.142.81<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp;<span style="color: #000000;">87.507</span> ms &nbsp;<span style="color: #000000;">87.809</span> ms &nbsp;<span style="color: #000000;">87.735</span> ms</div></td></tr></tbody></table></div>
<p><a href="http://static.ihacklog.com/wp-files/2011/06/TTL_exceed.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img title="TTL_exceed.png" alt="TTL_exceed.png" src="http://static.ihacklog.com/wp-files/2011/06/TTL_exceed-550x340.png" class="aligncenter" /> </a></p>
<p>果然是在bj141-142-81.bjtelecom.net (219.141.142.81) 那里形成路由环路了。<br />
查看一下wordpress.org.cn的真实IP:</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>admin<span style="color: #000000; font-weight: bold;">@</span>huangye ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ nslookup wordpress.org.cn<br />
Server: &nbsp; &nbsp; 211.142.210.100<br />
Address:&nbsp; &nbsp; 211.142.210.100<span style="color: #666666; font-style: italic;">#53</span><br />
<br />
Non-authoritative answer:<br />
Name: &nbsp; wordpress.org.cn<br />
Address: 111.67.203.153</div></td></tr></tbody></table></div>
<p>看来ping 到的IP也是正确的，确实是在bj141-142-81.bjtelecom.net (219.141.142.81)<br />
这个路由这里出问题了。。。<br />
现在要想访问wordpress,除非换走不同的路由。。。<br />
算了，换用电信的网ping 也是一样的结果。。。囧<br />
看来bj141-142-81.bjtelecom.net是必经之地了。。。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4569";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4569" title="Permanent Link to Time to live exceeded" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4569</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年10月17日  //  <a href="http://ihacklog.com/software/tips/chenfang-usb-driver-system-maintenance-tool-v2-0-512m-maxdos-8-0.html" title="晨枫U盘维护系统 V2.0 512M MaxDos 8.0版 by荒野无灯">晨枫U盘维护系统 V2.0 512M MaxDos 8.0版 by荒野无灯</a> (7)</li><li>2011年12月18日  //  <a href="http://ihacklog.com/php/wordpress/plugins/the-second-solution-to-modifying-wordpress-admin-password-when-your-have-forgot-it.html" title="普通青年版:WordPress管理员密码忘记了怎么办？上传一个文件即可">普通青年版:WordPress管理员密码忘记了怎么办？上传一个文件即可</a> (3)</li><li>2011年10月12日  //  <a href="http://ihacklog.com/memory/hacklog/piano-of-night-5.html" title="夜的钢琴曲五">夜的钢琴曲五</a> (7)</li><li>2011年12月17日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/simple-solution-to-modifying-wordpress-admin-password-when-your-have-forgot-it.html" title="WordPress管理员密码忘记了怎么办？删除一个符号即可">WordPress管理员密码忘记了怎么办？删除一个符号即可</a> (8)</li><li>2008年02月22日  //  <a href="http://ihacklog.com/php/skills/php%e4%b8%ad%e4%bd%bf%e7%94%a8_session%e5%b8%a6%e6%9d%a5%e7%9a%84%e9%97%ae%e9%a2%98.html" title="PHP中使用$_SESSION带来的问题">PHP中使用$_SESSION带来的问题</a> (0)</li><li>2010年05月2日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/mplayer-support-firefox.html" title="让mplayer支持firefox播放">让mplayer支持firefox播放</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/time-to-live-exceeded.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>win7 下连pptp 链路 vpn</title>
		<link>http://ihacklog.com/net/win7-connect-via-vpn-pptp.html</link>
		<comments>http://ihacklog.com/net/win7-connect-via-vpn-pptp.html#comments</comments>
		<pubDate>Sun, 22 May 2011 15:19:23 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>

		<guid isPermaLink="false">http://www.ihacklog.com/?p=4460</guid>
		<description><![CDATA[前天连 vpn 一直连不上，可以确定的是vpn 服务器是没有任何问题的。 后来发现是在本地连接上启用了“共享”，导致无法连接VPN 。把共享取消后顺利连接。 如果VPN服务器要求数据加密的话，就按如下配置即可，否则就选择不要加密那项： 若要通过连接VPN上网，则要确保此选项（“在远程网络上使用默认网关”）勾选： 否则，若你是要通过本地连接的网关上网的话，则务必要把这个勾（“在远程网络上使用默认网关”）取消掉。 喜欢这篇文章吗?请订阅本站 RSS feed 或 作者：荒野无灯 出处：Hacklog【荒野无灯...]]></description>
			<content:encoded><![CDATA[<p>前天连 vpn 一直连不上，可以确定的是vpn 服务器是没有任何问题的。<br />
后来发现是在本地连接上启用了“共享”，导致无法连接VPN 。把共享取消后顺利连接。<br />
如果VPN服务器要求数据加密的话，就按如下配置即可，否则就选择不要加密那项：<br />
<a href="http://static.ihacklog.com/wp-files/2011/05/win7-vpn-pptp.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2011/05/win7-vpn-pptp-336x400.png" alt="" title="win7-vpn-pptp" width="336" height="400" class="alignnone size-medium wp-image-4461" /> </a></p>
<p>若要通过连接VPN上网，则要确保此选项（“在远程网络上使用默认网关”）勾选：<br />
<a href="http://static.ihacklog.com/wp-files/2011/05/win7-vpn-pptp-gateway.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2011/05/win7-vpn-pptp-gateway-550x352.png" alt="" title="win7-vpn-pptp-gateway" width="550" height="352" class="alignnone size-medium wp-image-4462" /> </a></p>
<p>否则，若你是要通过本地连接的网关上网的话，则务必要把这个勾（“在远程网络上使用默认网关”）取消掉。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4460";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4460" title="Permanent Link to win7 下连pptp 链路 vpn" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4460</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2011年08月24日  //  <a href="http://ihacklog.com/software/cool_software_share/envy-code-r.html" title="分享一款极品编程专用字体：Envy Code R">分享一款极品编程专用字体：Envy Code R</a> (8)</li><li>2011年08月20日  //  <a href="http://ihacklog.com/php/habari/fixed-a-syntax-check-bug-in-habari.html" title="修正Habari检查PHP文件语法的一个BUG">修正Habari检查PHP文件语法的一个BUG</a> (1)</li><li>2008年02月21日  //  <a href="http://ihacklog.com/xml_html_css_js_ajax/%e9%a1%b5%e9%9d%a2%e8%bd%ac%e5%90%91%e4%bb%a3%e7%a0%81.html" title="页面转向代码">页面转向代码</a> (0)</li><li>2011年07月6日  //  <a href="http://ihacklog.com/php/php-truth-table.html" title="PHP 真值表  ">PHP 真值表  </a> (2)</li><li>2009年11月9日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/wordpress-commont-author-link-redirect.html" title="Wordpress评论链接重定向跳转（修正代码）">Wordpress评论链接重定向跳转（修正代码）</a> (60)</li><li>2012年01月4日  //  <a href="http://ihacklog.com/php/wordpress/plugins/w3-total-cache-gives-your-wordpress-flying-speed.html" title="W3 Total Cache让你的WordPress博客飞起来！">W3 Total Cache让你的WordPress博客飞起来！</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/win7-connect-via-vpn-pptp.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>windows下的功能强大的netsh命令</title>
		<link>http://ihacklog.com/net/powerful-netsh.html</link>
		<comments>http://ihacklog.com/net/powerful-netsh.html#comments</comments>
		<pubDate>Mon, 07 Jun 2010 18:07:57 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[netsh]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.ihacklog.com/?p=3887</guid>
		<description><![CDATA[这里说明下，XP下无法使用netsh禁用/启用本地连接。用netsh interface set interface来禁用或者启用网卡时，总是报错，解决办法：从2003拷贝一个ifmon.dll和netsh.exe使用。去微软官方查看了下支持，官方建议用devcon，呃，还是觉得netsh方便些。。。。。。。 具体可参见这篇文章：《XP下无法使用netsh禁用/启用本地连接》 简单地备份和恢复网卡IP配置的方法： 备份： 1netsh interface ip dump &#62; c:\ip.txt 恢...]]></description>
			<content:encoded><![CDATA[<p>这里说明下，XP下无法使用netsh禁用/启用本地连接。用netsh interface set interface来禁用或者启用网卡时，总是报错，解决办法：从2003拷贝一个ifmon.dll和netsh.exe使用。去微软官方查看了下支持，官方建议用devcon，呃，还是觉得netsh方便些。。。。。。。</p>
<p>具体可参见这篇文章：<a target="_blank" href="http://www.ihacklog.com/l.php?url=hi.baidu.com/sonmeika/blog/item/5e88f062c779fcd4e7113afb.html">《XP下无法使用netsh禁用/启用本地连接》</a></p>
<p>简单地备份和恢复网卡IP配置的方法：<br />
备份：</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netsh interface ip dump <span style="color: #33cc33;">&gt;</span> c:\ip.txt</div></td></tr></tbody></table></div>
<p>恢复：</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netsh exec c:\ip.txt</div></td></tr></tbody></table></div>
<p>本文txt版：<br />
注意：该页面嵌入了下载文件，请访问 <a href="http://ihacklog.com/net/powerful-netsh.html">该页面</a>下载该文件。</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 网络诊断&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
重置winsock<br />
netsh winsock reset<br />
<br />
显示winsock<br />
netsh winsock show catalog<br />
<br />
<br />
网络诊断<br />
netsh diag gui<br />
<br />
只能判断是否成功连接了对方的相应端口（不能区别连接是否成功和对方是否打开相应端口）<br />
netsh diag connect iphost 172.30.16.234 21<br />
<br />
连接到IE代理<br />
netsh diag connect ieproxy<br />
<br />
ping 所有适配器<br />
netsh diag ping adapter<br />
<br />
netsh diag ping adapter &nbsp; - &nbsp; &nbsp; Ping 所有适配器。<br />
netsh diag ping dhcp &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; 为每个适配器 Ping DHCP 服务器。<br />
netsh diag ping dns &nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; 为每个适配器 Ping &nbsp;DNS 服务器。<br />
netsh diag ping gateway &nbsp; - &nbsp; &nbsp; 为每个适配器 Ping 默认网关服务器。<br />
netsh diag ping ieproxy &nbsp; - &nbsp; &nbsp; Ping Internet Explorer 的代理。<br />
netsh diag ping ip &nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; 为每个适配器 Ping 所有 IP 地址（适配器的IP地址）。<br />
netsh diag ping iphost &nbsp; &nbsp;- &nbsp; &nbsp; Ping 一个 IP 地址或主机名。<br />
netsh diag ping loopback &nbsp;- &nbsp; &nbsp; Ping 环回地址 <span style="color: #33cc33;">(</span>127.0.0.1<span style="color: #33cc33;">)</span>。<br />
netsh diag ping mail &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; Ping Outlook Express 邮件服务器。<br />
netsh diag ping news &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; Ping 新闻服务器。<br />
netsh diag ping wins &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; 为每个适配器 Ping 主要和辅助 WINS 地址。</div></td></tr></tbody></table></div>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 防火墙相关 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
<br />
防火墙<br />
显示当前防火墙状态<br />
netsh firewall show state<br />
<br />
显示允许的程序<br />
netsh firewall show allowedprogram<br />
<br />
显示通过防火墙的端口<br />
netsh firewall show portopening<br />
<br />
<br />
添加防火墙允许的程序<br />
<br />
netsh firewall add allowedprogram 程序路径 名称 模式（可选，ENABLE允许通过防火墙 DISABLE不允许通过防火墙） 范围（可选，ENABLE 、SUBNET、CUSTOM） address<br />
<br />
&nbsp;添加防火墙允许的程序配置。<br />
<br />
&nbsp; 参数:<br />
<br />
&nbsp; program - 程序路径和文件名。<br />
<br />
&nbsp; name - 程序名。<br />
<br />
&nbsp; mode - 程序模式<span style="color: #33cc33;">(</span>可选<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; ENABLE - 允许通过防火墙<span style="color: #33cc33;">(</span>默认值<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; DISABLE –不允许通过防火墙<span style="color: #33cc33;">(</span>默认值<span style="color: #33cc33;">)</span>。<br />
<br />
&nbsp; scope - 程序范围<span style="color: #33cc33;">(</span>可选<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; ENABLE &nbsp;- 允许所有流量通过防火墙<span style="color: #33cc33;">(</span>默认值<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; SUBNET - 只允许本地网络<span style="color: #33cc33;">(</span>子网<span style="color: #33cc33;">)</span>流量通过防火墙。<br />
&nbsp; &nbsp; &nbsp; CUSTOM - 只允许指定的流量通过防火墙。<br />
<br />
&nbsp; addresses - 自定义范围地址<span style="color: #33cc33;">(</span>可选<span style="color: #33cc33;">)</span>。<br />
<br />
&nbsp; profile - 配置的配置文件<span style="color: #33cc33;">(</span>可选<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; CURRENT &nbsp;- 当前配置文件<span style="color: #33cc33;">(</span>默认值<span style="color: #33cc33;">)</span>。<br />
&nbsp; &nbsp; &nbsp; DOMAIN &nbsp; - 域配置文件。<br />
&nbsp; &nbsp; &nbsp; STANDARD - 标准配置文件。<br />
&nbsp; &nbsp; &nbsp; ALL &nbsp; &nbsp; &nbsp;- 所有配置文件。<br />
<br />
&nbsp; 备注: 'scope' 必须是 'CUSTOM' 才能指定 'addresses'。<br />
<br />
&nbsp; 示例:<br />
<br />
&nbsp; &nbsp; &nbsp; add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE<br />
<br />
&nbsp; &nbsp; &nbsp; add allowedprogram C:\MyApp\MyApp.exe MyApp DISABLE<br />
<br />
&nbsp; &nbsp; &nbsp; add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE CUSTOM 157.60.0.1,172.16.0.0/16,10.0.0.0/255.0.0.0,LocalSubnet</div></td></tr></tbody></table></div>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 接口信息查看&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
<br />
<br />
显示接口：<br />
netsh interface show interface<br />
设置接口<br />
netsh interface <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> interface [name = ] IfName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ [admin = ] ENABLED<span style="color: #33cc33;">|</span>DISABLED<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [connect = ] CONNECTED<span style="color: #33cc33;">|</span>DISCONNECTED<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [newname = ] NewName ]<br />
<br />
如：修改接口名称<br />
netsh interface <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> interface name=&quot;本地连接&quot; newname=&quot;haha&quot;</div></td></tr></tbody></table></div>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 接口信息添加&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
<br />
添加IP和网关<br />
<br />
用法: add address [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span> [[addr=]IP address [mask=]IP subnet mask]<br />
&nbsp; &nbsp; &nbsp; &nbsp;[[gateway=]IP address [gwmetric=]integer]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - IP 接口的名称。<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 要添加到此接口的 IP 地址。<br />
&nbsp; &nbsp; &nbsp; mask &nbsp; &nbsp; &nbsp; &nbsp; - 指定 IP 地址的 IP 子网掩码。<br />
&nbsp; &nbsp; &nbsp; gateway &nbsp; &nbsp; &nbsp;- 指定 IP 地址的默认网关。<br />
&nbsp; &nbsp; &nbsp; gwmetric &nbsp; &nbsp; - 默认网关的跃点数。<br />
<br />
注释 : <span style="color: #b100b1; font-weight: bold;">把</span> IP 地址和默认网关添加到一个接口。 如果此接口已启用 DHCP，它将被停用。<br />
<br />
示例：<br />
netsh interface ip add address &quot;本地连接&quot; 172.30.16.234 255.255.255.0 172.30.16.254 1<br />
<br />
<br />
<br />
<br />
添加DNS<br />
<br />
用法: add dns [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span> [addr=]<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;</span> [[index=]<span style="color: #33cc33;">&lt;</span>integer<span style="color: #33cc33;">&gt;</span>]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; 标记 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 值<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - 添加 DNS 服务器的接口的名称。<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 添加的 DNS 服务器的 IP 地址。<br />
&nbsp; &nbsp; &nbsp; index &nbsp; &nbsp; &nbsp; &nbsp;- 为指定的 DNS 服务器地址指定索引<span style="color: #33cc33;">(</span>首选项<span style="color: #33cc33;">)</span>。<br />
<br />
注释: &nbsp; &nbsp;把一个新的 DNS 服务器 IP 地址添加到静态配置的列表中。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;默认情况下，这个DNS 服务器被添加在列表的结尾。如果指定一个索引，DNS 服<br />
务器将被置于列表中指定的位置，其他服务器将被移后留出空间。如果 DNS 服务器以前是<br />
通过 DHCP 获取的，这个新的地址将取代旧的列表。<br />
<br />
示例：<br />
netsh interface ip add dns &quot;本地连接&quot; 59.51.78.211 1<br />
netsh interface ip add dns &quot;本地连接&quot; 202.103.83.3 2</div></td></tr></tbody></table></div>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 接口信息删除&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
<br />
<br />
从指定的接口删除 IP 地址或默认网关。<br />
<br />
用法: delete address [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span> [[addr=]IP address] [[gateway=]IP address<span style="color: #33cc33;">|</span>A<br />
LL]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; 标记 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 值<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - 接口名称。<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 由名称指定的接口的静态 IP 地址。<br />
&nbsp; &nbsp; &nbsp; gateway &nbsp; &nbsp; &nbsp;- 下列值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;</span>: 您正在删除的静态 IP 地址的特定<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;默认网关。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ALL: 删除您正在删除的静态 IP 地址的所有默认<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 网关 IP 地址。<br />
<br />
注释 &nbsp; : <span style="color: #b100b1; font-weight: bold;">从有多重</span> IP 地址的接口上删除一个 IP 地址，或从指定接口上<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除默认网关。<br />
<br />
删除IP<br />
netsh interface ip delete address &quot;本地连接&quot; 172.30.16.234<br />
<br />
删除网关172.30.16.254<br />
netsh interface ip delete address &quot;本地连接&quot; 172.30.16.234 172.30.16.254<br />
<br />
删除&quot;本地连接&quot; 172.30.16.234的所有网关<br />
netsh interface ip delete address &quot;本地连接&quot; 172.30.16.234 ALL<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
从指定的接口删除 DNS 服务器。<br />
<br />
用法: delete dns [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span> [[addr=]<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;|</span>ALL ]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; 标记 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 值<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - 要删除 DNS 服务器的接口的名称。<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 下列值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;</span>: 要删除的 DNS 服务器的特定 IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;地址。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ALL: 删除所有已配置的 DNS 服务器的 IP 地址。<br />
<br />
注释 &nbsp; : <span style="color: #b100b1; font-weight: bold;">删除指定接口的静态配置的</span> DNS 服务器 IP 地址。<br />
<br />
删除&quot;本地连接&quot; 59.51.78.211这个DNS ：<br />
netsh interface ip delete dns &quot;本地连接&quot; 59.51.78.211<br />
<br />
<br />
删除&quot;本地连接&quot;所有DNS<br />
netsh interface ip delete dns &quot;本地连接&quot; ALL</div></td></tr></tbody></table></div>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">##################################################################<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; 接口信息修改&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##<br />
##################################################################<br />
<br />
设置指定的接口的 IP 地址或默认网关。<br />
<br />
<br />
用法: <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> address [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;[[source=]dhcp <span style="color: #33cc33;">|</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; [source=] static [addr=]IP address [mask=]IP subnet mask]<br />
&nbsp; &nbsp; &nbsp; &nbsp;[[gateway=]<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;|</span>none [gwmetric=]integer]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; 标记 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 值<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - 接口名称。<br />
&nbsp; &nbsp; &nbsp; source &nbsp; &nbsp; &nbsp; - 下列值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dhcp: 对于指定接口，设置用 DHCP 配置 IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;地址。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;static: 设置使用本地静态配置设置 IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;地址。<br />
<br />
&nbsp; &nbsp; &nbsp; gateway &nbsp; &nbsp; &nbsp;- 下列值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;</span>: 您设置的 IP 地址的指定默认<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;网关。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;none: 不设置默认网关。<br />
&nbsp; &nbsp; &nbsp; gwmetric &nbsp; &nbsp; - 默认网关的跃点数。如果网关设置为 'none'，则<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;不应设置此字段。<br />
&nbsp; &nbsp; &nbsp; 只有在 'source' 为 'static' 时才设置下列选项:<br />
<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 指定接口的 IP 地址。<br />
&nbsp; &nbsp; &nbsp; mask &nbsp; &nbsp; &nbsp; &nbsp; - 指定 IP 地址的子网掩码。<br />
<br />
注释 &nbsp; : <span style="color: #b100b1; font-weight: bold;">用来将</span> IP 地址配置模式从 DHCP 模式改为 static，或从 static<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;模式改为 DHCP。用静态 IP 地址在接口上添加 IP 地址，或添加<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;默认网关。<br />
<br />
<br />
设置为DHCP模式（自动获取IP）：<br />
netsh interface ip <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> address &quot;本地连接&quot; dhcp<br />
<br />
设置为静态IP模式：<br />
netsh interface ip <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> address &quot;本地连接&quot; static 172.30.16.234 255.255.255.0 172.30.16.254 1<br />
<br />
<br />
<br />
<br />
<br />
<br />
设置 DNS 服务器模式和地址。<br />
<br />
<br />
用法: <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> dns [name=]<span style="color: #33cc33;">&lt;</span>string<span style="color: #33cc33;">&gt;</span> [source=]dhcp<span style="color: #33cc33;">|</span>static [addr=]<span style="color: #33cc33;">&lt;</span>IP address<span style="color: #33cc33;">&gt;|</span>none<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[[register=]none<span style="color: #33cc33;">|</span>primary<span style="color: #33cc33;">|</span>both]<br />
<br />
参数:<br />
<br />
&nbsp; &nbsp; &nbsp; 标志 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 值<br />
&nbsp; &nbsp; &nbsp; name &nbsp; &nbsp; &nbsp; &nbsp; - 界面的名称。<br />
&nbsp; &nbsp; &nbsp; source &nbsp; &nbsp; &nbsp; - 下面的值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dhcp: 设置 DHCP 作为为某一个界面配置 DNS 服务器的源。<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;静态: 设置配置 DNS 服务器的源为本地静态配置。<br />
<br />
&nbsp; &nbsp; &nbsp; addr &nbsp; &nbsp; &nbsp; &nbsp; - 下面的值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #33cc33;">&lt;</span>IP 地址<span style="color: #33cc33;">&gt;</span>: DNS 服务器的一个 IP。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;none: 清除 DNS 服务器列表。<br />
&nbsp; &nbsp; &nbsp; register &nbsp; &nbsp; - 下面的值之一:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;none: 禁用动态 DNS 注册。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;primary: 只在主 DNS 后缀下注册。<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;both: 在主 DNS 后缀下注册，也在特定连接后缀下注册。<br />
<br />
说明: &nbsp; &nbsp;设置 DNS 服务器配置为 DHCP 或静态模式。只有在源是“static”，<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;并且“addr” 选项也可用以为此特定的界面配置 DNS 服务器的 IP<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;地址的一个静态列表的情况下。<br />
<br />
<br />
设置为DHCP模式（自动获取DNS配置信息）：<br />
netsh interface ip <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> dns &nbsp;&quot;本地连接&quot; dhcp<br />
<br />
设置主DNS（注意这里有source项，而在添加DNS时是没有的。）<br />
netsh interface ip <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> dns &nbsp;&quot;本地连接&quot; static 59.51.78.211 primary<br />
<br />
清除 DNS 服务器列表<br />
netsh interface ip <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> dns &nbsp;&quot;本地连接&quot; static none</div></td></tr></tbody></table></div>
<p>相关资料：</p>
<p><a target="_blank" href="http://www.ihacklog.com/l.php?url=support.microsoft.com/kb/299540/zh-cn">有关 Internet 协议路由中的“自动跃点计数”功能的说明</a><br />
<a target="_blank" href="http://www.ihacklog.com/l.php?url=www.microsoft.com/china/technet/community/columns/cableguy/cg0903.mspx"><br />
《Windows TCP/IP 的默认网关行为》</a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=3887";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=3887" title="Permanent Link to windows下的功能强大的netsh命令" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=3887</a>
            </p>
             </div><h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2009年06月17日  //  <a href="http://ihacklog.com/software/cool_software_share/pichuliquanzidongpeizhiipdizhiwangguandns.html" title="批处理全自动配置IP地址,网关,dns">批处理全自动配置IP地址,网关,dns</a> (3)</li><li>2011年11月3日  //  <a href="http://ihacklog.com/software/tips/what-is-my-ip.html" title="what is my IP">what is my IP</a> (11)</li><li>2010年12月28日  //  <a href="http://ihacklog.com/server/windows-svn-server-setup.html" title="windows下SVN服务器的安装配置">windows下SVN服务器的安装配置</a> (1)</li><li>2010年04月10日  //  <a href="http://ihacklog.com/server/setup-bind-proxy-server-under-windows-7.html" title="Windows下安装BIND作为DNS缓存服务器">Windows下安装BIND作为DNS缓存服务器</a> (11)</li><li>2010年03月8日  //  <a href="http://ihacklog.com/software/tips/delete-windows-old.html" title="删除windows.old文件夹">删除windows.old文件夹</a> (5)</li><li>2009年11月5日  //  <a href="http://ihacklog.com/software/cool_software_share/n-ways-to-kill-process-under-windows-xp.html" title="windows xp 下结束进程的N种方法">windows xp 下结束进程的N种方法</a> (6)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/powerful-netsh.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>局域网受ARP欺骗攻击后的解决方法</title>
		<link>http://ihacklog.com/net/anti-arp.html</link>
		<comments>http://ihacklog.com/net/anti-arp.html#comments</comments>
		<pubDate>Thu, 25 Mar 2010 09:29:19 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>
		<category><![CDATA[ARP]]></category>
		<category><![CDATA[局域网]]></category>

		<guid isPermaLink="false">http://www.ihacklog.com/?p=3542</guid>
		<description><![CDATA[【故障现象】当局域网内某台主机运行ARP欺骗的木马程序时，会欺骗局域网内所有主机和安全网关，让所有上网的流量必须经过病毒主机。其他用户原来直接通过安全网关上网现在转由通过病毒主机上网，切换的时候用户会断一次线。 由于ARP欺骗的木马程序发作的时候会发出大量的数据包导致局域网通讯拥塞以及其自身处理能力的限制，用户会感觉上网速度越来越慢。当ARP欺骗的木马程序停止运行时，用户会恢复从安全网关上网，切换过程中用户会再断一次线。 【找出毒源】 已经知道毒源是 00-16-ec-3f-5d-1b 这台机子。 用nb...]]></description>
			<content:encoded><![CDATA[<p>【故障现象】当局域网内某台主机运行ARP欺骗的木马程序时，会欺骗局域网内所有主机和安全网关，让所有上网的流量必须经过病毒主机。其他用户原来直接通过安全网关上网现在转由通过病毒主机上网，切换的时候用户会断一次线。<br />
由于ARP欺骗的木马程序发作的时候会发出大量的数据包导致局域网通讯拥塞以及其自身处理能力的限制，用户会感觉上网速度越来越慢。当ARP欺骗的木马程序停止运行时，用户会恢复从安全网关上网，切换过程中用户会再断一次线。<br />
【找出毒源】<br />
已经知道毒源是 00-16-ec-3f-5d-1b 这台机子。<br />
用<a target="_blank" href="http://www.ihacklog.com/l.php?url=www.unixwiz.net/tools/nbtscan.html#download">nbtscan</a> 这个程序可以找到相应mac地址的主机的IP等信息。<br />
使用方法：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nbtscan <span style="color: #660033;">-m</span> 192.168.1.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span></div></td></tr></tbody></table></div>
<p>这里表示扫描192.168.1.0这个网段。</p>
<p><a href="http://static.ihacklog.com/wp-files/2010/03/nbtscan.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2010/03/nbtscan-550x355.png" alt="" title="nbtscan" width="550" height="355" class="alignnone size-medium wp-image-3543" /> </a></p>
<p>从上面结果可以看出毒源就是 172.30.16.36这台机子了。</p>
<p>用nbtstat 可以通过ip地址查询相应主机的mac地址：<br />
如：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nbtstat <span style="color: #660033;">-A</span> 192.168.1.99</div></td></tr></tbody></table></div>
<p>【解决办法】<br />
　　<br />
　　采用双向绑定的方法解决并且防止ARP欺骗。<br />
　　<br />
　　1、在PC上绑定安全网关的IP和MAC地址：<br />
　　<br />
　　1）首先，用arp命令获得获得安全网关的内网的MAC地址:<br />
<a href="http://static.ihacklog.com/wp-files/2010/03/arp.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2010/03/arp-550x207.png" alt="" title="arp" width="550" height="207" class="alignnone size-medium wp-image-3545" /> </a><br />
　　<br />
　　2）编写一个批处理文件antiarp.bat内容如下：<br />
　　</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">　　<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">echo</span> off<br />
　　arp <span style="color: #660033;">-d</span><br />
　　arp <span style="color: #660033;">-s</span> 172.30.16.254 00-d0-f8-ae-<span style="color: #000000;">23</span>-2c</div></td></tr></tbody></table></div>
<p>　　<br />
　　将文件中的网关IP地址和MAC地址更改为实际使用的网关 IP地址和MAC地址即可。<br />
　　<br />
　　将这个批处理软件拖到自启动目录中。<br />
　　<br />
　　　<br />
　　2、在安全网关上绑定用户主机的IP和MAC地址。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=3542";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=3542" title="Permanent Link to 局域网受ARP欺骗攻击后的解决方法" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=3542</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年07月17日  //  <a href="http://ihacklog.com/software/cool_software_share/currports.html" title="CurrPorts：windows下查看网络连接端口的利器">CurrPorts：windows下查看网络连接端口的利器</a> (0)</li><li>2010年05月6日  //  <a href="http://ihacklog.com/php/wordpress/plugins/hacklog-downloadmanager.html" title="wordpress下载管理插件Hacklog-downloadmanager v2.1.4">wordpress下载管理插件Hacklog-downloadmanager v2.1.4</a> (315)</li><li>2011年05月4日  //  <a href="http://ihacklog.com/linux/archlinux/install-win7-and-archlinux-part-1.html" title="win7/archlinux双系统安装手记（一）">win7/archlinux双系统安装手记（一）</a> (7)</li><li>2011年06月9日  //  <a href="http://ihacklog.com/software/xheditor-a-wysiwyg-editor.html" title="xhEditor开源可视化编辑器">xhEditor开源可视化编辑器</a> (2)</li><li>2008年12月25日  //  <a href="http://ihacklog.com/php/skills/discuz%e4%b8%ad%e7%9a%84%e5%88%86%e9%a1%b5%e5%87%bd%e6%95%b0.html" title="Discuz中的分页函数">Discuz中的分页函数</a> (0)</li><li>2011年11月25日  //  <a href="http://ihacklog.com/php/wordpress/upgrade/wordpress-multisite-setup.html" title="wordpress多用户站点配置">wordpress多用户站点配置</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/anti-arp.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>8.8.8.8</title>
		<link>http://ihacklog.com/net/8-8-8-8-a-dns-number-for-faster-browsing.html</link>
		<comments>http://ihacklog.com/net/8-8-8-8-a-dns-number-for-faster-browsing.html#comments</comments>
		<pubDate>Fri, 04 Dec 2009 14:35:20 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>

		<guid isPermaLink="false">http://www.hacklog.cn/?p=3346</guid>
		<description><![CDATA[据http://www.infoq.com/news/2009/12/Public-DNS-Google所言： Google is offering two DNS servers for public use, namely 8.8.8.8 and 8.8.4.4, in an attempt to further speed up browsing. google提供了两个DNS服务器： 8.8.8.8 和8.8.4.4 主要是为了解决三个问题：速度、安全、效率 Google finds this D...]]></description>
			<content:encoded><![CDATA[<p>据<a href="http://www.ihacklog.com/l.php?url=www.infoq.com/news/2009/12/Public-DNS-Google" target="_blank">http://www.infoq.com/news/2009/12/Public-DNS-Google</a>所言：<br />
Google is offering two DNS servers for public use, namely 8.8.8.8 and 8.8.4.4, in an attempt to further speed up browsing.<br />
google提供了两个DNS服务器： 8.8.8.8 和8.8.4.4</p>
<p>主要是为了解决三个问题：速度、安全、效率</p>
<blockquote><p>Google finds this DNS latency unacceptable and has opened up two globally distributed DNS servers to public use hoping to improve browsing speed. They are trying to address three main issues:</p>
<p>        * Speed: Resolver-side cache misses are one of the primary contributors to sluggish DNS responses. Clever caching techniques can help increase the speed of these responses. Google Public DNS implements pre-fetching: before the TTL on a record expires, we refresh the record continuously, asynchronously and independently of user requests for a large number of popular domains. This allows Google Public DNS to serve many DNS requests in the round trip time it takes a packet to travel to our servers and back.<br />
        * Security: DNS is vulnerable to spoofing attacks that can poison the cache of a name server and can route all its users to a malicious website. Until new protocols like DNSSEC get widely adopted, resolvers need to take additional measures to keep their caches secure. Google Public DNS makes it more difficult for attackers to spoof valid responses by randomizing the case of query names and including additional data in its DNS messages.<br />
        * Validity: Google Public DNS complies with the DNS standards and gives the user the exact response his or her computer expects without performing any blocking, filtering, or redirection that may hamper a user&#8217;s browsing experience.
</p></blockquote>
<p>目前我试用中，巧合的是发现换了这个DNS后google.cn无法访问了，google.com可以访问。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=3346";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=3346" title="Permanent Link to 8.8.8.8" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=3346</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2009年11月1日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/upgrade-to-ubuntu-9-10.html" title="upgrade to ubuntu 9.10 ">upgrade to ubuntu 9.10 </a> (3)</li><li>2010年03月30日  //  <a href="http://ihacklog.com/memory/music/today.html" title="今天 &#8211; 许巍2002-2008生活作品集">今天 &#8211; 许巍2002-2008生活作品集</a> (7)</li><li>2010年05月8日  //  <a href="http://ihacklog.com/php/wordpress/plugins/gravatar_cache.html" title="gravatar头像缓存插件——Hacklog Gravatar Cache">gravatar头像缓存插件——Hacklog Gravatar Cache</a> (48)</li><li>2012年01月22日  //  <a href="http://ihacklog.com/memory/happy-new-year-2012.html" title="祝各位新年快乐">祝各位新年快乐</a> (6)</li><li>2010年06月16日  //  <a href="http://ihacklog.com/software/cool_software_share/real-desktop.html" title="real desktop——让桌面名副其实">real desktop——让桌面名副其实</a> (3)</li><li>2009年11月11日  //  <a href="http://ihacklog.com/memory/hacklog/several-interesting-wp-blogs.html" title="几个有意思的博客">几个有意思的博客</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/8-8-8-8-a-dns-number-for-faster-browsing.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>常用网络测试命令之ping</title>
		<link>http://ihacklog.com/net/ping.html</link>
		<comments>http://ihacklog.com/net/ping.html#comments</comments>
		<pubDate>Mon, 26 Oct 2009 10:43:25 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>

		<guid isPermaLink="false">http://www.hacklog.cn/?p=2760</guid>
		<description><![CDATA[未完（待续&#8230;&#8230;) ping 命令是我在排除网络故障中使用得最频繁的一个命令之一。 该命令只有在安装了 tcp/ip 协议后才可以使用，它是用来检查网络是否通畅或者网络连接速度的命令。它所利用的原理是这样的：网络上的机器都有唯一确定的IP地址，我们给目标IP地址发送一个数据包，对方就要返回一个同样大小的数据包，根据返回的数据包我们可以确定目标主机的存在，可以初步甚至还可以判断目标主机的操作系统等。 这个命令在win和＊nix平台下都有。 先介绍在win平台下的吧： 一、win平台下的...]]></description>
			<content:encoded><![CDATA[<p><strong>未完（待续&#8230;&#8230;)</strong></p>
<p><strong>ping </strong>命令是我在排除网络故障中使用得最频繁的一个命令之一。<br />
该命令只有在安装了 tcp/ip 协议后才可以使用，它是用来检查网络是否通畅或者网络连接速度的命令。它所利用的原理是这样的：网络上的机器都有唯一确定的IP地址，我们给目标IP地址发送一个数据包，对方就要返回一个同样大小的数据包，根据返回的数据包我们可以确定目标主机的存在，可以初步甚至还可以判断目标主机的操作系统等。<br />
这个命令在win和＊nix平台下都有。<br />
先介绍在win平台下的吧：<br />
<strong>一、win平台下的ping命令</strong><br />
DOS窗口中键入：ping /? 回车<br />
可看到如下信息 :</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Documents and Settings\ihacklog.com<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #000000; font-weight: bold;">/</span>?<br />
<br />
Usage: <span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-t<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-a<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-n count<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-l <span style="color: #c20cb9; font-weight: bold;">size</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-f<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-i TTL<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-v TOS<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>-r count<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-s count<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>-j host-list<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-k host-list<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span>-w timeout<span style="color: #7a0874; font-weight: bold;">&#93;</span> target_name<br />
<br />
Options:<br />
&nbsp; &nbsp; <span style="color: #660033;">-t</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Ping the specified host <span style="color: #000000; font-weight: bold;">until</span> stopped.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;To see statistics and <span style="color: #7a0874; font-weight: bold;">continue</span> - <span style="color: #7a0874; font-weight: bold;">type</span> Control-Break;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;To stop - <span style="color: #7a0874; font-weight: bold;">type</span> Control-C.<br />
&nbsp; &nbsp; <span style="color: #660033;">-a</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Resolve addresses to hostnames.<br />
&nbsp; &nbsp; <span style="color: #660033;">-n</span> count &nbsp; &nbsp; &nbsp; Number of <span style="color: #7a0874; font-weight: bold;">echo</span> requests to send.<br />
&nbsp; &nbsp; <span style="color: #660033;">-l</span> <span style="color: #c20cb9; font-weight: bold;">size</span> &nbsp; &nbsp; &nbsp; &nbsp;Send buffer size.<br />
&nbsp; &nbsp; <span style="color: #660033;">-f</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Set Don<span style="color: #ff0000;">'t Fragment flag in packet.<br />
&nbsp; &nbsp; -i TTL &nbsp; &nbsp; &nbsp; &nbsp; Time To Live.<br />
&nbsp; &nbsp; -v TOS &nbsp; &nbsp; &nbsp; &nbsp; Type Of Service.<br />
&nbsp; &nbsp; -r count &nbsp; &nbsp; &nbsp; Record route for count hops.<br />
&nbsp; &nbsp; -s count &nbsp; &nbsp; &nbsp; Timestamp for count hops.<br />
&nbsp; &nbsp; -j host-list &nbsp; Loose source route along host-list.<br />
&nbsp; &nbsp; -k host-list &nbsp; Strict source route along host-list.<br />
&nbsp; &nbsp; -w timeout &nbsp; &nbsp; Timeout in milliseconds to wait for each reply.</span></div></td></tr></tbody></table></div>
<p>这个使用说明是英文的，对于习惯中文的人来说还是看中文的舒服些：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">参数<br />
<span style="color: #660033;">-t</span><br />
<span style="color: #c20cb9; font-weight: bold;">ping</span> 指定的计算机直到中断。ctrl+c停止<br />
<br />
<span style="color: #660033;">-a</span><br />
将地址解析为计算机名。例:c:\<span style="color: #000000; font-weight: bold;">&gt;</span><br />
（huangyewudeng就是他的为本地计算机名）<br />
C:\Documents and Settings\ihacklog.com<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-a</span> 127.0.0.1<br />
<br />
Pinging huangyewudeng <span style="color: #7a0874; font-weight: bold;">&#91;</span>127.0.0.1<span style="color: #7a0874; font-weight: bold;">&#93;</span> with <span style="color: #000000;">32</span> bytes of data:<br />
<br />
Reply from 127.0.0.1: <span style="color: #007800;">bytes</span>=<span style="color: #000000;">32</span> <span style="color: #000000; font-weight: bold;">time</span><span style="color: #000000; font-weight: bold;">&lt;</span>1ms <span style="color: #007800;">TTL</span>=<span style="color: #000000;">128</span><br />
Reply from 127.0.0.1: <span style="color: #007800;">bytes</span>=<span style="color: #000000;">32</span> <span style="color: #000000; font-weight: bold;">time</span><span style="color: #000000; font-weight: bold;">&lt;</span>1ms <span style="color: #007800;">TTL</span>=<span style="color: #000000;">128</span><br />
Reply from 127.0.0.1: <span style="color: #007800;">bytes</span>=<span style="color: #000000;">32</span> <span style="color: #000000; font-weight: bold;">time</span><span style="color: #000000; font-weight: bold;">&lt;</span>1ms <span style="color: #007800;">TTL</span>=<span style="color: #000000;">128</span><br />
Reply from 127.0.0.1: <span style="color: #007800;">bytes</span>=<span style="color: #000000;">32</span> <span style="color: #000000; font-weight: bold;">time</span><span style="color: #000000; font-weight: bold;">&lt;</span>1ms <span style="color: #007800;">TTL</span>=<span style="color: #000000;">128</span><br />
<br />
Ping statistics <span style="color: #000000; font-weight: bold;">for</span> 127.0.0.1:<br />
&nbsp; &nbsp; Packets: Sent = <span style="color: #000000;">4</span>, Received = <span style="color: #000000;">4</span>, Lost = <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> loss<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<br />
Approximate round trip <span style="color: #7a0874; font-weight: bold;">times</span> <span style="color: #000000; font-weight: bold;">in</span> milli-seconds:<br />
&nbsp; &nbsp; Minimum = 0ms, Maximum = 0ms, Average = 0ms<br />
<br />
<span style="color: #660033;">-n</span> count<br />
发送 count 指定的 <span style="color: #7a0874; font-weight: bold;">echo</span> 数据包数。默认值为 <span style="color: #000000;">4</span>。<br />
<span style="color: #660033;">-l</span> length<br />
发送包含由 length 指定的数据量的 <span style="color: #7a0874; font-weight: bold;">echo</span> 数据包。默认为 <span style="color: #000000;">32</span> 字节；最大值是 <span style="color: #000000;">65</span>,<span style="color: #000000;">527</span>。<br />
<span style="color: #660033;">-f</span><br />
在数据包中发送“不要分段”标志。数据包就不会被路由上的网关分段。<br />
<span style="color: #660033;">-i</span> ttl<br />
将“生存时间”字段设置为 ttl 指定的值。<br />
<br />
<br />
<span style="color: #660033;">-v</span> tos<br />
将“服务类型”字段设置为 tos 指定的值。<br />
<span style="color: #660033;">-r</span> count<br />
在“记录路由”字段中记录传出和返回数据包的路由。count 可以指定最少 <span style="color: #000000;">1</span> 台，最多 <span style="color: #000000;">9</span> 台计算机。<br />
<span style="color: #660033;">-s</span> count<br />
指定 count 指定的跃点数的时间戳。<br />
<span style="color: #660033;">-j</span> computer-list<br />
利用 computer-list 指定的计算机列表路由数据包。连续计算机可以被中间网关分隔（路由稀疏源）<span style="color: #c20cb9; font-weight: bold;">ip</span> 允许的最大数量为 <span style="color: #000000;">9</span>。<br />
<span style="color: #660033;">-k</span> computer-list<br />
利用 computer-list 指定的计算机列表路由数据包。连续计算机不能被中间网关分隔（路由严格源）<span style="color: #c20cb9; font-weight: bold;">ip</span> 允许的最大数量为 <span style="color: #000000;">9</span>。<br />
<span style="color: #660033;">-w</span> timeout<br />
指定超时间隔，单位为毫秒。<br />
destination-list<br />
指定要 <span style="color: #c20cb9; font-weight: bold;">ping</span> 的远程计算机。</div></td></tr></tbody></table></div>
<p><strong><br />
Tips:</strong></p>
<blockquote><p>TTL英文全称为Time to Live，意思就是生存周期。<br />
TTL是IP协议包中的一个值，它告诉网络,数据包（例如ICMP包）在网络中的时间是否太长而应被丢弃。有很多原因使包在一定时间内不能被传递到目的地。例如，不正确的路由表可能导致包的无限循环。一个解决方法就是在一段时间后丢弃这个包，然后给发送者一个报文，由发送者决定是否要重发。TTL的初值通常是系统缺省值，是包头中的8位的域。TTL的最初设想是确定一个时间范围，超过此时间就把包丢弃。由于每个路由器都至少要把TTL域减一，TTL通常表示包在被丢弃前最多能经过的路由器个数。当记数到0时，路由器决定丢弃该包，并发送一个ICMP报文给最初的发送者。<br />
　　TTL：(Time To Live ) 生存时间<br />
　　指定数据包被路由器丢弃之前允许通过的网段数量。<br />
　　TTL 是由发送主机设置的，以防止数据包不断在 IP 互联网络上永不终止地循环。转发 IP 数据包时，要求路由器至少将 TTL 减小 1。<br />
　　使用PING时涉及到的 ICMP 报文类型<br />
　　一个为ICMP请求回显（ICMP Echo Request）<br />
　　一个为ICMP回显应答（ICMP Echo Reply）<br />
　　TTL 字段值可以帮助我们识别操作系统类型。<br />
　　UNIX 及类 UNIX 操作系统 ICMP 回显应答的 TTL 字段值为 255<br />
　　Compaq Tru64 5.0 ICMP 回显应答的 TTL 字段值为 64<br />
　　微软 Windows NT/2K操作系统 ICMP 回显应答的 TTL 字段值为 128<br />
　　微软 Windows 95 操作系统 ICMP 回显应答的 TTL 字段值为 32<br />
　　当然，返回的TTL值是相同的<br />
　　但有些情况下有所特殊<br />
　　LINUX Kernel 2.2.x &#038; 2.4.x ICMP 回显应答的 TTL 字段值为 64<br />
　　FreeBSD 4.1, 4.0, 3.4; 、　　Sun Solaris 2.5.1, 2.6, 2.7, 2.8; 、　　OpenBSD 2.6, 2.7, 　　NetBSD 、　　HP UX 10.20 　　ICMP 回显应答的 TTL 字段值为 255<br />
　　Windows 95/98/98SE 、　　Windows ME 　　ICMP 回显应答的 TTL 字段值为 32<br />
　　Windows NT4 WRKS 、　　Windows NT4 Server 、　　Windows 2000 、　　Windows XP 　　ICMP 回显应答的 TTL 字段值为 128<br />
　　这样，我们就可以通过这种方法来辨别操作系统<br />
　　TTL值的注册表位置HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters 其中有个DefaultTTL的DWORD值，其数据就是默认的TTL值了，我们可以修改，但不能大于十进制的255</p></blockquote>
<p><strong><br />
个人用得比较多的参数有这几个：</strong><br />
a：解析主机地址。<br />
n：数据：发出的测试包的个数，缺省值为4。<br />
l：数值：所发送缓冲区的大小。<br />
t：继续执行Ping命令，直到用户按Ctrl＋C终上。</p>
<p><strong>常见的出错信息</strong>：<br />
1、Unknown host：不知名主机这种出错信息的意思是，该远程主机的名字不能被域名服务器(DNS)转换成IP地址。<br />
故障原因可能是域名服务器有故障，或者其名字不正确，或者网络管理员的系统与远程主机之间的通信线路有故障。<br />
2、Noanswer：无响应这种故障说明本地系统有一条通向中心主机的路由，但却接收不到它发给该中心主机的任何信息。故障原因可能是下列之一：中心主机没有工作；本地或中心主机网络配置不正确：本地或中心的路由器没有；通信线路有故障；中心主机存在路由选择问题。</p>
<p>3、Request timbd out：超时工作站与中心主机的连接超时，数据包全部丢失的原因：可能是到路由器的连接出现问题，或路由器不能通过，也可能是中心主机已经关机或死机。</p>
<p>要想让Ping命令有效发挥作用，我们首先需 要掌握使用该命令排查故障的一些测试顺序，只要依照顺序依次排查，再难解决的网络故障也能被很快解决掉，下面就是使用Ping命令测试故障原因的具体操作顺序：</p>
<p>（ps:先保证机器网线是插上的-_-)</p>
<p><strong>1.首先对本地工作站的循环地址127.0.0.1进行 ping测试。</strong><br />
当遇到一些无法直接找到故障原因的特殊网络故障时，我们首先需要使用Ping命令测试一下本地工作站的循环地址127.0.0.1能否被正常Ping通，倘若该地址无法被正常Ping通的话，那么说明本地工作站的TCP/IP协议程序受到了破坏，或者网卡设备发生了损坏。<br />
此时，我们不妨打开本地工作站系统的设备管理器窗口，从中找到网卡设备选项，并用鼠标右键单击该选项，从弹出的快捷菜单中执行“属性”命令，打开网卡设备的属性设置窗口，在该窗口的“常规”标签页面中我们就能看到当前的网卡工作状态是否正常了（如下图所示）。<br />
<a href="http://static.ihacklog.com/wp-files/2009/10/netcard.jpg" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2009/10/netcard-465x400.jpg" alt="netcard" title="netcard" width="465" height="400" class="alignnone size-medium wp-image-2761" /> </a></p>
<p>当发现网卡工作状态正常的话，那很有可能是本地工作站的TCP/IP协议程序受到了破坏，此时我们不妨打开本地连接属性设置窗口，选中并删除该设置窗口 中的TCP/IP协议选项，之后再重新安装一下TCP/IP协议程序，相信这么一来本地工作站的循环地址127.0.0.1就能被正常Ping通了。</p>
<p><strong>2.对本地工作站的IP地址进行ping测试。</strong><br />
在确认127.0.0.1地址能够被Ping通的情况下，我们继续使用Ping命令测试一下本地工作站的静态IP地址是否能被正常Ping通，倘若该地址不能被正常Ping通的话，那么说明本地工作站的网卡参数没有设置正确，或者网卡驱动程序不正确，也有可能是本地的路由表受到了破坏。此时我们可以重新检查一下本地工作站的网络参数是否设置正确(ipconfig /all)，如果在网络参数设置正确的情况下仍然无法Ping通本地IP地址的话，我们最好重新安装一下网卡设备的原装驱动程序，相信这 么一来我们就能正确Ping通本地工作站的静态IP地址了。一旦本地工作站的静态IP地址被顺利Ping通的话，那就表明本地工作站已经能够加入到局域网 网络中了。</p>
<p><strong>3.对本地局域网的默认网关地址进行ping测试。</strong><br />
 由于本地工作站是通过网关与局域网中的其他工作站进行相互通信的，只有本地工作站与默认网关之间连接正常，才能确保本地工作站与其他工作站通信正常。(注，在有些情况没有没有经过拨号认证前是无法ping通网关的，比如很多大学里采用的锐捷，在没有经过认证连网时是无法ping通网关的。)倘若网关地址能被正常Ping通的话，那就表明本地工作站可以与局域网中的其他工作站进行正常通信。<br />
要是Ping命令操作不成功的话，那很有可能是网关设备自身存在问题，或者是本地工作站与网关之间的线路连接不正常，也有可能是本地工作站与网关没有设 置成同一个子网中。此时，我们可以先用专业的线缆测试工具测试一下网络线缆的连通性，在线缆连通性正常的情况下，再检查本地工作站的网络参数是否与网关的参数设置成同一个子网中。<br />
倘若网络参数设置正确的话，我们再从其他工作站Ping一下网关地址，以便确认网关自身是否存在原因，如果局域网中的其他工作站也无法Ping通网关的话，那多半是网关设备自身存在问题，这个时候我们只要将故障排查重点锁定在网关设备上就可以了。</p>
<p><strong>4.对互联网中任意一台远程工作站的IP地址进行ping测试，以便检验本地工作站能否通过网关设备与局域网中的其他工作站进行通信。</strong><br />
（如对 google.cn (203.208.39.99) ）<br />
要是我们发现远程 工作站的IP地址无法Ping通的话，那很有可能是远程工作站自身无法响应，或者是远程工作站与网关设备之间的线路连接出现了问题，此时我们可以将网络故障的排查重点聚焦到远程工作站上或者是局域网的网络设备上。</p>
<p><strong>5.最后对互联网的远程工作站主机名称进行ping测试。</strong><br />
（如ping  google.cn ）<br />
在确认能够Ping通远程工作站IP地址的情况下，仍然出现无法访问远程工作站内容的时候，我们就有必要进行这一项测试操作。如果该主机名称无法被Ping成功的话，那很有可能是DNS解析出现了问题，而不是网络连接发生了故障，此时我们不妨把故障检查重锁定在可以检查网卡的DNS服务器上配置。</p>
<blockquote><p>小提示：为了有效地找出网络故障原因，我们在使用Ping命令进行测试检查时，尽量确保局域网中只配置了一个网关，同时确保本地工作站没有启用IP安全设置策略并且没有开启任何防火墙，这样可以保证Ping命令能够获得正确的测试结果。</p></blockquote>
<p><strong>停用Ping功能</strong></p>
<p>在网络访问一切正常的情况下，我们有时使用Ping命令测试某个地址的连通性时，会出现Ping不通的现象，其实这种现象并不能算是网络故障，因为目前 不少病毒程序会通过Ping命令向局域网中发送大量的垃圾包，以便实施ddos攻击，而许多服务器或工作站为了远离这样的非法攻击，常常会采取措施将 Ping功能关闭掉，如此一来就会出现在网络访问一切正常的情况下，仍然发生Ping不通的奇怪现象。</p>
<p>为了保护本地工作站的安全，我们在平时可以采取如下措施，确保其他用户无法Ping通本地工作站的IP地址,但是如此一来本地工作站的Ping功能就被暂时停止使用了。<br />
方法：运行->gpedit.msc<br />
1,创建一个名为noping的ip安全策略:<br />
<a href="http://static.ihacklog.com/wp-files/2009/10/ipsec.jpg" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2009/10/ipsec-550x291.jpg" alt="ipsec" title="ipsec" width="550" height="291" class="alignnone size-medium wp-image-2762" /> </a><br />
2,创建筛选器和筛选器操作<br />
右击“ip 安全策略，在 本地计算机“->在弹出的右键菜单中选择”管理ip筛选器和筛选器操作“<br />
分别添加一个ip筛选器（,取名为“禁止icmp”）和一个筛选器操作（取名为“阻止”）.<br />
接下来编辑名为noping的ip安全策略的属性，指定ip筛选器为”禁止icmp”,筛选器操作为“阻止”。<br />
最后右击该ip 安全策略，选择“指派”，这样该策略就生效了。<br />
现在无论是本机ping其它主机还是其它主机ping本机，都ping 不通了。</p>
<p>小提示：除了通过停用Ping功能来增强本地工作站的安全防范性能外，我们也可以通过伪装Ping命令测试结果的方法，来保护本地工作站或服务器的安 全。例如，在进行Ping命令测试时，如果DefaultTTL结果为128的话，我们就能判断目标主机的操作系统类型为Windows系统，如果 DefaultTTL结果为64的话，那目标主机的操作系统类型为Linux系统，根据这样的测试结果信息黑客就有可能实施有针对性地攻击，为此我们可以 故意伪装DefaultTTL结果信息，以便给黑客返回一个错误的结果，从而让黑客发动的非法攻击偏离方向。</p>
<p>要伪装DefaultTTL结果信息，我们只要先打开系统的注册表编辑窗口，并依次展开“HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Services\Tcpip\Parameters”分支，然后在“Parameters”分支下面创建一个 “DefaultTTL”双字节值，再将它的数值设置成其他任意一个数字。</p>
<p>例如在Windows系统下，我们可以尝试将DefaultTTL结果信息设置成“64”，那样一来黑客使用Ping命令测试本地工作站时，还认为本地 工作站安装了Linux系统，于是他们可能会针对Linux系统发动攻击，但这样的攻击不会对Windows系统工作站造成任何影响，如此一来本地工作站 的安全性就得到了一定程度的保证。</p>
<p><strong>pathping<br />
</strong><br />
在Windows 2000以上版本的工作站系统中，Ping命令还有一个“兄弟”作伴，这位“兄弟”其实就是平时很少露面的pathping命令，该命令在关键时刻也能帮 助我们找到网络故障原因。例如在网络访问速度非常缓慢的情况下，我们使用Ping命令或许根本找不到造成网络访问速度缓慢的故障原因，此时使用 pathping命令，我们就能轻易地找到究竟在哪一个网络连接环节出现了数据丢包现象。<br />
  该路由跟踪命令结合了 ping 和 tracert 命令的功能，可提供这两个命令都无法提供附加信息。经过一段时间，pathping 命令将数据包发送到最终目标位置途中经过的每个路由器，然后根据从每个跃点返回的数据包统计结果。因为 pathping 显示指定的所有路由器和链接的数据包的丢失程度，所以用户可据此确定引起网络问题的路由器或链接。<br />
     在cmd中，输入字符串命令“pathping xxx”，单击回车键后，我们就能从随后的结果信息中看到在访问DNS服务器过程中，中途经过了几个中间路由器（如下图所示）。</p>
<p><a href="http://static.ihacklog.com/wp-files/2009/10/pathping_google.jpg" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2009/10/pathping_google-550x389.jpg" alt="pathping_google" title="pathping_google" width="550" height="389" class="alignnone size-medium wp-image-2764" /> </a></p>
<p>并且能清楚地知道究竟在哪一个跳转环节发生了数据丢包或网络延时现象。如果我们发现某一个路由器的数据丢包率非常高的话，那么该路由器很有可能出现了意外，此时我们只要将故障检查重点锁定在对应路由器设备上就可以了。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=2760";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=2760" title="Permanent Link to 常用网络测试命令之ping" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=2760</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年05月22日  //  <a href="http://ihacklog.com/php/wordpress/plugins/hacklog-login-logger.html" title="查看会员登录记录的插件Hacklog Login Logger">查看会员登录记录的插件Hacklog Login Logger</a> (14)</li><li>2010年04月19日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/slide-pictured-link-show-page.html" title="为你的wp制作旋转木马图片链接展示页面">为你的wp制作旋转木马图片链接展示页面</a> (10)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/php-manual-for-vim.html" title="PHP Manual for Vim">PHP Manual for Vim</a> (1)</li><li>2009年10月29日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/ubuntu-9-10-released.html" title="Ubuntu 9.10官方正式版已经可以下载了">Ubuntu 9.10官方正式版已经可以下载了</a> (6)</li><li>2009年04月5日  //  <a href="http://ihacklog.com/php/%e7%bd%91%e9%a1%b5utf8%e7%bc%96%e7%a0%81%e5%bc%80%e5%8f%91%e4%b8%ad%e7%a9%ba%e7%99%bd%e7%9a%84%e9%97%ae%e9%a2%98.html" title="网页UTF8编码开发中空白的问题">网页UTF8编码开发中空白的问题</a> (0)</li><li>2011年04月5日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/jquery-fontsize-change-script-for-wordpress.html" title="给WP文章增加字体大小调整按钮">给WP文章增加字体大小调整按钮</a> (5)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/ping.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>锐捷共享上网最简单的方法及其原理分析</title>
		<link>http://ihacklog.com/net/ruijie-netshare-and-analysis-of-the-principle.html</link>
		<comments>http://ihacklog.com/net/ruijie-netshare-and-analysis-of-the-principle.html#comments</comments>
		<pubDate>Mon, 19 Oct 2009 11:46:55 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>

		<guid isPermaLink="false">http://www.hacklog.cn/?p=2729</guid>
		<description><![CDATA[锐捷认证在高校内使用得还是较为广泛的，基于802.1x ，采用帐号+绑定mac地址和IP地址的方法。对于Ethernet内部的 IP地址被盗用，绑定MAC地址与IP地址是比较有效的方法。 锐捷客户端本身可以检测到机器的多网卡，一发现有多网卡，则断网或者不能认证。如果使用homeshare等共享软件，它也可以检测到，貌似是五分钟断网一次（这个五分钟一般是学校可以设置的）。这样一来，如果要实现一个寝室开一个账号同时上几台机子，还是要花点时间来动点手脚了。关于如何突破锐捷的封鎖实现同寝室内共享上网，我这里就不说...]]></description>
			<content:encoded><![CDATA[<p>        锐捷认证在高校内使用得还是较为广泛的，基于802.1x ，采用帐号+绑定mac地址和IP地址的方法。对于Ethernet内部的 IP地址被盗用，绑定MAC地址与IP地址是比较有效的方法。</p>
<p>锐捷客户端本身可以检测到机器的多网卡，一发现有多网卡，则断网或者不能认证。如果使用homeshare等共享软件，它也可以检测到，貌似是五分钟断网一次（这个五分钟一般是学校可以设置的）。这样一来，如果要实现一个寝室开一个账号同时上几台机子，还是要花点时间来动点手脚了。关于如何突破锐捷的封鎖实现同寝室内共享上网，我这里就不说了，以前的文章中专门介绍过。这里讲一种最简单的实现共享上网的方法。<br />
      某日，一个同学刚开通了上网账号，但是他机子上没有锐捷网络客户端，我寝室里人又没有U盘，怎么办，我查看了他们寝室一个连了网的同学的机器的IP和MAC地址，然后把譔同学的IP和网卡MAC地址设置为与那位连了网的同学的一样。让我比较奇怪的事，两台同时开机接在同一个交 换机上的时候，居然不会报IP冲突，而且还可以同时上网。一般情况下如果在同一个局域网里存在两台相同IP的主机windows系统会报IP冲突的，想来windows 系统确定IP冲突是以同一IP被不同mac地址的网卡使用来判断的，既然两台机器的mac地址相同，windows也就识别不出IP冲突了，至于同时上网不冲突，回想了一下网络协议，也是有可能的，程序间的通信还需要使用端口，两个网卡收到同样的信息，其中一个正好监听正确接收，另一个因为端口号不同就废 弃掉。但如果两台机器程序使用同样的端口呢，是不是就会出现问题呢？</p>
<p>这个问题书上根本没有说，问了下老师，也只是说了下大概，还是请教万能的google吧：<br />
下面是从网上搜索到的答案，原作者是谁不知，在此我要感謝他的劳动，让一个困扰我多时的问题得到解决。</p>
<p><strong><br />
1.MAC与IP 地址绑定原理<br />
</strong></p>
<p>IP地址的修改非常容易，而MAC地址存储在网卡的EEPROM中，而且网卡的MAC地址是唯一确定的。因此，为了防止内部人员进行非法IP盗用(例 如盗用权限更高人员的IP地址，以获得权限外的信息)，可以将内部网络的IP地址与MAC地址绑定，盗用者即使修改了IP地址，也因MAC地址不匹配而盗 用失败：而且由于网卡MAC地址的唯一确定性，可以根据MAC地址查出使用该MAC地址的网卡，进而查出非法盗用者。</p>
<p>目前，很多单位的内部网络，尤其是学校校园网都采用了MAC地址与IP地址的绑定技术。许多防火墙（硬件防火墙和软件防火墙）为了防止网络内部的IP地址被盗用，也都内置了MAC地址与IP地址的绑定功能。</p>
<p>从表面上看来，绑定MAC地址和IP地址可以防止内部IP地址被盗用，但实际上由于各层协议以及网卡驱动等实现技术，MAC地址与IP地址的绑定存在很大的缺陷，并不能真正防止内部IP地址被盗用。</p>
<p><strong>2 破解MAC与IP地址绑定策略</strong></p>
<p><strong>2.1 IP地址和MAC地址简介<br />
</strong><br />
现行的TCP/IP网络是一个四层协议结构，从下往上依次为链路层、网络层、传输层和应用层。</p>
<p>Ethernet协议是链路层协议，使用的地址是MAC地址。MAC地址是Ethernet网卡在Ethernet中的硬件标志，网卡生产时将其存于 网卡的EEPROM中。网卡的MAC地址各不相同，MAC地址可以唯一标志一块网卡。在Ethernet上传输的每个报文都含有发送该报文的网卡的MAC 地址。</p>
<p>Ethernet根据Ethernet报文头中的源MAC地址和目的MAC来识别报文的发送端和接收端。IP协议应用于网络层，使用的地址为IP地 址。使用IP协议进行通讯，每个IP报文头中必须含有源IP和目的IP地址，用以标志该IP报文的发送端和接收端。在Ethernet上使用IP协议传输 报文时，IP报文作为Ethernet报文的数据。IP地址对于Ethernet交换机或处理器是透明的。用户可以根据实际网络的需要为网卡配置一个或多 个IP地址。MAC地址和IP地址之间并不存在一一对应的关系。</p>
<p>MAC地址存储在网卡的EEPROM中并且唯一确定，但网卡驱动在发送Ethernet报文时，并不从EEPROM中读取MAC地址，而是在内存中来 建立一块缓存区，Ethernet报文从中读取源MAC地址。而且，用户可以通过操作系统修改实际发送的Ethernet报文中的源MAC地址。既然 MAC地址可以修改，那么MAC地址与IP地址的绑定也就失去了它原有的意义。</p>
<p><strong>2.2 破解方案<br />
</strong><br />
下图是破解试验的结构示意图。其内部服务器和外部服务器都提供Web服务，防火墙中实现了MAC地址和IP地址的绑定。报文中的源MAC地址与1P地 址对如果无法与防火墙中设置的MAC地址与1P地址对匹配，将无法通过防火墙。主机2和内部服务器都是内部网络中的合法机器；主机1是为了做实验而新加入 的机器。安装的操作系统是W2000企业版，网卡是3Com的。</p>
<p>试验需要修改主机1中网卡的MAC和IP地址为被盗用设备的MAC和IP地址。首先，在控制面板中选择“网络和拨号连接”，选中对应的网卡并点击鼠标 右键，选择属性，在属性页的“常规”页中点击“配置”按钮。在配置属性页中选择“高级”，再在“属性”栏中选择“Network Address”，在“值”栏中选中输人框，然后在输人框中输人被盗用设备的MAC地址，MAC地址就修改成功了。</p>
<p>然后再将IP地址配置成被盗用设备的IP地址。盗用内部客户机IP地址：将主机1的MAC地址和IP地址分别修改为主机2的MAC地址和IP地址。主 机1可以访问外部服务器，能够顺利地通过防火墙，访问权限与主机2没有分别。而且，与此同时主机2也可以正常地访问外部服务器，完全不受主机1的影响。无 论是主机2还是防火墙都察觉不到主机1的存在。主机1如果访问内部服务器，根本无需通过防火墙，更是畅通无阻了。</p>
<p>盗用内部服务器IP地址：将主机1的MAC地址和U地址修改为内部服务器的MAC地址和IP地址。主机1也提供Web服务。为了使效果更明显，主机1上提供的Web服务内容与内部服务器提供的内容不同。</p>
<p>因为在实际的实验中主机1与主机2连在同一个HUB上，主机2的访问请求总是先被主机1响应，主机2期望访问的是内部服务器，得到的却总是主机1提供 的内容。更一般地，主机2如果试图访问内部服务器，获得的到底是主机1提供的内容还是内部服务器提供的内容具有随机性，要看它的访问请求首先被谁响应，在 后面的分析中我们将进一步对此进行阐述。</p>
<p>盗用服务器的MAC和IP危害可能更大，如果主机1提供的Web内容和内部服务器中的内容一样，那么主机2将无法识别它访问的到底是哪个机器；如果Web内容中要求输人账号、密码等信息，那么这些信息对于主机1来说则是一览无遗了。<br />
<strong><br />
3 破解成功的原因</strong></p>
<p>上面的实验验证了绑定MAC地址与IP地址的确存在很大的缺陷，无法有效地防止内部IP地址被盗用。接下来，将从理论上对该缺陷进行详细的分析。</p>
<p>缺陷存在的前提是网卡的混杂接收模式，所谓混杂接收模式是指网卡可以接收网络上传输的所有报文，无论其目的MAC地址是否为该网卡的MAC地址。正是 由于网卡支持混杂模式，才使网卡驱动程序支持MAC地址的修改成为可能；否则，就算修改了MAC地址，但是网卡根本无法接收相应地址的报文，该网卡就变得 只能发送，无法接收，通信也就无法正常进行了。</p>
<p>MAC地址可以被盗用的直接原因是网卡驱动程序发送Ethernet报文的实现机制。Ethernet报文中的源MAC地址是驱动程序负责填写的，但 驱动程序并不从网卡的EEPROM中读取MAC，而是在内存中建立一个MAC地址缓存区。网卡初始化的时候将EEPROM中的内容读入到该缓存区。如果将 该缓存区中的内容修改为用户设置的MAC地址，以后发出去的Ethernet报文的源地址就是修改后的MAC地址了。</p>
<p>如果仅仅是修改MAC地址，地址盗用并不见得能够得逞。Ethernet是基于广播的，Ethernet网卡都能监听到局域网中传输的所有报文，但是 网卡只接收那些目的地址与自己的MAC地址相匹配的Ethernet报文。如果有两台具有相同MAC地址的主机分别发出访问请求，而这两个访问请求的响应 报文对于这两台主机都是匹配的，那么这两台主机就不只接收到自己需要的内容，而且还会接收到目的为另外一台同MAC主机的内容。</p>
<p>按理说，两台主机因为接收了多余的报文后，都应该无法正常工作，盗用马上就会被察觉，盗用也就无法继续了；但是，在实验中地址被盗用之后，各台实验设备都可以互不干扰的正常工作。这又是什么原因呢?答案应该归结于上层使用的协议。</p>
<p>目前，网络中最常用的协议是TCP/IP协议，网络应用程序一般都是运行在TCP或者UDP之上。例如，实验中Web服务器采用的HTTP协议就是基于 TCP的。在TCP或者UDP中，标志通信双方的不仅仅是IP地址，还包括端口号。在一般的应用中，用户端的端口号并不是预先设置的，而是协议根据一定的 规则生成的，具有随机性。像上面利用IE来访问Web服务器就是这样。UDP或者TCP的端口号为16位二进制数，两个16位的随机数字相等的几率非常 小，恰好相等又谈何容易?两台主机虽然MAC地址和IP地址相同，但是应用端口号不同，接收到的多余数据由于在TCP/UDP层找不到匹配的端口号，被当 成无用的数据简单地丢弃了，而TCP/UDP层的处理对于用户层来说是透明的；所以用户可以“正确无误”地正常使用相应的服务，而不受地址盗用的干扰。</p>
<p>当然，某些应用程序的用户端口号可能是用户或者应用程序自己设置的，而不是交给协议来随机的生成。那么，结果又会如何呢?例如，在两台MAC地址和IP地址都相同的主机上，启动了两个端口相同的应用程序，这两个应用是不是就无法正常工作了呢?其实不尽然。</p>
<p>如果下层使用的是UDP协议，两个应用将互相干扰无法正常工作。如果使用的是TCP协议，结果就不一样了。因为TCP是面向连接的，为了实现重发机 制，保证数据的正确传输，TCP引入了报文序列号和接收窗口的概念。在上述的端口号匹配的报文中，只有那些序列号的偏差属于接收窗口之内的报文才会被接 收，否则，会被认为是过期报文而丢弃。TCP协议中的报文的序列号有32位，每个应用程序发送的第一个报文的序列号是严格按照随机的原则产生的，以后每个 报文的序列号依次加1。</p>
<p>窗口的大小有16位，也就是说窗口最大可以是216，而序列号的范围是232，主机期望接收的TCP数据的序列号正好也处于对方的接收范围之内的概率为1/216，可谓小之又小。 TCP的序列号本来是为了实现报文的正确传输，现在却成了地址盗用的帮凶。</p>
<p><strong>4 解决MAC与IP地址绑定被破解的方法</strong></p>
<p>解决MAC与IP地址绑定被破解的方法很多，主要以下几种。</p>
<p>交换机端口、MAC地址和IP地址三者绑定的方法；<br />
代理服务与防火墙相结合的方法；<br />
用PPPoE协议进行用户认证的方法；<br />
基于目录服务策略的方法；<br />
统 一身份认证与计费软件相结合的方法等</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=2729";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=2729" title="Permanent Link to 锐捷共享上网最简单的方法及其原理分析" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=2729</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2011年10月6日  //  <a href="http://ihacklog.com/software/cool_software_share/pdf-viewer-for-linuxer.html" title="两个Linux下的pdf阅读器">两个Linux下的pdf阅读器</a> (3)</li><li>2011年08月20日  //  <a href="http://ihacklog.com/php/habari/tinyfader-for-habari.html" title="Tinyfader for Habari">Tinyfader for Habari</a> (0)</li><li>2010年06月6日  //  <a href="http://ihacklog.com/software/tips/php-wget-bat-down-youku-flv.html" title="PHP+wget+bat批量下载合并youku视频">PHP+wget+bat批量下载合并youku视频</a> (6)</li><li>2008年12月31日  //  <a href="http://ihacklog.com/php/%e4%b8%bb%e6%9d%bf%e7%b3%bb%e5%88%97%e7%9f%a5%e8%af%86%ef%bc%9a%e4%b8%bb%e6%9d%bf%e7%bb%93%e6%9e%84.html" title="主板系列知识：主板结构">主板系列知识：主板结构</a> (0)</li><li>2009年08月27日  //  <a href="http://ihacklog.com/php/wordpress/problems/nextgen-gallery-guilty.html" title="原来NextGEN Gallery才是罪魁祸首">原来NextGEN Gallery才是罪魁祸首</a> (4)</li><li>2008年12月27日  //  <a href="http://ihacklog.com/software/tips/top100cn%e5%b7%a8%e9%b2%b8%e9%9f%b3%e4%b9%90%e7%bd%91.html" title="top100.cn巨鲸音乐网">top100.cn巨鲸音乐网</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/ruijie-netshare-and-analysis-of-the-principle.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>精通ip地址之ipv4</title>
		<link>http://ihacklog.com/net/proficient-ip-address.html</link>
		<comments>http://ihacklog.com/net/proficient-ip-address.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 09:18:31 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[计算机网络]]></category>

		<guid isPermaLink="false">http://www.hacklog.cn/?p=2553</guid>
		<description><![CDATA[各位童鞋们，大家好！今天我要给大家介绍的是ipv4地址。高手请略过，见笑啦-_- ip地址有很多种表示方式，比如最常用的是用十进制加上点号表示（如192.168.1.2)。ipv4现在还是主流，下面我就讲下ipv4。 ipv4下，ip地址是一个32位的数，而平常我们看到的ip都是如192.168.1.2之类的，这样看不出它是32位，其实以点号为分隔符，把每一位转换为二进制，前面不足八位的补0就是了，比如最常用的本地轮回地址 127.0.0.1 用二进制表示就是： 011111110000000000000...]]></description>
			<content:encoded><![CDATA[<p>各位童鞋们，大家好！今天我要给大家介绍的是ipv4地址。高手请略过，见笑啦-_-<br />
ip地址有很多种表示方式，比如最常用的是用十进制加上点号表示（如192.168.1.2)。ipv4现在还是主流，下面我就讲下ipv4。<br />
ipv4下，ip地址是一个32位的数，而平常我们看到的ip都是如192.168.1.2之类的，这样看不出它是32位，其实以点号为分隔符，把每一位转换为二进制，前面不足八位的补0就是了，比如最常用的本地轮回地址 </p>
<blockquote><p>127.0.0.1</p></blockquote>
<p> 用二进制表示就是：</p>
<blockquote><p>01111111000000000000000000000001</p></blockquote>
<p>再把它转换为十进制数即是</p>
<blockquote><p>2130706433</p></blockquote>
<p>下面我们ping 一下这个数看，有什么发现？</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ping</span> <span style="color: #660033;">-c4</span> <span style="color: #000000;">2130706433</span><br />
PING <span style="color: #000000;">2130706433</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>127.0.0.1<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">56</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">84</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.<br />
<span style="color: #000000;">64</span> bytes from 127.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.027</span> ms<br />
<span style="color: #000000;">64</span> bytes from 127.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.031</span> ms<br />
<span style="color: #000000;">64</span> bytes from 127.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.033</span> ms<br />
<span style="color: #000000;">64</span> bytes from 127.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">4</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.025</span> ms<br />
<br />
<span style="color: #660033;">---</span> <span style="color: #000000;">2130706433</span> <span style="color: #c20cb9; font-weight: bold;">ping</span> statistics <span style="color: #660033;">---</span><br />
<span style="color: #000000;">4</span> packets transmitted, <span style="color: #000000;">4</span> received, <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> packet loss, <span style="color: #000000; font-weight: bold;">time</span> 2999ms<br />
rtt min<span style="color: #000000; font-weight: bold;">/</span>avg<span style="color: #000000; font-weight: bold;">/</span>max<span style="color: #000000; font-weight: bold;">/</span>mdev = <span style="color: #000000;">0.025</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.029</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.033</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.003</span> ms</div></td></tr></tbody></table></div>
<p>以上是我在linux下ping 的，如果你在windows下，可以用</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ping &nbsp;2130706433</div></td></tr></tbody></table></div>
<p>来测试。</p>
<p>ip地址＝网络号（网络地址）＋主机号<br />
网络地址其实就是网段地址，它不能作为ip地址来使用，只能用来表示网段信息。（如192.168.1.0)<br />
主机号全为1的地址称为广播地址（如192.168.1.255）<br />
特殊地址：</p>
<blockquote><p> 0.0.0.0  </p></blockquote>
<p>表示本网段，也叫做任意网段或未知网络，它主要用在DHCP請求和默认路由上，既能作为源地址，又能作为目标地址使用。</p>
<blockquote><p>255.255.255.255</p></blockquote>
<p> 被称为本地广播地址，能在本网段进行信息扩散。<br />
本地环回地址：</p>
<blockquote><p>127.0.0.1-127.255.255.254</p></blockquote>
<p>默认环回地址为</p>
<blockquote>
<blockquote><p>127.0.0.1</p></blockquote>
<p>，且对应wins或DNS名称被自动解析为</p></blockquote>
<p>localhost  ,它主要用来测试机器TCIP/IP协议是否存在问题。</p>
<p><strong>一，分类ip地址</strong></p>
<p>A类地址（1.0.0.1-127.255.255.254）中有一段私有ip地址：</p>
<blockquote><p>10.0.0.1-10.255.255.254</p></blockquote>
<p>可简写为10.0.0.0/8 (为什么这样写，不解释，先)。<br />
B类地址（128.0.0.1-191.255.255.254)私有ip地址范围：</p>
<blockquote><p>172.16.0.1-172.31.255.254</p></blockquote>
<p>   B类地址中还有一段特殊私有ip地址：当DHCP服务器出现问题导致无法将DHCP池中的IP地址分配给客户端时，就得使用这个特殊的保留的B类私有IP，其有效范围为：</p>
<blockquote><p>169.254.0.1-169.254.255.254</p></blockquote>
<p>C类ip地址（192.0.0.1-223.255.255.254)中私有ip地址范围为：</p>
<blockquote><p>192.168.0.1-192.168.255.254</p></blockquote>
<p><strong><br />
二，基于分类的ip地址的子网划分</strong><br />
1，<br />
这是在分类ip地址的情况下进行子网划分，即将主机号再划分为子网号和主机号。<br />
（注：网络号没变，只是向主机号借位来作为子网号）<br />
例：某单位B类IP 为172.16.0.0 ，现有3个部门，要求3个部门用不同的ip地址段，这可以通过进行子网划分来实现。如：<br />
172.16.1.0<br />
172.16.2.0<br />
172.16.3.0<br />
这是一种比较简单的情况，这里我们向主机号（原来有16位）借8位过来作为子网号。</p>
<p>2，子网掩码<br />
子网掩码和ip地址进行逐比特（bit）”与”运算，結果就是网络地址。<br />
子网掩码位对应的网络号和子网号均为1 ，主机号则取0 。<br />
如上例中的172.16.2.8 ,它的子网掩码为255.255.255.0<br />
两者进行“与“运算即得网络地址为172.16.2.0 </p>
<p>    默认子网掩码：只考虑网络号而不考虑子网号，所以<br />
    A类： 255.0.0.0<br />
    B类：255.255.0.0<br />
    C类：255.255.255.0<br />
D、E类不考虑这个。<br />
<strong><br />
三，VLSM 与CIDR  （可变长子网掩码和无类域间路由）</strong><br />
1，无类ip地址：即不再使用A 、B、C类的划分方法，但D 、E类仍作为分类ip使用。<br />
无类ip地址使用VLSM （Variable length Subnet Mask）技术来对IP地址进行划分。<br />
CIDR（Classless  Inter-Domain Routing ) 有三种表示法：<br />
下面以192.168.1.0为例，若前20位表示主机号位数：</p>
<p>（1），X表示法：<br />
11000000.10101000.000xxxxxxxxxxxx<br />
（2），星号表示法：只用一个星号来表示主机号位数<br />
11000000.10101000.0000*<br />
（3），斜线表示法：斜线后数字表示网络号位数，这也种表示法是最常用的。<br />
192.168.1.0/20     (这里要写成十进制形式)</p>
<p>2，路由聚合<br />
路由聚合又叫构成超网。<br />
路由聚合其实就是把多个路由合并成一个路由，这样可以减轻路由表的开销。<br />
构成超网则表示一个网络地址包含了多个网络地址。<br />
例如：前10位表示网络号，后22位表示主机号，</p>
<blockquote><p>AAAAAAAA.AABBBBBB.BBBBBBBB.BBBBBBBB</p></blockquote>
<p>现在我们来算一下它包含的分类ip地址数：<br />
B类网络地址数为：2^6=64个，C类网络数为2^14=16384个<br />
可看出这个无类网络地址包含了64个B类网络和16384个C类网络，而其中64个B类网络中已经包含了16384个C类网络，这就是路由聚合。</p>
<p>3，网段划分<br />
好处：方便管理、分隔广播域防止ARP攻击、防止广播风暴、有效利用IP地址。<br />
例1 ：某主机IP表示为 172.16.1.12/20<br />
它的子网掩码是？  很容易可以知道是：255.255.240.0<br />
该网段能容纳的主机数是？<br />
2^12-2=4094台  （为什么要减2 ？自己想一下）</p>
<p>例2：有4个网络地址：<br />
172.168.193.0/24<br />
172.168.194.0/24<br />
172.168.196.0/24<br />
172.168.198.0/24<br />
求进行路由聚合后的网络地址？<br />
方法：<br />
用“最长前缀匹配法”<br />
由于前两个字节（Byte）完全相同，因此只需把第3个字节划为二进制形式：</p>
<blockquote><p>
11000001    (193)<br />
11000010    (194)<br />
11000100    (196)<br />
11000110    (198)</p></blockquote>
<p>现在对比下，前5位完全相同，这样后3位就不再是网络号，而是主机号了。<br />
所以聚合后网络地址为：</p>
<blockquote><p>172.168.192.0/21</p></blockquote>
<p>PS:<br />
关于ADSL虚拟拨号获得的子网掩码为</p>
<blockquote><p>255.255.255.255</p></blockquote>
<p>如果子网掩码类似于255.255.255.248这样的，则我们可以对获得的IP进行网段划分，这样我们就可以得到多个IP地址，显然这样电信就会吃亏，所以子网掩码就只能为255.255.255.255<br />
虚拟拨号：采用拨号池（类似DHCP池），用户每次拨号就从拨号池中选出一个IP给用户，这也是ADSL拨号上网每次IP地址不同的原因。</p>
<p>写了这么多，手都酸了（由于我的桌子太高，手总是悬着很吃力。。。。。。），所以文章中能省的地方我一切从简，写得不是很詳細，将就着看吧-_-</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=2553";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=2553" title="Permanent Link to 精通ip地址之ipv4" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=2553</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2011年12月20日  //  <a href="http://ihacklog.com/php/wordpress/plugins/hacklog-remote-attachment-upaiyun-version.html" title="Hacklog Remote Attachment Upyun(又拍云版) v1.2.6">Hacklog Remote Attachment Upyun(又拍云版) v1.2.6</a> (39)</li><li>2011年06月26日  //  <a href="http://ihacklog.com/server/vsftpd/about-vsftpd-anoymous-and-virtual-user.html" title="关于vsftpd匿名+虚拟用户的一些认识">关于vsftpd匿名+虚拟用户的一些认识</a> (1)</li><li>2010年06月16日  //  <a href="http://ihacklog.com/software/cool_software_share/fences.html" title="栅栏桌面-Fences">栅栏桌面-Fences</a> (5)</li><li>2009年05月24日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/ubuntufenquhewenjianxitongdexuanze.html" title="Ubuntu 分区和文件系统的选择">Ubuntu 分区和文件系统的选择</a> (0)</li><li>2008年12月31日  //  <a href="http://ihacklog.com/php/cpu%e5%9f%ba%e7%a1%80%e7%9f%a5%e8%af%86%ef%bc%9acpu%e5%89%8d%e7%ab%af%e6%80%bb%e7%ba%bf.html" title="CPU基础知识：CPU前端总线">CPU基础知识：CPU前端总线</a> (0)</li><li>2009年09月28日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/wordpress-under-html-editor-open-anchor-in-new-window.html" title="让wordpress在 HTML编辑器下添加链接在新窗口中打开">让wordpress在 HTML编辑器下添加链接在新窗口中打开</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/net/proficient-ip-address.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

