beaglebone black debian wheezy usb net configuration and ssh login on windows and Linux

copyright (C) 2011-2017 iesensor.com

 

follow the tutorial and make usbnet boot automatically
http://hipstercircuits.com/enable-serialuarttty-on-beaglebone-black/

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 /

settings on BBB
=======/etc/rc.local========
# g_multi has been loaded, if usb is not plugin , it seems not hang the OS
# 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/interfaces=============

sudo nano /etc/network/interfaces
#add nameserver for this interface

# 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

———–DNS——
/etc/resolv.conf is automatically generated at runtime,
/etc/hosts            add your hostname into this DNS cache file

———debug——-
using LAN or HDMI output to monitoring the setup

lsmod
lsusb
ifconfig
dmesg

debian@EEE-BBB:~$ route
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)
windows 7,
after setting the new NIC ip static as  192.168.7.1,network will automaticall working if USB is plugged in,
Linux should also work

#ifconfig usb0 192.168.7.1  up

now, ssh should works at ip: 192.168.7.2
———————————————–

// config for ip forwarding on host ubuntu.

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

BSD documentation licensed Free for non-commercial usage only
Author: Qingfeng XIA
copyright (C) 2011-2017
http://www.iesensor.com
please keep the original link in your reference.
http://www.iesensor.com/blog/2013/11/06/beaglebone-black-debian-wheezy-usb-net-configuration-and-ssh-login-on-windows-and-linux/
This entry was posted in Uncategorized. Bookmark the permalink.