• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Connecting old Macintosh to the net using serial

TechEdison

Well-known member
A topic (that is currently pinned) exists with a tutorial for connecting your Macintosh to the internet using USB -> serial, but it is very outdated and I ran into several issues while following it. I'm going to add further instruction to it (which is mostly copied from a reply to a thread I made).

For starters, some amazon links!

USB->Serial: https://www.amazon.com/gp/product/B00J4N9T9C/
RS422->RS232: https://www.amazon.com/gp/product/B000068OEQ/

Original page (you'll need this for most of the tutorial):





There were a few things I had to do differently.

First, you cannot do it on a modern system for some reason. The PPP daemon for Linux just doesn't do what you would need, and the one for a later OS X (in my case 10.7) would not run. I ended up using my iBook G4, but had to get ancient PowerPC drivers for the USB->Serial adapter from https://web.archive.org/web/20071114081401/http://www.prolific.com.tw:80/eng/downloads.asp?ID=31. In the end I got a nice tty.usbmodem to work with.

Nowhere on any pages of this thread does it tell how to properly setup MacTCP, which I had to experiment with for quite a while. Here are the steps I did:

  • Set "Obtain Address" to manual
  • Set gateway address as your router's IP address (in my case, 192.168.0.1)
  • Set "Class" (in the IP Address settings) to C
  • Make sure your subnet is correct (in my case, 255.255.255.0)
  • Set your domain name servers to: *

    URL: ignore.com (literally just this) IP: 8.8.8.8
  • URL: ignore.com IP: 8.8.4.4

[*]Click "OK"

[*]You should have a box for "IP Address" when you click ok. Set that to something similar to one on your network (for example, gateway is 192.168.0.1, ip is 192.168.0.123)

[*]Click the close button and restart

* I have not yet been able to resolve any domain name outside the router, which I have yet to figure out. I will include instructions and code for a simple proxy.

Once MacTCP is setup, make a MacPPP profile with no phone number and baudrate set at 57600. Assuming you've already got drivers figured out for your system, connect the vintage mac to your internet-connected mac and open a terminal to type the commands in the above thread. Make sure the baudrate is the same as you set in MacPPP. Hit "Open" on MacPPP and -whoosh- you're connected to the internet!

If anyone has ideas on how to fix name resolution, please reach out to me! Currently its very tricky to get anything done using my script.

Proxy Instructions:

Make sure you have a simple web server (with PHP installed) running on some other computer of your home network that CAN access the outside world. In your WWW directory (I won't be explaining setup since there are plenty of tutorials) create a file called proxy.php and put this inside:
 

<?php

$ip = "192.168.0.110";

//Get the raw html.
$furl=trim($_GET["url"]);
$raw = file_get_contents($furl);

//proxy everything
$replacethis="href='";
$replacestring="href='http://$ip/proxy.php?url=";
$raw=str_replace($replacethis,$replacestring,$raw);

$replacethis="href=\"";
$replacestring="href=\"http://$ip/proxy.php?url=";
$raw=str_replace($replacethis,$replacestring,$raw);

$replacethis="<head>";
$replacestring="<head><base href='http://$ip/proxy.php?url=".$_GET['url']."'>";
$raw=str_replace($replacethis,$replacestring,$raw);

//Echo the website html
echo $raw;

?>


Change $ip to the IP of your computer (you can find this with ifconfig in linux and mac, or ipconfig in windows), and connect to a website on your mac using: http://<YOUR IP>/proxy.php?url=<URL YOU WANT TO VISIT>

This will not only fix the DNS problem, but also allows you to access HTTPS sites which are not supported on your mac.

 
Last edited by a moderator:

Bunsen

Admin-Witchfinder-General
Thanks TechEdison - I've added a link to this thread at the end of the older pinned one.

 

TechEdison

Well-known member
Thanks! Hopefully it will clear up confusion for people trying to do it these many years later... After all, it's the cheapest way I've seen so far to connect old macs to the internet.

 

davidg5678

Well-known member
I have just tried this out with my iBook G3 running Tiger, but it is not working quite yet for me. I have a USB to RS232 adaptor (similar to the one you linked) connected to my iBook and to the modem port of my SE/30. I installed FreePPP on the SE/30 and set it up the same way as above. I am using FreePPP as referenced in the old guide -would using MacPPP as listed above make any difference? MacTCP is configured the same way you described; however, I was not sure what to enter into the Gateway Address box. I have an AirPort Extreme set up for my iBook as it does not like my modern router. Should I use the IP address of my modem, router, or AirPort? 

On the iBook side of things, I am running OSX 10.4.11 which I figured would be the most similar to what the original tutorial was using. I installed the same drivers from Prolific, (they still host them on their website -no archive.org required) and I plugged the adaptor into the computers. When I plugged the adaptor into the iBook, it opened a new menu in the Networking panel of System Preferences listing a ton of settings specifically for a USB serial device. Do I need to change any of these settings? When I ran the code from the other thread, I received errors about the KeySerial1 device. I assumed I could change that to cu.usbserial as that was the way the computer seemed to detect the adaptor. This did not seem to work. Is there a way to find what I should type in after the baud rate? I also changed IP addresses so they corresponded to the laptop IP and the SE/30 IP. Was the IP of the SE/30 the same as the 192.168.0.123 from before? I am also concerned that there may be an issue between using a 10.0.0.0 address and a 192.168 address. I pressed connect on the FreePPP after running this command but I received a message stating that the connection did not work.

Is there anything I am doing wrong? Do I need to use the PHP Proxy Script? I really hope to get this working as it seems like great way to connect my mac to the internet.  :)

Serial Adaptor: https://www.amazon.com/gp/product/B017CZ3FZ2/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

Code from other thread:

5. Run the following with root privileges on the iMac:

sysctl -w net.inet.ip.forwarding=1

(tell the Kernel we want to forward IP packets)

pppd 230400 tty.KeySerial1 local persist passive maxfail 0 proxyarp 192.168.1.102:192.168.1.245

(activate the PPP daemon at 230400, using the KeySpan's #1 serial port, don't use modem control lines, persistent connection, don't dump out if the peer isn't there, ditto, add to ARP table so other networked machines can see it, Ip address of the iMac:Ip address of the Powerbook)




6

 

TechEdison

Well-known member
Phew lots to work with!

About FreePPP: For starters, I'd try it with MacPPP. Not sure how you got FreePPP running, it just froze the computer when I tried.

Network issues: I had exactly the same issue with my iBook G4, same OS. Don't use wifi, that's just generally a bad idea to start. Plug it into your router or hub using an ethernet cable, and it should automatically get the IP address. If that's not an option, see the attached screenshot for the router settings. Your gateway is the "Router:" option.

USB -> Serial: Ignore all the extra options in the networking panel, they are not going to be used. you want to use tty.usbserial, not cu.usbserial. The full command in your case would be:

Code:
pppd <BAUD SET IN MacPPP> tty.usbserial local persist passive maxfail 0 proxyarp <IP OF THE iBook>:<IP OF THE SE/30>

The ip of the SE/30 should be similar.. If the computer is 192.168.0.100, make the SE/30 something like 192.168.0.150. The ip should be <gateway without last number>.<some number>, which in my example, the gateway is 192.168.0.1, so the ip is 192.168.0.100


Proxy script: you -might- not have to use it.. In my case, the Macintosh Classic could not connect to outside domains for some reason, and could only ping/connect to IP addresses within my network (the router, the web server on my other computer, etc), but give it a try.

Try some of the things I listed above, if you still have issues send a PM my way and we can try and fix it there. I'd love to see your SE/30 on the internet! I was not able to get my Plus on the internet (the OS said it ran out of ram, even though it had the same as my classic).

Network_enet_tcpip.png.pagespeed_ce.OWmCSh-8nI.png.09ef1a5b61732e8c97cb0130cdf6fb43.png


 
Last edited by a moderator:

davidg5678

Well-known member
After trying these troubleshooting steps, I still cannot connect to the internet or establish a connection to my iBook. I completely uninstalled FreePPP and replaced it with a fresh install of MacPPP 2.0.1. I do not have ethernet in my workshop, but I tried sharing the wifi connection of my MacBook through ethernet to the iBook. This gave the iBook an IP that started the same way as everything else. My router became 192.168.1.1 and the iBook became 192.168.2.2. The SE/30 remained 192.168.0.123. Do I need to change the address I created for the SE/30 to something specific?  I am not sure whether or not my serial functionality is working. I now am running the command with tty.usbserial instead of cu.usbserial. When I press open on the SE/30, the computer says it is establishing a connection and a while later that the link is dead. I am not sure why it is not working.

Something interesting is that MacPPP and FreePPP have different max baud rates. FreePPP has a max of 230400 baud, so it would be nice to use in the future. There are additional settings within MacPPP that you did not mention. Do I need to change any of these? In MacTCP, there are also checkboxes for something about subnet masks. Which do you have checked? Is there a general way I can verify my serial adaptor and computers are working? I have never seen this SE/30 online before. I still am not using a proxy, but I think I need an initial first connection with the iBook before adding that.

 I appreciate the quick and detailed response to my wall of questions. This will be very exciting once it works. :)

 

