Sunday, February 26, 2012

Getting on the Beaglebone on the internet using networking over usb

Here are the settings to get the beaglebone to network over usb.  This setup assumes that your router has an ip address of 192.168.1.1


on host
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward


on beaglebone
route add default gw 192.168.7.1


vi /etc/resolv.conf
nameserver 192.168.1.1


I'm not sure if all of this is needed, but I know it works


These settings are going to vary depending on your internet interface (wlan0, eth0, etc.) and the settings on your router (192.168.1.1, 192.168.0.1).

3 comments:

  1. Excellent job dude. Your instructions worked great. The only quirk that I experienced is that I received a permissions error when using:

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

    instead

    I navigated to /etc/sysctl.conf and uncommented net.ipv4.ip_forward=1

    then it worked perfectly.

    Must be an Ubuntu quirk or something.

    Thank you very much for your post!

    ReplyDelete
  2. Ahh you need to sudo or be root to echo that, but good to know of a way to save it. Now I just need to know how to have the beagle save its settings.

    ReplyDelete
  3. Hi, the internet works great! thanks for you post. However, when I reboot the beaglebone, I couldn't SSH to it anymore. It just returns nothing and waits there. Is there a way to fix this?

    ReplyDelete