beagle bone can access the internet by using usb connection of host

board/beaglebone Black 2013. 9. 7. 13:46

from : https://groups.google.com/forum/#!topic/beagleboard/k7JkUHCw4Mk


manually configuring BBB for internet access in USB tethered mode?


This is the set of instructions I use every time I plug in my beaglebone. I'm not running angstrom, so you should change the ip address to what ever you have on yours. Also double check your internet connect method. I'm using WLAN0, but you might have ETH0 or whatever.

Once the beaglebone is connected and booted log in to the serial terminal using:

sudo screen `ls /dev/{tty.usb*B,beaglebone-serial}` 115200

Now in the beaglebone log in. username: root. password: root

Now run:

modprobe g_ether

ifconfig usb0 192.168.42.2

route add default gw 192.168.42.1

////===========네트웍이 잘 안되는 경우 dns 서버를 변경한다.
OK, I manually changed the DNS server by editing the /etc/resolv.conf
file to have the line nameserver 208.67.222.222.
/////=====================


On the host machine log into root by typing: su
password in root password. Note, cannot do this as sudo!

ifconfig usb0 192.168.42.1

iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE

iptables --append FORWARD --in-interface usb0 -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

Now ping it:

ping 192.168.42.2

If a response comes, copy /etc/resolve.conf from host to beaglebone. Now *bone can access the internet