2303|0

265

帖子

25

TA的资源

纯净的硅(初级)

楼主
 

【BB板使用心得之1】win7通过USB连接为BB板共享网络 [复制链接]

资料来源:http://lanceme.blogspot.com/2013 ... et-sharing-for.html
这个网址不翻墙是访问不了的,所以我把原文发布到下面,整个文章应该很好理解,图文并茂,所以就没做翻译,大家应该看得懂,如果有不明的地方,请留言说明,我会解答

I wish I better understood WHY this was necessary.  


At one point my BBB "just worked".  When it was plugged into my desktop computer via USB (Windows 7 machine) the BBB had internet connectivity just fine.  After working to solve other issues it stopped.  In any case, it works again with the following steps:



On the Windows 7 computer:

  •     Control Panel -> Network and Internet -> Network Connections
  •     Right-click your internet connection, Properties, Sharing Tab
  •     Click "Allow other network users to connect thru this computer's Internet connection"
  •     Select the BeagleBone Black's network connection under "Home networking connection:"
  •     Click OK.



    Here's the trick:  when I did this, Windows assigned a static IP to the BBB connection.  Why?  No idea.  
    You have to go back to that connection and reset it to DHCP.

  •     Control Panel -> Network and Internet -> Network Connections
  •     Right-click the BeagleBone Black's connection, Properties
  •     Click Internet Protocol Version 4 (TCP/IPv4), Click Properties
  •     Click "Optain an IP address automatically"
  •     Click "Obtain DNS server address automatically"
  •     Click OK.  Click CLOSE.



On the BBB:

This makes the BBB route internet traffic thru the host (Windows 7 in this case) and DNS thru Google's DNS Servers (8.8.8.8).  



    route add default gw 192.168.7.1
    echo "nameserver 8.8.8.8" >> /etc/resolv.conf


Try It:

    ping www.google.com

Make it Persistant:

To make this "stick" after a reboot of the BBB, you need to add these commands to the ethernet startup script on the BBB (/usr/bin/g-ether-load.sh).  

NOTE:   You CANNOT simply add these commands to the bottom of that script file.  They must go  before the udhcpd starts.  It does not return control to the script so adding them at the bottom of the file does nothing for you.  My script file now looks like this:

    /sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252
    /sbin/route add default gw 192.168.7.1
    echo 'nameserver 8.8.8.8' >> /etc/resolv.conf


    /usr/sbin/udhcpd -f -S /etc/udhcpd.conf


IT WORKS!



A big thanks to robert@rplural.net who got me moving in the right direction.  Read his description of the parallel steps for a Linux host!
(http://www.rpural.net/BlackNetworking)
点赞 关注
 

回复
举报
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条
Microchip 直播|利用motorBench开发套件高效开发电机磁场定向控制方案 报名中!
直播主题:利用motorBench开发套件高效开发电机磁场定向控制方案
直播时间:2025年3月25日(星期二)上午10:30-11:30
快来报名!

查看 »

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

 
机器人开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表