BBB 4-6-2020 Image no Internet no Gateway

/etc/default/bb-boot

Specifically this section:

USB_CONFIGURATION=enable
#Its assumed usb0 is always enabled, usb1 can be disabled…
USB0_SUBNET=192.168.137 <=== 137 for Internet sharing on Windows-10
USB0_ADDRESS=192.168.137.2
USB0_NETMASK=255.255.255.0

USB1_ENABLE=enable
USB1_SUBNET=192.168.6
USB1_ADDRESS=192.168.6.2
USB1_NETMASK=255.255.255.0

DNS_NAMESERVER=8.8.8.8

I followed the above settings however this is the resule

debian@beaglebone:~$ route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 usb1
192.168.137.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0

debian@beaglebone:~$ ping 8.8.8.8
connect: Network is unreachable

I can ping 192.168.137.1

Ken

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

Windows ics is stupid, the above script just makes it work.. aka:

sudo ip addr flush dev usb0
sudo dhclient usb0

Regards,

Results,

I started with a fresh install. Put your code into a file called fix.sh.

debian@beaglebone:~$ sudo sh fix.sh

SIOCADDRT: Network is unreachable
connect: Network is unreachable

debian@beaglebone:~$ route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 usb1

debian@beaglebone:~$

Ken

Or just run:

debian@beaglebone:~$ sudo /opt/scripts/network/usb_windows_ics.sh

Regards,

debian@beaglebone:~$ uname -r
4.19.94-ti-r42
debian@beaglebone:~$ cat /etc/dogtag
BeagleBoard.org Debian Buster IoT Image 2020-04-06
debian@beaglebone:~$ ping -c3 8.8.8.8
connect: Network is unreachable
debian@beaglebone:~$ sudo /opt/scripts/network/usb_windows_ics.sh
debian@beaglebone:~$ ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=37.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=31.9 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=54 time=32.8 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 4ms
rtt min/avg/max/mdev = 31.945/34.101/37.523/2.455 ms
debian@beaglebone:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default DESKTOP-M5A99X- 0.0.0.0 UG 0 0 0 usb0
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 usb1
192.168.137.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0
debian@beaglebone:~$

Regards,

windows_ics.png

Robert,

Fresh load. Portion of /etc/default/bb-boot

USB_CONFIGURATION=enable
#Its assumed usb0 is always enabled, usb1 can be disabled…
USB0_SUBNET=192.168.147
USB0_ADDRESS=192.168.147.2
USB0_NETMASK=255.255.255.0

I am using “static” IP addresses not DHCP…

I can connect to the IP address 192.168.147.2 from putty on Windows. However no Internet;

debian@beaglebone:~$ route

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 0.0.0.0 255.255.255.0 U 0 0 0 usb1
192.168.147.0 0.0.0.0 255.255.255.0 U 0 0 0 usb0

debian@beaglebone:~$ ping 192.168.147.1

PING 192.168.147.1 (192.168.147.1) 56(84) bytes of data.
64 bytes from 192.168.147.1: icmp_seq=1 ttl=128 time=0.884 ms
64 bytes from 192.168.147.1: icmp_seq=2 ttl=128 time=1.25 ms
^C
— 192.168.147.1 ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 2ms
rtt min/avg/max/mdev = 0.884/1.064/1.245/0.183 ms

debian@beaglebone:~$ ping 8.8.8.8
connect: Network is unreachable

Ifconfig of usb0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.147.2 netmask 255.255.255.0 broadcast 192.168.147.255
inet6 fe80::679:b7ff:fed3:34fd prefixlen 64 scopeid 0x20
ether 04:79:b7:d3:34:fd txqueuelen 1000 (Ethernet)
RX packets 206 bytes 24078 (23.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 157 bytes 29058 (28.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

debian@beaglebone:~$ cat /etc/dogtag BeagleBoard.org Debian Buster IoT Image 2020-04-06

debian@beaglebone:~$ uname -r 4.19.94-ti-r42

/etc/network/interfaces Untouched -rw-r–r-- 1 root root 819 Apr 6 14:03 /etc/network/interfaces

Please, what am I missing?

Ken

Robert,

With your help I worked out the Internet issues.

debian@beaglebone:~$ sudo /opt/scripts/network/usb_windows_ics.sh

Is there anyway to make route add default gw … run (your script)

automatically at boot time?

The script adds it plus the nameserver . I did’t use the dhcp part. But after

a boot the route default gw is not there. I don’t want to touch
/etc/net/work/interfaces or /etc/resolv.conf or /etc/connman if possible.

Thanks

https://learn.pimoroni.com/tutorial/sandyj/running-scripts-at-boot

  You may need to add a delay if other parts of the system need to be up
before the changes can be made...

https://unix.stackexchange.com/questions/57852/crontab-job-start-1-min-after-reboot
has both crontab with a delay, but also has an example defining a systemd
service reliant upon the network being initialized...

Dennis,

Thank you. After looking over the material to see what @reboot meant the bell went off.
It’s been quite a few years since working with cron > 15 years.

Knowing the script had to run as root I used sudo crontab -e and added the script directing 1 & 2 to a full path log filename.
Works well. Does it’s job.

Is this issue with default gw related to the 4-6-2020 image? You used to be able to define it in /etc/network/interfaces.

Thanks