TechEdison

Well-known member
First priority is to get the iBook on the net. Once you can access something like google.com, you should be good.

Set the gateway on the se/30 to the one on the iBook. If the iBook can connect to the internet it should be good. Set the ip on the se/30 to something like the one on the iBook but changing the last number. Ignore all the checkboxes.

If you have a spare linux machine, you can test the serial adapter that way using getty. Open ZTerm on the SE/30 and run: /usr/sbin/getty -L <serial port> <baudrate> on the linux machine.

 

Dog Cow

Well-known member
 My router became 192.168.1.1 and the iBook became 192.168.2.2. The SE/30 remained 192.168.0.123. Do I need to change the address I created for the SE/30 to something specific?  :)
I see TechEdison gave you one answer, which is a good one, but here is another answer:

It depends on the value of the netmask, which defines which sets of addresses belong to one logical network. If the netmask is 255.255.0.0 then there is no need to change the SE/30's address. However, if your netmask is 255.255.255.0, then your SE/30 is part of a different logical network (and so is your iBook) so it could only communicate to outside computers via the router (also called gateway).

 
Last edited by a moderator:

jamesmilne

Active member
Hi TechEdison,

I've done this recently for my Macintosh SE too.

I'm using a Raspberry Pi as a PPP server over Serial. I've soldered up a 8-pin MiniDin to 9-pin serial cable, then use a USB-Serial adapter to plug into the Raspberry Pi. Ideally I'd hook up a 9-pin serial port directly to the Raspberry Pi and eliminate the USB-Serial adaptor, I'll probably do that eventually. I've built the Raspberry Pi into the case of an old US Robotics Sportster 14,400 modem for added retro streetcred.

