Configuring a PPP link between Linux and your Newton

At home, I have a Linux box. It acts as a server for the household network, providing Samba file and print services for my housemates Win95 machines and a permanent Internet link via PPP to my ISP.

What I wanted was a way to add my Newton to this network, so I could install packages, print, download news and email, etc. I considered buying the Farallon Ethernet card, but the places I tried wouldn't ship it to Australia.

I noticed in the Internet Setup application that one of the options was for a direct serial connection. I pulled out my DB9 to MiniDIN 8 cable, plugged it into the spare RS-232 port on my Linux box, and after some fiddling, I now have a PPP link for my Newton without dialing into an ISP.

I figured I might as well write this stuff down, just in case someone else wanted to do it, to save them having to discover what I did to get it to work.

If you have any additional information to add to this document, or you're having trouble and want to ask a question, you can mail me at davida@pobox.com.


Before you start ...

I did this in a particular way. There are other ways it could be done (if I get around to it, I might try them as well). I assume you have some knowledge of Unix/Linux, but I'll try to be clear enough for a beginner.

Prerequisites

In order to get this to work, there's a couple of things you need to have.

If you've got all this stuff, proceed!

Step by Step

  1. Check that the PPP daemon is executable by group members.

    Try running ls -l /usr/sbin/pppd. The result should look something like this

    	-rwsr-xr--   1 root     dip         76072 Mar  2  1997 /usr/sbin/pppd
    	
    where the red letter should be x or s, not -.

  2. Find out what group owns the PPP daemon.

    Try running ls -g /usr/sbin/pppd and note the group name. Maybe your PPP daemon is in a different place? You'll need to find it.

  3. Create a new user for the Newton and add then to the same group as the PPP daemon. You can do this in several ways:

    For Debian systems
    Run adduser --in-group ppp-group newton

    For Redhat systems
    Run useradd -G ppp-group newton

    Do it manually
    I'm not going to tell you how to do this. If you don't know, use the scripts that come with your distribution.

  4. Test the login.

    Try telnet localhost and use the new username (newton) and password. If this does not get you a Bash prompt, then something is wrong with the account. You'll need to fix this before proceeding.

  5. Decide which serial port you want to use.

    Depending on your setup, this could be a little tricky. If you already have a serial mouse and a modem on your computer, you might not have a serial interrupt free. Somehow, you need to find one.

    On a Debian system, the name for this device should be something like /dev/ttySn (where n is 0, 1, 2, 3 etc).

    On a Redhat system, it will be something like /dev/cuan (where n is 0, 1, 2, 3 etc).

  6. Edit /etc/inittab, adding a new line for the serial port you want to use.

    For a Debian system, try something like

    	S1:23:respawn:/sbin/getty -ihL ttyS1 38400
    	
    where S1 and ttyS1 correspond to the serial device you are using.

    For a Redhat system, try

    	S1:2345:respawn:/sbin/uugetty cua1 DT38400
    	
    where S1 and cua1 correspond to the serial device you are using.

  7. Run telinit -q to start the getty running, and verify that it is using ps.

    There will be other getty processes running, one for each of your unused virtual terminals. Look for the one that has your serial port device name.

    For a Debian system, this should look like

    	31143  S1 S      0:00 /sbin/getty -ihL ttyS1 38400
    	

    For a Redhat system, it should look like

    	31143  ?1 S      0:00 /sbin/uugetty cua1 DT38400
    	

    If it is not running, you'll need to find out why and fix it. Check your syslog output for error messages.

  8. Using PT-100 on the Newton, create a new connection setup (this is not strictly necessary, but it lets you check that the basic stuff is working before doing the PPP setup).

    Tap Connect, then Connect, then Edit Sessions. Create a new session using direct serial, speed 38400, 8 data bits, N parity and 1 stop bit. Enter your username (newton) and the new password.

  9. Connect the Newton to the serial port, using a suitable 8pin MiniDIN to 9 or 25 pin cable and the MP2x00 dongle if required.

    In PT-100, tap Connect and send a carriage return, and you should get a login prompt. Enter your username and password, and you should end up at a command prompt on your Linux box.

    If this works, you're halfway there ;-)

  10. Edit the .bash_profile for your new user. exec pppd.

  11. Create a new file /etc/ppp/options.ttyS1 (assuming you're using the second serial port: ttyS0 if first, etc). Edit the file to have the following line: "-defaultroute debug passive"

  12. Edit /etc/ppp/ip-up. If you are like me, you already use ppp0 to connect to your ISP. So you need to add some logic to this file. Log something to syslog.

  13. Edit /etc/ppp/ip-down. Log again.

  14. Create a new Internet Setup on the newton, selecting Direct Serial connection. If that's not an option, make sure you have the modem-serial-nie module installed.

  15. Select an IP address. Anything from your masquerading space will do. Set the Newton to use this.

  16. Set the DNS server (and optionally secondary server).

  17. Create the login script. Make sure you check the "Display progress" box. Put in lots of "pause" steps -- i used 1 second pauses between each step, and a 4 second one at the end. This helps you read the debugging messages.

  18. Connect the cable again, and open NetHopper or some other Internet application. When connecting, select your new Internet Setup.

  19. Start a tail -f on your /var/log/syslog.

  20. Tap Connect on the Newton, and watch the login process. When it flips back to "Engaging the PPP driver", look at the tail output -- you should see lots of stuff.

  21. Finally, you should see the result of the IP address negotiation, and the output from your ip-up script.

  22. Run route -n, check that the Newton is listed under the correct IP address like this. Ensure that there isn't and entry like this (defaultroute).

  23. You're up!


David Arnold
$Date: 2003/03/31 07:16:56 $