follow the tutorial and make usbnet boot automatically
http://hipstercircuits.com/
on my BBB debian wheezy:
sudo cat /etc/modprobe.d/usbnet.conf
#auto load usbnet
options g_multi file=/usbnet.img stall=0
#there is a usbnet.img already there under /
# hotplug get the device when usb is plug in?
sleep 30 # this delay should be longer than LAN eth0 delay?
ifconfig usb0 192.168.7.2 up
#route add default gw 192.168.7.1 #should be set in network/interfaces
echo “setting up usbnet with ip 192.168.7.2”
ifconfig -a >/var/log/netif.txt
============/etc/network/
# Ethernet/RNDIS gadget (g_ether) or g_multi for debian
#worked on ArmStrong on MMC, but not sure for Debian on SD card
# … or on host side, usbnet and random hwaddr, Linux host side IP should be $
#allow-hotplug usb0
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
dns-nameservers 192.168.7.1
dmesg
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.7.1 0.0.0.0 UG 0 0 0 usb0
192.168.7.0 * 255.255.255.0 U 0 0 0 usb0
on my PC: (host)
#ifconfig usb0 192.168.7.1 up
// config for ip forwarding on host ubuntu.
# 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
after that you can ping them pc-> bb and bb-> pc
to acceess internet from bb you need adding name server addr for beaglebone (8.8.8.8) in file /ect/resolve.conf