Macintosh, Networking, Raspberry Pi, SE

Raspberry Pi PPP Serial Router

May 14, 2017

There are a ton of classic Macintosh apps and games available for download on the web. Some of them are high-density 1.44MB disk images and they can be written to a floppy disk via an imaging application like dd or WinImage. Others are not high-density images, but rather 800K images and thus they cannot be written to a floppy disk by any computer other than a real classic Mac. Transferring these files to my Macintosh SE can prove to be quite difficult. HFS files have two parts, a data fork and a resource fork. Transferring the files via most modern computer operating systems will destroy the resource fork of these files, and so it can be quite difficult to get games and applications moved over to the older Macs without losing the ability to open them once you have them on the Mac. You can buy ethernet adapters for the Mac SE that connect via the PDS socket, but they are very expensive. So how do we transfer files from the Internet to the Mac SE without damaging them?
To solve this problem I initially set up a Kermit file transfer system between my Mac SE and my MacBook Pro via a USB-Serial Adapter and a DB9-MiniDIN-8. Once I had the cables connected, I installed ClarisWorks 3 from the HD disk images found at Macintosh Garden. (http://macintoshgarden.org/apps/clarisworks-30-ppc) I then installed C-Kermit for OS X (http://macappstore.org/c-kermit/) on my MacBook Pro and was able to transfer files via Kermit protocol. It… Was… Slow… It was like pre-dialup-Internet days of downloading files from a dialup BBS slow. There had to be a better way.
I had read this thread a while back at 68kmla.org about creating a PPP bridge over serial connection to give your classic Mac a real internet connection of it’s own. (https://68kmla.org/forums/index.php?/topic/1334-networking-a-classic-mac-via-serial-port-os-x-unix-linux-internet/) I must have read this thread at least ten times, all the while thinking that if a Linux computer can be setup to serve PPP over serial connection to a classic Mac, then a Raspberry Pi would be the perfect Linux computer to use for that task. I had to try it out.
I had already purchased the Pi3b a few weeks back to use it with IvanX’s A2CLOUD and A2SERVER software with my Apple IIe, but I have not quite rounded up all of the cables necessary to make the proper serial connections just yet so the Pi was just sitting and waiting for something to do. I searched the Internet for a PPP configuration that was proven to work on the Pi and I found this great article about linking two Pis together via serial and PPP. (https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=149927) This was exactly what I was looking for. All I needed to do was configure my Pi3 with the same settings as Pi #1 in the article and it should be ready to receive connections from a PPP client installed on the Mac SE. (Pi #1 in that article is the Pi with the Internet connection.)
The first thing I needed to do was configure PPP on the Pi and get it working. Following the instructions, I setup the options.ttyUSB0 config file as follows:
# /etc/ppp/options.ttyS0
noauth
nocrtscts
passive
local
maxfail 0
persist
nodetach
10.101.102.1:10.101.102.2
proxyarp
Next, I created the rpippp service config file like so:
# /etc/systemd/system/rpippp.service
[Unit]
Description=PPP
[Service]
Type=idle
ExecStart=/usr/sbin/pppd -d /dev/ttyUSB0 57600
Restart=always
[Install]
WantedBy=multi-user.target
Alias=ppp.service
I then setup the forwarding in iptables:
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

Now it was time to setup the Mac. I used my tried-and-true method of ClarisWorks and Kermit to transfer over MacTCP, MacPPP and MacWeb and configured MacTCP and MacPPP as follows:
MacTCP:
IP address: 10.101.102.2
Obtain Address: Manual
Gateway Address: 10.101.102.1 (PPP address of the Pi)
Subnet Mask: 255.255.255.0
Domain Name Server Information: (Domain and IP Address of my Internet Provider)
MacPPP:
Port: Modem Port
Idle Timeout: None
Echo Interval: Off
Terminal Windows [ ]
Hangup on Close: [X]
Quiet Mode [X]
PPP Server Config:
Port Speed: 57600
Flow Control: None
Tone Dial
Phone Num (blank)
Modem Init (blank)
Modem connect timeout (90) seconds
(Everything else I left the default.)
Back on the Pi, I started the PPP service:
sudo systemctl daemon-reload
sudo systemctl enable rpippp.service
I fired up the PPP client on the Mac and crossed my fingers… I was expecting it to be a slow process, but in just a few seconds it connected and gave me a status of “PPP UP”!
At this point, I could ping the Mac from the Pi. However, I could not ping the Mac from my MacBook Pro. Because I used a separate subnet for the PPP network, it had no route to that PPP subnet. I still needed to add a route to the routing table of my Internet router so that I could communicate with that subnet and thus the Mac’s PPP interface. My router is a linksys, and adding the static route was easy. I gave it a gateway of the Pi’s WLAN0 IP address and just like that, I could ping from any machine on my home network to the Mac.
It was time to fire up a browser…
The funny thing about doing these projects on such a slow computer is that the time you spend waiting on things to happen really adds to the suspense. It seemed like it took forever to load the built in homepage of MacWeb, but it finally loaded. I typed in http://www.google.com and pressed enter. After a short pause, the status bar started giving me updates:
Making HTTP request… Receiving HTTP response… Receiving 1307 bytes… Receiving 2404 bytes…
In about 60 seconds, it loaded a page somewhat resembling the Google search page. MacWeb is a very early browser and thus does not support HTML 4 or 5 or CSS so the page was very broken. But it did eventually load a search bar and I typed in a random word and clicked the search button. Away it went at 57,600 bps and brought me my search results. Even though I had to parse through the broken CSS scripting that was supposed to be ran as code and not displayed on the screen, it was working! Next I decided to load a page that didn’t use any CSS and see what it was supposed to work like.
http://www.gryphel.com: Making HTTP request… … … …
It displayed this page exactly like it was intended to be seen (well almost):
IMG_5731
The last thing to try was to download a file and be able to run it. I followed the links here to the applications and chose to try out another browser – MacLynx. I have always had a thing for text-based browsers because they are usually light and fast and you can even use them with some scripting languages if you are keen enough. Plus they have an inherent ad blocker built in. (No graphics, no ads.)
IMG_5734
I clicked on the maclynx_beta1.sit.hqx link and MacWeb prompted me for a folder to save the file in. I chose an appropriate folder and away it went! In about 5 minutes or so, I had my file. MacWeb gave me an error about not knowing which application to open the file in, and I told it to not delete the temp file. I then closed MacWeb and proceeded to install MacLynx. After decoding the .hqx file and unstuffing the .sit that remained, I was left with a fully working MacLynx application! The only thing I had to do to it was to change the number of columns and rows to something small enough for me to see the entire window via the maclynx.cfg file. Once I changed those settings, I was able to open the app and resize the window like any other application in System 7. It fired up and ran just like expected.
This was a really fun project. I had not done any Linux-based routing or Internet Connection Sharing in at least 15 years and this brought me back to those days. Plus being able to use a $40 Pi3 to provide WiFi networking to a 28 year old black and white Macintosh that was not designed with any type of IP networking in mind was a really rewarding project! Now I’ll be able to download and install those games and apps that are archived in 800K disk images! Instead of spending $100 or more on a Mac SE compatible PDS ethernet adapter, I have given my SE WiFi capabilities and even though it is much slower than the PDS ethernet card would have been, it’ll serve my needs very well. Once I get my Apple II connected to the Pi, it’ll be sitting in between the two vintage computers happily providing virtual drives and terminal access to the Apple II and at the same time, providing PPP routing over WiFi to the SE!
UPDATE: Pics of my cable setup
I have been asked to post pictures of my cables and show how I have the Mac SE connected to the Pi.
Here is the Mac Mini-Din 8-pin connection, plugged into the modem port:

It is a right angle plug, but aside from that, it is a normal Mac 8-pin serial connection. The other end of that cable is a standard RS232 DB9 serial jack, which is connected to the USB-Serial adapter:

Finally, the USB-DB9 adapter is connected to the Pi’s USB port:

It doesn’t matter which USB port it is connected to, but you should know that if you change which USB devices are plugged in to which USB ports or if you change how many USB devices are plugged into the Pi, your adapter may change from ttyUSB0 to ttyUSB1 or any other number. Just recently, I plugged in another USB-serial adapter to connect to my Apple IIe, and it got loaded as ttyUSB0 and the adapter I had been using with the SE got loaded as ttyUSB1. I adjusted all of the references above to ttyUSB1 and all is well again.
Hope this helps clear up the cable connections.

You Might Also Like

3 Comments

  • Reply Thorsten August 13, 2018 at 9:42 pm

    Hello Jeff,

    I had same idea and started first to configure pppd an my MacBook High Sierra.
    I use same IP range for the ppp connection as my home net. Only ip-forwarding activating for the kernel and proxyarp option for pppd. local IP is IP of my Macbook, Remote IP is IP outside my dhcp range.
    It works fine. So I decide to change to raspberry. But it isn’t so easy as you described?!
    If I use same configuration. point-to-point connection starts successfully. ppp0 device is established and packages are transferred between both points. But no ping from raspberry to vintage mac possible.
    No transfer ftp, telnet from vintage to a other PC in my home network nor to internet.
    Reaching Nameserver also not possible.
    Is it absolute necessary to use IP configuration in a separate network and then work with nat and masquerading ?

    • Reply Jeff Ramsey August 13, 2018 at 11:01 pm

      Hi Thorsten,

      I’m not sure if this will work without the NAT and IP Masquerade. I know that you can do it within MacOSX using only ip forwarding and proxyarp, just as you described, because I did the same thing, when I was playing around with it all in the beginning. But I do not know if you can ping inbound to the vintage Mac with that configuration. I do know that when you use ‘Internet connection sharing’ on MacOSX, by default it uses NAT and IP Masquerade with a 192.168.2.0/24 network. I didn’t think to look at the route table in my MacBook Pro when I had ppp with ip forwarding and proxyarp working on that machine, so I do not know if it used that same setup for that. Nowadays, I have a serial LocalTalk network between three classic Macs and one of them has ethernet, so I installed LocalTalk Bridge and it does all of this connectivity for me.

      I’m sure what you are trying to do can be done to some extent, but it is way easier to just setup the IP Masquerade and NAT on the Pi. If I get a few minutes this week, I will try to setup a similar configuration and see what I can figure out.

      Good luck.

    • Reply Jeff Ramsey August 20, 2018 at 7:54 am

      Here is what I came up with:

      If you create a static route in your gateway router for the PPP subnet that you are using, pointing all traffic for that subnet to your Pi’s ethernet interface, and then you give your Pi’s PPP interface and the vintage computer’s PPP interface each an IP in that same PPP subnet, it should work without IP Masquerade and NAT. At least internally on your network. Traffic from the rest of your network will go to the gateway router as it is not that computer’s local network, the gateway router will read it’s route table and send that traffic to the Pi, and the Pi will forward that traffic to the ppp0 interface, which is serial bridged to the vintage computer. Outbound traffic will work the same way: Your vintage computer will send everything through the serial bridge to the Pi, the Pi will send it on out to the other network and the network will respond accordingly.

      The one thing I could not make work was to give the PPP bridge devices an IP that was in the same subnet as the existing ethernet network. I had to use a different subnet so that I could create that static route and direct traffic.

      Hope this helps.

    Leave a Reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.