How to re-enable Ethernet over usb0

I’m running a BeagleBone Black with Debian, 3.8.13-bone63. DCAN1 is enabled.

Some (long) time ago I’ve disabled the Ethernet over USB0. Because I’m fairly new in Linux, I can’t remember how. To re-enable it I’ve uncomment the corresponding settings in /etc/network/interfaces to

Ethernet/RNDIS gadget (g_ether)

… or on host side, usbnet and random hwaddr

Note on some boards, usb0 is automaticly setup with an init script

iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1

After rebooting and “ifconfig -a” there is no “usb0”. After that i’ve added “/lib/modules/3.8.13-bone63/kernel/drivers/usb/gadget/g_ether.ko” to “/etc/modules”

After reboot there is again no “usb0”. After “modprobe g_ether” and “/etc/init.d/networking restart”, I can find “usb0” with “ifconfig”.

How can I do it, that the Ethernet over usb0 will automatically load/starts again during startup.

Thanks!

You add “g_ether” to /etc/modules. Standard Debian procedure . . .

Thanks, William!

… i’ve added “/lib/modules/3.8.13-bone63/kernel/drivers/usb/gadget/g_ether.ko” to “/etc/modules”

I added it already, but with full path. Without the path it works, at least partially. With ifconfig i can find usb0 now. But without a IP-address:

usb0 Link encap:Ethernet HWaddr 16:74:59:af:75:91
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

I have to use ifconfig usb0 192.168.7.2 to get this

usb0 Link encap:Ethernet HWaddr 16:74:59:af:75:91
inet addr:192.168.7.2 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::1474:59ff:feaf:7591/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1176 (1.1 KiB) TX bytes:370 (370.0 B)

Is there anything else that I can do that it works as before?

Follow these directions:

https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-usbgadget

They'll get you close to what the default did..

Regards,

I added it already, but with full path. Without the path it works, at least partially. With ifconfig i can find usb0 now. But without a IP-address:

Yeah, you do not add the path, and I do not think you want to add the file extension ( .ko ) either. It’s like using modeprobe, it only expects the module name, and does not want the extension or path.

@Robert

I’m not sure why, but I’ve never had to follow those instructions to get g_ether working. Perhaps it’s because I’m actually using g_ether, and not g_multi ?

Thanks, Robert!
Sorry, the directions out of your Link does’nt work. There is no usb0 when I use ifconfig -a after rebooting. With g_ether in /etc/modules, usb0 is shown with ifconfig -a after rebooting, but again without a IP-address. To get an IP-address I have to run your script. But /sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252 out of your script is already enough to get an IP-address. The dhcp seems not to be necessary.

Where can I add the instruction /sbin/ifconfig usb0 192.168.7.2 netmask 255.255.255.252 that it is performed during the boot-procedure, but after the modules from /etc/modules are already integrated?

usb0 shows up here:

https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-g-ether-load.sh#L75

But you need to call that script from "your" init script on bootup..

All our default images do something similar, but i'm really not sure
what you disabled, so the above script is best starting point to get
it back...

The default images have an init script call:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/generic-startup.sh

which calls:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh

which loads the module here:

https://github.com/RobertCNelson/boot-scripts/blob/master/boot/am335x_evm.sh#L166-L197

Regards,