update USB0 with new IP and subnet????

I’m looking for some guidance regarding updating the IP address for the BBB. I have a BBB that I need to place remotely on my network. Its a custom BBB with no connections on it what so ever, other than the USB port. Its a non-wifi model. So I’m looking to find a way to use a usb-Ethernet adapter and connect it to the USB port.

So I need to update the IP address from 192.168.6.2, but more importantly I need to update the subnet so I’ll be able to access it on my network.

Its obvious that I can update the information in the interfaces file, I’ve done this before with a raspberry pi. However what I’m concerned that if I go about making changes its going to disable access completely and that’s a risk I don’t want to take. I just ordered a new board. I’ll do some experimenting with the SD card, so i’ll avoid bricking issues.

However, I was hoping to gain some insight as to what steps I should take. I’ve read that there are init scripts running at boot that setup and configure the USB0 as well.

Does anyone have any insight as to what steps I should take?

Michael

Hi Michael,

Are you using the Black or Blue Beaglebone?

It seems that you are using the term bricked for not being able to connect to the BBB.
For me it would be bricked if I cannot use anymore at all, so also not when connecting every possible cable. For the black it’s very hard to brick it like that. It is almost always possible to boot from the insertable SD card.

Typically on every system there are scripts being run at start-up.
If you are using ubuntu then you will probably have systemd or init which will start all your processes.
I have been using busybox for which I add startup commands to a particular file.

In general, I would start by logging in to the machine and configure it by hand.
When that works add the configuration steps to the startup scripts.

What you exactly need to do will depend on your distro, hardware (maybe load a module), network settings (fixed IP or dhcp).

I hope this gives some guidance for now. I would start by looping up network configuration and the startup configuration for the distro that you will be using.

Best wishes,
Hugo

Hi Hugo,

Thanks for getting back to me so quickly.

To answer your questions.

I’m using a Beaglebone Black variant. Its a stripped down board, all the connectors and headers have been removed. So no wifi, no ethernet, gpio headers, etc. Just a USB port.

I agree, I’m using the word brick incorrectly here. I know I can always go back and reflash the BBB if I do something to prevent me from accessing the board again. I’m just trying to do as much as I can before I start making changes, As I’m currently at a point that the board is setup and configured on the linux side exactly how I want it. And I would rather not go through the trouble of reflashing and setting everything up again.

What is not clear to me is the use of the scripts used to configure USB0. /boot/uboot/scripts/setup-ubuntu-armhf-3.8.13-bone30.sh makes changes at bootup to configure for the static IP that is used on USB0. I’m not sure how I would modify it for my needs. Or if there are other things I need to worry about.

Again thanks for reaching out.

Best regards,
Michael

On Mon, 6 Jan 2020 06:57:32 -0500, Michael Ascenzi
<mascenzi80-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> declaimed the
following:

What is not clear to me is the use of the scripts used to configure USB0.
/boot/uboot/scripts/setup-ubuntu-armhf-3.8.13-bone30.sh makes changes at
bootup to configure for the static IP that is used on USB0. I'm not sure
how I would modify it for my needs. Or if there are other things I need to
worry about.

  Since your original post mentions the plan to use a USB<>Ethernet NIC
adapter... I'm presuming you have the USB host port available (I don't
think the client/power port has OTG capability to drive any such adapter)

... Just leave the existing USB network alone -- that's an RNDIS style USB
gadget. The USB<>Ethernet NIC should have its own driver and probably
appears as a different ETH# device. Likely it will even attempt DHCP
negotiation when connected to a live network.

  I'd probably just connect that USB<>Ethernet NIC, hook to a local
router/switch, and see what shows up on the network. If the BBB shows up on
the router, SSH to the assigned IP and check the network names and
configuration for it.

  Just tried an experiment with an old SIIG USB<>Ethernet NIC. Connected
to a regular BBB, moved my CAT-5 from the on-board Ethernet port to the
SIIG, and booted.

debian@beaglebone:~$ ifconfig
eth0: flags=-28669<UP,BROADCAST,MULTICAST,DYNAMIC> mtu 1500
        ether d0:39:72:18:3e:e5 txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
        device interrupt 55

