Open b-trav opened 6 years ago
The /etc/network/interfaces
file is parsed by the autoconfigure_usb0.sh
script in /opt/scripts/boot
Looking at that script, although it looks for the gateway value, it doesn't seem to do actually do much with it.
Using the current Debian stretch image, doing a ip route show
after boot reports:
192.168.6.0/30 dev usb1 proto kernel scope link src 192.168.6.2
192.168.7.0/30 dev usb0 proto kernel scope link src 192.168.7.2
If I add a route add default gw 192.168.7.1
as the last command in the final if statement in autoconfigure_usb0.sh
, then after boot, I get:
default via 192.168.7.1 dev usb0
192.168.6.0/30 dev usb1 proto kernel scope link src 192.168.6.2
192.168.7.0/30 dev usb0 proto kernel scope link src 192.168.7.2
and a working network route via my laptop.
For the record, on my linux laptop I'm forwarding from usb to wifi with:
sudo sysctl net.ipv4.ip_forward=1
sudo iptables --table nat --append POSTROUTING --out-interface wlp4s0 -j MASQUERADE
sudo iptables --append FORWARD --in-interface enx985dad314e0d -j ACCEPT
Sadly it's not well documented, but there are some helper scripts here:
https://github.com/RobertCNelson/boot-scripts/tree/master/network
(/opt/scripts/network/)
Regards,
Hi Robert,
Thanks for your work.
I am playing around with the PocketBeagle. I am ssh'ing over usb0, and at the moment I have to type:
in order to get internet access on the PocketBeagle. This is despite my
/etc/network/interfaces
file containing:I can get around the resolv.conf issue by disabling connman:
but cannot figure out how to set the default gateway. I am guessing the problem is with
autoconfigure_usb0.sh
?Any suggestions would be greatly appreciated.
Thanks,
Ben