Here's my pppd script:

pi@pimodem:~ $ cat /usr/local/bin/runpppd
#!/bin/bash

echo Waiting on ttyUSB0
while [ ! -c /dev/ttyUSB0 ]; do
sleep 1
done

echo Starting ppd
/usr/sbin/pppd \
/dev/ttyUSB0 \
57600 \
debug \
noauth \
local \
passive \
xonxoff \
nodetach \
ms-dns 10.44.0.2 \
10.44.99.1:10.44.99.2


The ms-dns line provides the IP address of the DNS server for the PPP client to use.

Here's my systemd unit file that starts the pppd daemon when the raspberry pi starts up:

pi@pimodem:~ $ cat /etc/systemd/system/macos-pppd.service
[Unit]
Description=macos-pppd
After=network.target

[Service]
ExecStart=/usr/local/bin/runpppd

[Install]
WantedBy=default.target


What's the speaker for, I hear you ask? I've rigged up the pppd daemon to play a WAV of a modem handshake when you initiate a PPP connection :D

Here's my modem handshake audio playback script:

pi@pimodem:~ $ cat /etc/ppp/ip-up.d/001handshake
#!/bin/bash
aplay /usr/local/share/sounds/handshake.wav




IMG_3484.jpg

IMG_3487.jpg

IMG_3490.jpg

 
Last edited by a moderator:

jamesmilne

Active member
I'm sure I'm missing some other steps from the Raspberry Pi side, specifically enabling IPv4 packet forwarding, and setting up iptables rules to forward the traffic from the ppp0 interface. I should write up my notes properly.

 

mactjaap

Well-known member
This is what I am doing

I have added ppp to my MacIPpi! Works like a charm. Just connect a USB to serial adapter to the USB slot in the OrangePi and check if it is active with dmesg:

[566985.814868] usb 3-1.3: new full-speed USB device number 3 using ehci-platform
[566985.965661] usb 3-1.3: New USB device found, idVendor=067b, idProduct=2303
[566985.965672] usb 3-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[566985.965677] usb 3-1.3: Product: USB-Serial Controller D
[566985.965683] usb 3-1.3: Manufacturer: Prolific Technology Inc.
[566986.018202] usbcore: registered new interface driver usbserial
[566986.018274] usbcore: registered new interface driver usbserial_generic
[566986.018340] usbserial: USB Serial support registered for generic
[566986.022070] usbcore: registered new interface driver pl2303
[566986.022192] usbserial: USB Serial support registered for pl2303
[566986.022323] pl2303 3-1.3:1.0: pl2303 converter detected
[566986.027172] usb 3-1.3: pl2303 converter now attached to ttyUSB0




Connect you Macintosh with an ImageWriter cable (that is a null modem cable..as we remembered ) to the USB serial adapter.

Install ppp

#apt-get install ppp


Edit /etc/ppp/options.ttyUSB0

# Baud rate of the connection. ElWhip uses 19200.
19200
# Don’t use the modem control lines.
local
# Try to reopen the connection it it is terminated.
persist
# Don’t require the peer to authenticate.
noauth
# Disable negotiation of Van Jacobson style IP header compression.
novj
# IP address to be given to peer.
192.168.179.1:192.168.179.2
# now in  /etc/ppp/ip-up
# IP address of the DNS server for the peer.
ms-dns 192.168.179.1
#usepeerdns
# Enables IP forwarding on linux
ktune
# Add an entry for the peer to this system’s ARP table.
Proxyarp






