There are lots of ways to solve this problem.
In the past I have worked in defence, for highly sensitive stuff they wouldn't even allow a common ground between two networks.
That's why I chose an option iolsator, it ensures the two devices are electrically isolated.
It's overkill for this application, but I wanted to set something up right, and if I ever have another project like this that needs to be more secure, it's ready to go.