<?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>简单生活 -- Kevin Yang的博客 &#187; Ad-Hoc</title>
	<atom:link href="http://www.imkevinyang.com/tags/ad-hoc/feed" rel="self" type="application/rss+xml" />
	<link>http://www.imkevinyang.com</link>
	<description>It&#039;s all about sharing</description>
	<lastBuildDate>Sun, 05 Feb 2012 15:37:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>G1手机与笔记本实现Wifi互联共享上网</title>
		<link>http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html</link>
		<comments>http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:56:57 +0000</pubDate>
		<dc:creator>Kevin Yang</dc:creator>
				<category><![CDATA[工具技巧]]></category>
		<category><![CDATA[Ad-Hoc]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[G1]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Wifi]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[上网]]></category>
		<category><![CDATA[共享]]></category>
		<category><![CDATA[虚拟路由]]></category>

		<guid isPermaLink="false">http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html</guid>
		<description><![CDATA[<p><a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a>的G1手机上带有WIFI设备，如果周围有无线AP的话直接连上就可以上网了。在公司没问题，有无线网络，可是家里没有无线路由，WIFI没法用。<a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a>了一把，很多人都说可以使用笔记本的无线网卡做为AP使用，这样G1就可以连上笔记本，进而通过共享笔记本的有线网络上网。</p>
<p>但是我尝试了若干种方案&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a>的G1手机上带有WIFI设备，如果周围有无线AP的话直接连上就可以上网了。在公司没问题，有无线网络，可是家里没有无线路由，WIFI没法用。<a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a>了一把，很多人都说可以使用笔记本的无线网卡做为AP使用，这样G1就可以连上笔记本，进而通过共享笔记本的有线网络上网。</p>
<p>但是我尝试了若干种方案均以失败告终。先是下了个傻瓜软件Connectify，说是通过简单的设置就可以把无线网卡变成无线AP来使用。但是运行发现建立不了AP，后来上官网查了一下，发现我的Dell D520内置的Intel 3945ABG无线网卡被摆在了不兼容列表。还有人说Windows 7就直接内置了将无线网卡变成虚拟路由（VirtualRounter）的功能，只是界面上不提供，可以通过以下命令行开启：</p>
<pre class="csharpcode">netsh wlan <span class="kwrd">set</span> hostednetwork mode=allow ssid=Hotspot <span class="kwrd">key</span>=passwordhere
netsh wlan <span class="kwrd">start</span> hostednetwork</pre>
<p>我运行了一下，第一行代码没问题，但是运行第二行代码启动该网络的时候却失败了。显示无法启动承载网络XXX。</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.imkevinyang.com/wp-content/uploads/2010/03/image1.png" width="564" height="169" /> </p>
<p>后来在Intel的官网上看到一个MyWifi的工具和相应的支持驱动，据说是今年新出的，也是为了实现Wifi互联的，下载下来开始安装，却发现官网上的安装图示明明有一个“MyWifi”的条目，可是在我上面却没找到。难道真是这个3945的网卡不支持这功能？</p>
<p>最后总算在Android论坛上找到正确的方向（帖子地址：<a title="G1终于实现了利用手机wifi连接笔记本wifi共享宽带上网" href="http://a.opda.cn/thread-1442-1-1.html" target="_blank">《G1终于实现了利用手机wifi连接笔记本wifi共享宽带上网》</a>），那就是使用Ad-Hoc模式来连接，而不是无线AP这种方式。我不是很清楚这两种有什么区别，感觉一个就是点对点的连接，一个是点对面的连接。在讲具体步骤之前先列一下我当前的系统情况：</p>
<ul>
<li>Windows 7操作系统</li>
<li>Intel(R) Pro/Wireless 3945ABG无线网卡</li>
<li>Broadcom 440x 10/100 Integrated Controller有线网卡（连着ADSL可以上网）</li>
<li>搭载<a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a> Android的G1手机</li>
</ul>
<p>下面讲一下详细的步骤：</p>
<h3>准备工作</h3>
<p>一会需要编辑到某些系统配置文件，如果你熟悉Linux命令行和VI编辑器的话，那么你可以直接打开G1上面自带的终端来修改。否则你可以去下一个软件，叫91手机助手Android版，直接把文件下载到PC上进行修改，然后再上传到原来的目录覆盖。在PC上如何操作就不说了，需要提一下的是在终端下操作需要注意的步骤：</p>
<p>1. 打开终端</p>
<p>2. 输入su，切换到管理员（SuperUser）模式，这样一会儿才有权限修改系统文件，此时Android系统会提示你是否允许当前用户使用管理员权限，选“确定”即可。</p>
<p>3. 使用以下代码重新加载system分区，使到里头的文件可写：</p>
<pre class="csharpcode">mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system</pre>
<p>4. 使用cd命令进入/system/etc/wifi目录</p>
<pre class="csharpcode">cd /system/etc/wifi</pre>
<p>5. 使用vi打开tiwlan.ini文件</p>
<pre class="csharpcode">vi tiwlan.ini</pre>
<p>接下来的操作就是标准的VI编辑操作了，在这里就不细讲了。大家可以<a href="http://www.imkevinyang.com/tags/google" class="st_tag internal_tag" rel="tag" title="Posts tagged with Google">Google</a>一下。</p>
<h3>启用G1手机的Ad-Hoc连接功能</h3>
<p>找到tiwlan.ini文件中的这一行设置：</p>
<pre class="csharpcode">WiFiAdhoc = 0</pre>
<p>我们需要将其值修改为1，表示启用ad-hoc模式，同时加上两行额外的代码：</p>
<pre class="csharpcode">WiFiAdhoc = 1
dot11DesiredSSID = MyHTCDream
dot11DesiredBSSType = 0</pre>
<p>上面代码中的第二行后面的值表示网络ID号，你也可以设置为其他值。</p>
<h3>在G1手机中添加Ad-Hoc网络</h3>
<p>接下来，我们需要在G1手机中添加一个Ad-Hoc网络，打开/data/misc/wifi/wpa_supplicant.conf文件，在文件末尾添加几行代码：</p>
<pre class="csharpcode">network = {
  ssid=<span class="str">&quot;MyHTCDream&quot;</span>
  scan_ssid=1
  key_mgmt=NONE
  mode=1
}</pre>
<p>这里头要注意两个地方，一个是SSID一定要和上一步中设置的SSID号一样。还有mode的值必须为1，表示这是一个Ad-Hoc网络。</p>
<p>重启Wifi设备（禁用再启用即可）然后刷新Windows 7的网络列表，就会看到多了一个“MyHTCDream”的网络。</p>
<h3>将G1手机配置成静态IP模式</h3>
<p><strong><font color="#008000">由于Ad-Hoc连接不支持DHCP自动获取IP，所以需要将G1的Wifi配置成静态IP，否则一会儿连接的过程中，G1会一直提示“正在获取IP地址...”最后以失败告终</font></strong>。在这里，我简单的配置了一下：</p>
<p>IP地址：192.168.1.115</p>
<p>网关：192.168.1.1</p>
<p>掩码：255.255.255.0</p>
<p>DNS1：192.168.1.1</p>
<p>好了，现在我们点击Windows 7 网络列表中的“MyHTCDream”网络，G1上面就会立即显示“MyHTCDream已连接”。</p>
<p><strong><font color="#008000">这里需要注意，在G1中会显示MyHTCDream网络不在可用范围内，你必须从PC端主动去连接G1的Wifi设备。</font></strong></p>
<h3>网络共享</h3>
<p>现在，我们已经实现了G1和笔记本的互联，但是目前G1还是无法上网，这是因为我们的无线网卡和有线网卡本来就不是互通的，我们需要通过建立网桥来实现无线网卡和有线网卡的互联。</p>
<p>在网络适配器面板中，同时选中无线网卡和有线网卡，然后右键选择建立网桥即可。OK，这样一来，你就可以在G1中享受Wifi上网了。</p>
<p style="text-align: right">——<a title="G1手机与笔记本实现Wifi互联共享上网" href="http://www.imkevinyang.com/2010/03/G1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0Wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html"><em><strong>Kevin Yang</strong></em></a></p>

	标签：<a href="http://www.imkevinyang.com/tags/ad-hoc" title="Ad-Hoc" rel="tag">Ad-Hoc</a>, <a href="http://www.imkevinyang.com/tags/android" title="Android" rel="tag">Android</a>, <a href="http://www.imkevinyang.com/tags/g1" title="G1" rel="tag">G1</a>, <a href="http://www.imkevinyang.com/tags/google" title="Google" rel="tag">Google</a>, <a href="http://www.imkevinyang.com/tags/wifi" title="Wifi" rel="tag">Wifi</a>, <a href="http://www.imkevinyang.com/tags/windows-7" title="Windows 7" rel="tag">Windows 7</a>, <a href="http://www.imkevinyang.com/tags/%e4%b8%8a%e7%bd%91" title="上网" rel="tag">上网</a>, <a href="http://www.imkevinyang.com/tags/%e5%85%b1%e4%ba%ab" title="共享" rel="tag">共享</a>, <a href="http://www.imkevinyang.com/categories/techarticles/toolskills-techarticles" title="工具技巧" rel="tag">工具技巧</a>, <a href="http://www.imkevinyang.com/tags/%e8%99%9a%e6%8b%9f%e8%b7%af%e7%94%b1" title="虚拟路由" rel="tag">虚拟路由</a><br />

	<h4 style="background-color:#3B3B3B;border-bottom:2px groove gray;color:#F2F2F2;margin-top:20px;padding:6px 6px 6px 15px;margin:20px 0px 0px 0px">你可能对下面的文章感兴趣</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.imkevinyang.com/2009/08/4%e8%a1%8cgreasemonkey%e4%bb%a3%e7%a0%81%e6%9c%80%e5%a4%a7%e5%8c%96google-reader%e7%9a%84%e9%98%85%e8%af%bb%e7%a9%ba%e9%97%b4.html" title="4行Greasemonkey代码最大化Google Reader的阅读空间 (2009/08/09)">4行Greasemonkey代码最大化Google Reader的阅读空间</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/03/android%e6%89%8b%e6%9c%ba%e5%88%9d%e4%bd%93%e9%aa%8c.html" title="Android手机初体验 (2010/03/01)">Android手机初体验</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/12/google-analytics%e4%b8%ad%e7%9a%84uniquepageview%e5%92%8cvisits%e7%9a%84%e5%8c%ba%e5%88%ab.html" title="Google Analytics中的UniquePageView和Visits的区别 (2009/12/07)">Google Analytics中的UniquePageView和Visits的区别</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/11/google-wave%e4%b8%ba%e4%bb%80%e4%b9%88%e8%bf%99%e4%b9%88%e7%81%ab.html" title="Google Wave为什么这么火 (2009/11/14)">Google Wave为什么这么火</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/05/google%e5%92%8c%e5%be%ae%e8%bd%af%e7%9a%84%e4%b8%80%e5%a4%a7%e4%b8%8d%e5%90%8c.html" title="Google和微软的一大不同 (2009/05/06)">Google和微软的一大不同</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/google%e5%b7%a5%e7%a8%8b%e5%b8%88matt-cutts%e8%b0%88seo.html" title="Google工程师Matt Cutts谈SEO (2009/03/23)">Google工程师Matt Cutts谈SEO</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/google%e6%8e%92%e5%90%8d%e6%9b%b4%e6%96%b0.html" title="Google排名更新 (2009/03/21)">Google排名更新</a> </li>
	<li><a href="http://www.imkevinyang.com/2009/03/google%e7%9a%84%e4%bb%b7%e5%80%bc%e8%a7%82.html" title="Google的价值观 (2009/03/07)">Google的价值观</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/07/hilo-windows-7%e4%b8%8bc%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e5%ae%9e%e6%88%98%e6%bc%94%e7%bb%83.html" title="Hilo: Windows 7下C++应用程序开发实战演练 (2010/07/21)">Hilo: Windows 7下C++应用程序开发实战演练</a> </li>
	<li><a href="http://www.imkevinyang.com/2010/02/%e4%bd%bf%e7%94%a8feedburner%e7%83%a7%e5%88%b6rss%e6%9c%80%e5%a5%bd%e7%a6%81%e7%94%a8itemlinkclicks%e7%bb%9f%e8%ae%a1.html" title="使用FeedBurner烧制RSS最好禁用ItemLinkClicks统计 (2010/02/15)">使用FeedBurner烧制RSS最好禁用ItemLinkClicks统计</a> </li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.imkevinyang.com/2010/03/g1%e6%89%8b%e6%9c%ba%e4%b8%8e%e7%ac%94%e8%ae%b0%e6%9c%ac%e5%ae%9e%e7%8e%b0wifi%e4%ba%92%e8%81%94%e5%85%b1%e4%ba%ab%e4%b8%8a%e7%bd%91.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.imkevinyang.com @ 2012-02-08 00:43:40 -->
