Configuring a gateway for the USB gadget network interface

I know I can change the network address assigned to the USB gadget by tweaking /etc/default/bb-boot. Is there any way to assign a default route and gateway to that interface when it is created?

@RobertCNelson what is the script that reads /etc/default/bb-boot? If there’s not currently a way to assign a default gateway, would it be straightforward to add it to that script?

Hey @pocketnc_john i’ve nuked that whole setup in Bullseye:

example: Index of /rootfs/debian-armhf/2021-10-13

You just configure it thru systemd-network how ever you want it…

root@BeagleBone:~# cat /etc/systemd/network/
SoftAp0.network  usb0.network     wlan0.network    
eth0.network     usb1.network     
root@BeagleBone:~# cat /etc/systemd/network/usb*
[Match]
Name=usb0

[Link]
RequiredForOnline=no

[Network]
DHCP=no
Address=192.168.7.2/24
DHCPServer=on

[DHCPServer]
EmitDNS=no
EmitRouter=no
EmitTimezone=no
MaxLeaseTimeSec=20min
PoolSize=1
[Match]
Name=usb1

[Link]
RequiredForOnline=no

[Network]
DHCP=no
Address=192.168.6.2/24
DHCPServer=on

[DHCPServer]
EmitDNS=no
EmitRouter=no
EmitTimezone=no
MaxLeaseTimeSec=20min
PoolSize=1

For buster i’ll back port this once fully tested… but the legacy was was /usb/bin/autoconfigure_usb0.sh

Great, thanks Robert!