eth1: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
        inet 192.168.1.92 netmask 255.255.255.0 broadcast 192.168.1.255
        inet6 fe80::250:b6ff:fe5c:9084 prefixlen 64 scopeid 0x20<link>
        inet6 2600:1700:e630:890::47 prefixlen 64 scopeid 0x0<global>
        inet6 2600:1700:e630:890:250:b6ff:fe5c:9084 prefixlen 64 scopeid
0x0<global>
        ether 00:50:b6:5c:90:84 txqueuelen 1000 (Ethernet)
        RX packets 100 bytes 10874 (10.6 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 150 bytes 25270 (24.6 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 320 bytes 23680 (23.1 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 320 bytes 23680 (23.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.7.2 netmask 255.255.255.252 broadcast 192.168.7.3
        inet6 fe80::d239:72ff:fe18:3ee7 prefixlen 64 scopeid 0x20<link>
        ether d0:39:72:18:3e:e7 txqueuelen 1000 (Ethernet)
        RX packets 237 bytes 37904 (37.0 KiB)
        RX errors 0 dropped 4 overruns 0 frame 0
        TX packets 45 bytes 10460 (10.2 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.6.2 netmask 255.255.255.252 broadcast 192.168.6.3
        ether d0:39:72:18:3e:ea txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

debian@beaglebone:~$

  Board has network connectivity over the SIIG unit (USB0 is showing only
since that is how I powered the BBB). Removing the SIIG and plugging into
the on-board Ethernet (and waiting while PuTTY times out a few times)
produced

debian@beaglebone:~$ ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
        inet 192.168.1.69 netmask 255.255.255.0 broadcast 192.168.1.255
        inet6 2600:1700:e630:890:d239:72ff:fe18:3ee5 prefixlen 64 scopeid
0x0<global>
        inet6 fe80::d239:72ff:fe18:3ee5 prefixlen 64 scopeid 0x20<link>
        ether d0:39:72:18:3e:e5 txqueuelen 1000 (Ethernet)
        RX packets 399 bytes 33810 (33.0 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 147 bytes 22696 (22.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
        device interrupt 55

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
        inet 127.0.0.1 netmask 255.0.0.0
        inet6 ::1 prefixlen 128 scopeid 0x10<host>
        loop txqueuelen 1000 (Local Loopback)
        RX packets 320 bytes 23680 (23.1 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 320 bytes 23680 (23.1 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.7.2 netmask 255.255.255.252 broadcast 192.168.7.3
        inet6 fe80::d239:72ff:fe18:3ee7 prefixlen 64 scopeid 0x20<link>
        ether d0:39:72:18:3e:e7 txqueuelen 1000 (Ethernet)
        RX packets 505 bytes 65150 (63.6 KiB)
        RX errors 0 dropped 4 overruns 0 frame 0
        TX packets 83 bytes 18187 (17.7 KiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.6.2 netmask 255.255.255.252 broadcast 192.168.6.3
        ether d0:39:72:18:3e:ea txqueuelen 1000 (Ethernet)
        RX packets 0 bytes 0 (0.0 B)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 0 bytes 0 (0.0 B)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

debian@beaglebone:~$

You'll also need to configure your host to bridge the USB Ethernet
interface created by the BeagleBoard with your host's Ethernet
interface. Otherwise you've got two completely separate Ethernet
segments and traffic will not pass from one to the other.

/etc/network/interfaces is where the IP addresses are configured.
There's two there, one on 192.168.6.2 the other on 192.168.7.2, I think
some platforms only support one of the interfaces, but Linux may see
either (or both).

Alternatively, you might consider routing:
- edit /etc/network/interfaces on the BeagleBoard to make your host (at
192.168.6.1) the default gateway
- enable IP forwarding on your host
- configure your packet filter to permit traffic to/from the BeagleBoard
- configure your network's default gateway to send traffic destined for
192.168.6.2 to your host (so it can forward it over USB to the BeagleBoard).