我最近在 Beagle Bone Black 上安装了 Ubuntu 13.04。这个图片:
https://rcn-ee.net/deb/flasher/raring/BBB-eMMC-flasher-ubuntu-13.04-2013-10-08.img.xz
该微控制器允许通过 USB 在主机 PC(版本 12.04(精确)(64 位)、Kernel Linux 3.2.0-56-generic)和 BeagleBone 之间共享互联网连接,所以我选择了它并按如下方式配置设备:
BeagleBone 黑色:
ifconfig usb0 192.168.7.2
route add default gw 192.168.7.1
Run Code Online (Sandbox Code Playgroud)
主机:
sudo su
#eth0 is my internet facing interface, eth3 is the BeagleBone USB connection
ifconfig eth2 192.168.7.1
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth2 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
Run Code Online (Sandbox Code Playgroud)
在 Internet 连接自己工作之后,当我这样做时,ping 8.8.8.8
我得到了结果:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 …
Run Code Online (Sandbox Code Playgroud)