Page 1 of 1

openvpn AppleTalk networking for remote linux clients

Posted: Sat May 01, 2021 2:42 pm
by ujimaflip
Hi All,
My Goal: Play old network games with my brother over the internet.

What I have working:
Raspberry pi 3 and 4 working (both SheepShaver and BasiliskII). Builds are fine, roms ok, os753 & 0S9 - all good (though weirdly the pi3 is far more performant)
Local networking with sheep_net is working - two rasperry pi on my local network can see each other, Apple talk and network games like bonk heads working well. This is all fantastic!!

Now I'm stuck:

I have setup openvpn with bridging set up
I can connect two raspberry pi to the vpn and they can see the internal network

I tried to create a second tap device to bridge to the tap0 that is created when a vpn connection succeeds... but honestly I'm lost.

From the wiki, I need the equivalent of :
sudo /*path to SheepShaver folder*/SheepShaver.app/Contents/MacOS/SheepShaver & sleep 10
sudo ifconfig bridge1 create
sudo ifconfig bridge1 addm tap0
sudo ifconfig bridge1 addm tap1
sudo ifconfig bridge1 up

Any help on this last step would be fantastic!

Re: openvpn AppleTalk networking for remote linux clients

Posted: Mon May 03, 2021 3:46 pm
by adespoton
ujimaflip wrote: Sat May 01, 2021 2:42 pm Hi All,
My Goal: Play old network games with my brother over the internet.

What I have working:
Raspberry pi 3 and 4 working (both SheepShaver and BasiliskII). Builds are fine, roms ok, os753 & 0S9 - all good (though weirdly the pi3 is far more performant)
Local networking with sheep_net is working - two rasperry pi on my local network can see each other, Apple talk and network games like bonk heads working well. This is all fantastic!!

Now I'm stuck:

I have setup openvpn with bridging set up
I can connect two raspberry pi to the vpn and they can see the internal network

I tried to create a second tap device to bridge to the tap0 that is created when a vpn connection succeeds... but honestly I'm lost.

From the wiki, I need the equivalent of :
sudo /*path to SheepShaver folder*/SheepShaver.app/Contents/MacOS/SheepShaver & sleep 10
sudo ifconfig bridge1 create
sudo ifconfig bridge1 addm tap0
sudo ifconfig bridge1 addm tap1
sudo ifconfig bridge1 up

Any help on this last step would be fantastic!
so the first line is self-explanatory what you need to do.

Are you running Raspbian on your Pis? Does it have ifconfig?

If you've got OpenVPN working, then that means it's already set up a bridge. So, by using ifconfig without arguments, you should be able to identify the name of that bridge, and add your tap devices to it. That said, you probably don't need to use OpenVPN at all. Just install tuntap, and use ifconfig to create a bridge device and add tap0 to it. The extra steps are there for OS X because it's got extra security steps to work around requiring both tap devices and bridges.

Re: openvpn AppleTalk networking for remote linux clients

Posted: Mon May 03, 2021 11:37 pm
by ujimaflip
To be clear - all is working internally within my private network (multiple devices all connected via AppleTalk). What I was hoping would work was connecting devices from outside my network via vpn. I was hoping that simply swapping the ether property to use the network device created by OpenVPN would do the trick (tap0). The host machines can see each other, however it seems the BasiliskII based macs cannot. I will take another look as I think you are confirming that this should work.

Re: openvpn AppleTalk networking for remote linux clients

Posted: Tue May 04, 2021 9:15 am
by ujimaflip
OK - I have it working!!
Again, to be clear my goal here was to connect other macs from outside my private network - to enable appletalk over the internet. If all you need is two or more macs to connect via AppleTalk when using unix there is no need for the openvpn stuff (sheep_net does the tunnelling for us).

Steps I undertook:
* Setup open VPN following the instructions here: https://www.emaculation.com/doku.php/br ... rver_setup
* Create a client per pi you wish to connect remotely to your local network
* install openvpn on all the clients (sudo apt-get install openvpn)
* connect your remote client to your private network (sudo openvpn <whatever you called your client config>)
* look at the configuration for the tap0 device - you should see an ipaddress associated with the private network. Take a node of this you will need it

At this stage I was hoping that I could simply change the 'ether' property in the prefs file to use tap0 - unfortunately BasiliskII is using the pattern to use tap devices so this does NOT work. So instead we need to create a workaround bridge:

create a bridge

Code: Select all

sudo brictl addbr br0
add the tap0 devide to the bridge

Code: Select all

sudo brctl addif br0 tap0
bring the bridge up stealing the tap0 ipaddress

Code: Select all

sudo ifconfig br0 <the_ip_addressof_tap0> 255.255.255.0 <broadcast_address>
your broadcast address will be your private address with 255 as the last digit. (e.g 192.168.5.255)

check that the br0 address has the ip address previously assigned to tap0, update the ether property in your basilisk_ii_prefs file to point to br0 (note - you will have to edit the file as br0 does not appear in the drop down from the gui) and launch your mac

Happy internet gaming!!

edit: to take the bridge back down after playing:

Code: Select all

sudo ifconfig br0 down
sudo brctl delbr br0

Re: openvpn AppleTalk networking for remote linux clients

Posted: Tue May 04, 2021 6:07 pm
by adespoton
In the past we've written scripts to automate some of this, named ifup and ifdown. With a bit of bash scripting and sed to grab the IP address, it should be possible to distill all those steps into an ifup and an ifdown script. You could then run those in-line with BII in another script that would launch BII, bring the network interface up, and then tear it down again when BII terminates.

Re: openvpn AppleTalk networking for remote linux clients

Posted: Wed May 05, 2021 8:06 am
by ujimaflip
Indeed I have written this now as scripts that run from within RetroPie.
I will make them generic and share here.