Getting internet on BBB via usb (Share internet from your linux machine)

22 Feb 2015

Login to your BBB and type

route add default gw

Then type the follwing in your linux machine to route the network.

sudo su
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT 
echo 1 > /proc/sys/net/ipv4/ip_forward

Note: eth0 is LAN interface which has internet connectivity. eth1 is the usb network connection with BBB. is the ip address that assigned to your PC.

Following part is not needed if internet is working properly.

If you are using network that doesn't allow third party dns server (like google dns or, you had to configure /etc/resolv.conf.

First find out what dns server address your internet provider (your college) gives you. If you have a working network type


to find out the dnsaddress. Then delete all the entries in /etc/resolve.conf and replace it with

nameserver <dnsaddr>

eg: nameserver