Posted January 30, 2020
I have a bit of an unusual setup where I want to share a computer's internet access with another, with the added wrinkle that the network device connecting the computers doesn't always exist.
The computer with the connection (actually a Raspberry Pi 4) is connected to the home network via wi-fi. It has an ethernet port that is not being used, and is connected to the other computer via a USB eithernet adapter (actually a Raspberry Pi Zero with the g_ether or g_multi module loaded). This computer is running Raspbian Lite (no Xorg or similar), though with a 64-bit kernel (with KVM enabled) and a 64-bit chroot that was used to compile said kernel.
The computer I want to connect to the internet is the Raspberry Pi Zero I mentioned above. It's a diskless system (booted via the rpiboot program), and it runs Alpine Linux with a custom init script (which I can change if needed), entirely out of the initramfs (so no persistent storage). I can change the initramfs image if needed, but any change made by the Pi Zero itself after boot will disappear on reboot.
The tricky part here is that, when the Raspberry Pi is disconnected, the interface disappears until the next time it boots. So, any advice on how to share the internet connection automatically when this issue is present?
The computer with the connection (actually a Raspberry Pi 4) is connected to the home network via wi-fi. It has an ethernet port that is not being used, and is connected to the other computer via a USB eithernet adapter (actually a Raspberry Pi Zero with the g_ether or g_multi module loaded). This computer is running Raspbian Lite (no Xorg or similar), though with a 64-bit kernel (with KVM enabled) and a 64-bit chroot that was used to compile said kernel.
The computer I want to connect to the internet is the Raspberry Pi Zero I mentioned above. It's a diskless system (booted via the rpiboot program), and it runs Alpine Linux with a custom init script (which I can change if needed), entirely out of the initramfs (so no persistent storage). I can change the initramfs image if needed, but any change made by the Pi Zero itself after boot will disappear on reboot.
The tricky part here is that, when the Raspberry Pi is disconnected, the interface disappears until the next time it boots. So, any advice on how to share the internet connection automatically when this issue is present?