[Announce] ZeroTier lan-over-internet from RetroPie
Vegz78 last edited by
Here's a script, ToggleZeroTier, I've modified and use quite a lot in RetroPie when I want to netplay with others outside my LAN or need access to my home game server for game streaming to my Raspberry Pi with RetroPie when not at home:
The script works from a RetroPie games folder/menu that can run .sh-scripts(for instance the typical Moonlight setup) and from the command line.
With ZeroTier already installed and registered to a ZeroTier virtual network on the Raspberry Pi, the script runs a 3 step circular state logic each time it's run, like this:
STATE => ACTION
1.ZT off => Toggle to 2
2.ZT on & BC off => Toggle to 3
3.ZT on & BC on => Toggle to 1
-Where ZT=ZeroTier connection and BC=ZeroTier network added to the routing table as broadcast address, so that devices running LAN games which uses broadcast discovery can find each other on the ZeroTier LAN-over-internet.
Every time the Raspberry Pi is rebooted, the BC state is set to OFF, while the ZT state is kept at last state.
Here's an article explaining the setup of _ToggleZeroTier.sh more thoroughly, while here's an article describing the use of ZeroTier for remote netplay in RetroPie. The official Moonlight setup guideshows how ZeroTier is used for e.g. Moonlight game streaming.
I hope this script can be useful for some of you as well! ;-)