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 192.168.7.1
Then type the follwing in your linux machine to route the network.
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. 192.168.7.1 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 18.104.22.168 or 22.214.171.124), 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
eg: nameserver 192.168.0.5