Make a system entry:

#vi /etc/systemd/system/pppd-ttyUSB0.service

[Unit]
Description=pppd-ttyS2.service

[Service]
Type=forking
ExecStart=/usr/sbin/pppd 192.168.179.1:192.168.179.2 /dev/ttyUSB0 19200
ExecStop=/bin/kill `pgrep -f "pppd.?.*ttyUSB0`

[Install]
#WantedBy=multi-user.target
WantedBy=graphical.target


Start the service 

#systemctl start pppd-ttyUSB0






Check if it running ok

# systemctl status pppd-ttyUSB0

Code:
● pppd-ttyUSB0.service - pppd-ttyS2.service
   Loaded: loaded (/etc/systemd/system/pppd-ttyUSB0.service; disabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-01-13 12:02:18 UTC; 8min ago
  Process: 7454 ExecStart=/usr/sbin/pppd 192.168.179.1:192.168.179.2 /dev/ttyUSB0 19200 (code=exited, status=0/SUCCESS)
Main PID: 7460 (pppd)
   CGroup: /system.slice/pppd-ttyUSB0.service
           └─7460 /usr/sbin/pppd 192.168.179.1:192.168.179.2 /dev/ttyUSB0 19200

Jan 13 12:02:18 macippi systemd[1]: Started pppd-ttyS2.service.
Jan 13 12:02:48 macippi pppd[7460]: LCP: timeout sending Config-Requests
Jan 13 12:02:48 macippi pppd[7460]: Connection terminated.
Jan 13 12:02:49 macippi pppd[7460]: Modem hangup
Jan 13 12:02:49 macippi pppd[7460]: Using interface ppp0
Jan 13 12:02:49 macippi pppd[7460]: Connect: ppp0 <--> /dev/ttyUSB0
Jan 13 12:03:16 macippi pppd[7460]: Cannot determine ethernet address for proxy ARP

Download ElWhip:
http://apple-crapple.blogspot.nl/p/blog-page_19.html

Start ElWhip

Hit Enter a few times to give OK for ppp connection…

And test from your MacIppi

#lynx http://192.168.179.2


You should get a default web page.

( and………..Connect it to internet bij fiddling around with iptables or nginx!  )

 
Last edited by a moderator:

TechEdison

Well-known member
really cool! I like the raspberry PI usage, looked like you all are having fun on the net with your compact macs!

 
Last edited by a moderator:

mactjaap

Well-known member
Opened up my router on port 80 and forwarded trafic on port 80 to my MacIPpi.

Made an iptables entry on the MacIPpi to forward all incoming traffic on port 80 to the ppp connected Macintosh Ed and so it is now online!

iptables -t nat -A PREROUTING -p tcp -d 192.168.178.50 --dport 80 -j DNAT --to 192.168.179.2:80
iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT




You can reach it at http://ed.macip.net

(I will keeep it online until midnight today CET time...which is around 6 to 9 hours ahead of the USA.)

 

mactjaap

Well-known member
Bed time...so server is shotdown... This is how it looked


Macintosh ED web server; made possible by ElWhip


The web page you are viewing is being served on a Macintosh ED with 1024K RAM.
It is connected with a serial cable to a PC. On that PC is a MacIPgw Linux virtual machine running (MacIPgw VM). On the VM a USB serial cable is connected and pppd active. I have forwarded all traffic for port 80 on this VM to port 80 of the Macintosh ED. This machine is connected on a separate subnet 192.168.179.0/24. The PPP server is 192.168.179.1 and the Macintosh 192.168.179.2. 
ed.jpg.268cd115f17675fa3d71ae9b3506e6ba.jpg


ed2.jpg.1a0c018bc2e9485763b8c589ef2caacf.jpg




Thanks to Apple Crapple!
This is the first known web server able to even run on a 128K Macintosh. This is made possible by the lightweight TCP/IP stack lwIP

 

TechEdison

Well-known member
very cool! Didn't get a chance to check it out, thanks for posting the site in a reply.

Haven't been very active lately with my NoCSS site... My hope is to get a google search system figured out within the next week, and try to fix my web proxy so there isn't a massive security issue.

 

Lutefisky

Member
I'm sure I'm missing some other steps from the Raspberry Pi side, specifically enabling IPv4 packet forwarding, and setting up iptables rules to forward the traffic from the ppp0 interface. I should write up my notes properly.
Hey jamesmilne, I got further with your setup than I have with all the others I've tried.

Would it be possible to show me how you set up your iptables forwarding (and might as well show the work on the IPv4 packet forwarding, although I think I've go that already).

Thanks for your time and effort...

 
Top