manually configuring BBB for internet access in USB tethered mode?

i don't have my BBB in front of me at the moment so i just want to
verify what it would take to get it on the internet when running in
USB tethered mode -- should be simple, i just want to make sure i'm
not forgetting anything.

  with the stock flasher image on the BBB, i expect i'll have to
configure the BBB (manually) with:

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

  on the (ubuntu) server side, i expect i'll need to:

$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ iptables -A POSTROUTING -t nat -j MASQUERADE

does that sound about right? and i'll have to make sure i configure
the server-side kernel to have those netfilter-related modules -- i'm
sure it won't be hard to figure out which ones.

  thoughts? am i forgetting anything critical? i'll get a chance to
test all this in a couple of hours.

rday

  i don't have my BBB in front of me at the moment so i just want to
verify what it would take to get it on the internet when running in
USB tethered mode -- should be simple, i just want to make sure i'm
not forgetting anything.

  with the stock flasher image on the BBB, i expect i'll have to
configure the BBB (manually) with:

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

  on the (ubuntu) server side, i expect i'll need to:

$ echo 1 > /proc/sys/net/ipv4/ip_forward
$ iptables -A POSTROUTING -t nat -j MASQUERADE

does that sound about right? and i'll have to make sure i configure
the server-side kernel to have those netfilter-related modules -- i'm
sure it won't be hard to figure out which ones.

  thoughts? am i forgetting anything critical? i'll get a chance to
test all this in a couple of hours.

http://elinux.org/ECE497_Tips_and_Tricks#Sharing_Laptop_Internet_Connection_with_BeagleBoard
has some hints, but isn't completely thought out and explained, as far
as I can tell.

On the BeagleBone side, that should do it.

On the Ubuntu host side, the link above makes a couple of other
suggestions in addition to the POSTROUTING to FORWARD packets to your
Beagle:

$ iptables -A FORWARD -o wlan0 -i eth0 -s 192.168.1.0/24 -m conntrack
--ctstate NEW -j ACCEPT
$ iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

Some other pages like DebianFirewall - Debian Wiki and
Quick-Tip: Linux NAT in Four Steps using iptables seem to support the
need for something like this to setup a firewall/nat, but I'm really
not so familiar. Hopefully someone can chime in with a thoughtful
answer.

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

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