The PhoneBoy Blog


Simplifying Telecom, Mobile Phones, Gadgets, Health, and More!

SLiRP and your Macintosh

Back in ye olden days, before there was broadband Internet access or even dialup Internet, there were Unix shell accounts you could access on a dialup basis.

SLiRP is a program that runs on a UNIX-type operating system that will emulate a CSLIP/SLIP/PPP connection. The emulation is not 100%, but for most purposes (like reading Usenet news or using a web browser), it works fabulously. Check out the SLiRP Home Page for more information.

Back when I had to use this, you had to compile it. Now it’s built into most Linux distributions but maybe you’re using an oddball platform where you need to compile SLiRP. You’re on your own for that.

I wrote this HOWTO in the mid 1990s for a Mac (well before OS X). Maybe it will be useful still in some odd set of circumstances, maybe it won’t. In any case, these instructions are provided AS-IS. You have been warned.

What do I need to do this?

  • MacTCP (version 2.04 or better is preferred) or Open Transport
  • Dialup SLIP or PPP software (InterSLIP, MacPPP, FreePPP, etc)
  • Programs that use TCP/IP (NCSA Telnet, Netscape, Internet Explorer, etc)
  • A compiled version of SLiRP that resides on your Unix shell account. ** A brief step-by-step of the compilation process can be found here, which works on most normal Unix systems. ** If you’re having problems compiling SLiRP, this page has some SLiRP binaries you can try to use instead, including a few that I compiled long ago.

Things covered in this document:


Finding MacTCP and/or Open Transport

MacTCP is a commercial software product manufactured by Apple Computer. It allows a Mac to transmit and receive TCP/IP packets, the standard communications protocol used on the Internet. MacTCP is included with Apple’s System 7.5. You can also get it with the Internet Starter Kit, a book by Adam Engst. Not only does it contain MacTCP, but it also contains SLIP and PPP clients for the Mac as well as good documentation for setting it all up in various settings.

Open Transport came with System 7.5.2 and is meant to replace MacTCP. It's Apple's newly redesigned networking suite that also is Power-Mac native. Open Transport will not work on Mac Plus, SE, or Classic (or anything without at least a 68030 processor). The latest version of Open Transport is version 1.1 and is available at Apple's Support Web Site either as a seperate package or as part of System 7.5 Update 2.0.


Finding SLIP/PPP Software

Here's some places you can get MacPPP 2.0.1: Here's some places you can get FreePPP 2.5: Here's some places you can get InterSLIP 1.0.1: Or find a local mirror of sumex-aim.stanford.edu and look in the comm/tcp directory for mac-ppp-201.hqx, free-ppp-25-rf.hqx, or inter-slip-installer-101.hqx


Configuring MacTCP

Note: This assumes you've already installed both MacTCP, PPP or SLIP software, and rebooted your computer system. Open up MacTCP. There should be two icons here: "Localtalk" and something similar to the name of the SLIP/PPP program you're using.

Image: MacTCP MainScreen</center>

Warning: Do not have both SLIP and PPP installed at the same time. They conflict with each other.

Click on the one that corresponds to the SLIP/PPP program you're using. Then click the 'More' button (at the bottom of the dialog).

Image: MacTCPConfiguration Screen</center>

Set the areas of this dialog box up as follows. When you have configured all of this stuff properly, click 'Ok'.

Obtain Address

This to be set to 'server' as SLiRP's default IP address is usually acceptable. Of you set it to 'manual,' you will have to set the IP address yourself in the previous dialog where it shows '0.0.0.0' in the box.

I haven't tried this with Dynamic -- use this at your own risk.

IP Address

This section can generally be left alone.

Routing Information

If you use 'Server' for Obtain Address, then this field will not be editable and you can leave it alone. If you use 'Manual' for Obtain Address, either change the Gateway Address to the IP address of your SLiRP host or to your Gateway host. The System Administrator at your site can tell you either of these values. When SLiRP starts up, it will tell you what your IP address is.

Domain Name Server Information

You will need to get this information from your System Administrator as it is different for each site. Without this, you will be forced to use IP addresses and/or the hosts file in your System Folder to resolve names to IP addresses. Mosaic or Netscape will be impossible to use if this information is not correct.

You can also let SLiRP try and figure it out. Use SLiRP's address of 10.0.2.3 for your DNS server.


Configuring Open Transport

The Open Transport Configuration looks like this:

[Click Here to get Open Transport Configuration Picture]</center>

Connect Via

Depending on your hardware configuration, this pop-up menu may contain many different things. It should be showing whichever SLIP/PPP client you're using.

Configure Using

In my case, I was able to get it to work with "Using PPP Server." In this case, when you connect, your IP address should read 10.0.2.15. If you have problems connecting with "Using PPP Server" then use "Manual" configuration as follows:
IP Address: 10.0.2.15
Subnet Mask: 255.255.255.0
Router address: The IP Address of your SLiRP host (SLiRP tells you what this is when you invoke it from the Unix command line).

Implicit Search Path
Starting Domain Name

Enter the domain name of your SLiRP host. On a fully qualified hostname, it would be the last two bits. For example, if the name of your host was foo.bar.ack.com, your domain would be ack.com. If you don't know what the full host name of the system that you're on, ask your System Administrator.

Ending Domain Name

Leave this blank.

Additional Search Domains

Use the same domain you used in "Starting Domain Name" above.

Name Server Addr

When you invoke SLiRP from the command line, it should give you up to three IP addresses that can be used for DNS. Take each one of these IP addresses and enter them into this box. If these don't work, you will need to ask your System Administrator what your DNS server is.

You can also use SLiRP's address of 10.0.2.3 for your DNS server. 


Configuring MacPPP

Note: These screen shots are of MacPPP 2.0.1. FreePPP 2.5 has similiar options, though they may be located in different windows.

Image: ConfigPPPMain Screen</center>

From here, click 'new' to create new settings. Enter the name you wish to give this configuration and click 'Ok'. Configure Port Name (modem or printer), Idle Timeout, and Echo Interval to your own needs. 'Quiet Mode' and 'Hangup on Close' should be clicked on. 'Terminal Window' should be clicked on if you don't use a connect script. Now click on 'Config'. The following dialog box will come up:

Image: ConfigPPPConfiguration Screen</center>

PPP Server Name

This will be the name you specified when you clicked 'New' earlier. This is how you change the name of a set of settings.

Port Speed, Flow Control

These should be set as necessary for your modem to function properly. If you're using a 14400 modem (or higher), I recommend CTS&RTS (DTR) Flow Control and Port Speed of 57600.

Phone num, Modem Init

Dialup number for your shell account. Modem init should be the same as for your normal communications program.

Connect Script

Click on 'Connect Script...'. A dialog like the following will come up:

Image: ConfigPPPConnection Script</center>

I have keyed in a 'sample' script that should work with most Unix hosts. The only change most people will have to make is where it looks for the standard Unix prompt (in my case, just a '$'). Depending on the type of system you log into, you may also need to change the "login" and "password" prompts accordingly. Here is what my script does, in plain english:

  • Waits for the phrase 'ogin:'
  • Sends 'MyLogin' with a carriage return
  • Waits for the phrase 'assword:'
  • Sends 'MyPassword' with a carriage return.
  • Waits for '$' (My Unix prompt)
  • Sends 'slirp -P' with a carriage return.
  • Waits for 'SLiRP Ready'
Other things you can do in the connect scripts include \d (for delay 1 second) and send ctrl characters by prefacing them with a '^' (e.g. ^c is Control-C). Each script line is also limited to about 40 characters. See the MacPPP documentation for more details on the scripting. Each system will have slightly different timings. You should perform this manually a few times to get an idea of the correct timings for your particular system. Using these techniques, you can shorten this script dramatically to:

Image: Shortened ConfigPPP Connection Script</center>

In english, this translates to:

  • Wait for the phrase 'ogin:'
  • Send MyLogin and a carriage return, wait a second, and send MyPassword with a carriage return.
  • Wait 4 seconds and type 'slirp -P'
  • Wait for 'SLiRP Ready'
Note1: The 'SLiRP Ready' portion of both these scripts is optional, but some users have found that it helps improve reliability, which is why I have included it.

Note2: If you do not use a Connect Script, you will need to have 'Terminal Window' chcecked in the Main ConfigPPP window. This is a simple terminal emulator that will allow you to login and start up PPP on the remote end without using a regular terminal program.

LCP Options

In most cases, these settings will not need to be altered for use with SLiRP. Two things may need altering, depending on your configuration:

Image: ConfigPPPLCP Options</center>

Async Char. Control Map

If your connection is not completely 8-bit clean, you may need to alter the value under 'Local'. For 8-bit clean lines, the default of 00000000 will work. In my case, Ctrl-S and Ctrl-Q are used by the local system. Thus I use the async map 000a0000. In any case, this must correspond to the value that you set SLiRP up with. See Configuring SLiRP for more details.

Max. Rexeive Unit

The value under the 'Local' heading corresponds to your MTU (SLiRP's MRU). The value under the 'Remote' heaqding corresponds to your MRU (SLiRP's MTU). The default values are usually acceptable, although you may need to reduce them to increase throughput. These values should correspond to how you set up SLiRP.

IPCP Options

You won't need to do anything here. The defaults work fine.

Image: ConfigPPPIPCP Options


</center>

Configuring InterSLIP

Before starting to configure InterSLIP, you will need two things:
  • A "dialing" script. If you have an ARA script for your particular modem, this will suffice, though I do not recommend using Supra's ARA script for their v.34 modems.
  • A "gateway" script. This is a type of macro that will control the connection after the modem connects, but before the SLIP connection starts.
I have both a dialing script and a gateway script. You will have to make slight modifications to these scripts (which are text files) in order to make sure that they work for you. Most of the places you will need to modify have been easily pointed out in comments within the scripts themselves.

These files will need to be placed in folders within the 'InterSLIP Folder', which is in 'Preferences' under the 'System Folder.' DialSLiRP will need to be placed within the 'Dialing Scripts' folder; GateSLiRP will need to be placed within the 'Gateway Scripts' folder.

Once this has been done, open up the InterSLIP Control Panel or the InterSLIP Setup application:

Image:InterSLIP Main Screen</center>

From here, pull down 'new' from the File menu to create new settings. Enter the name you wish to give this configuration and click 'Ok'. In this example, I chose 'MyProvider' as my test name.

Image:InterSLIP Main Screen with MyProvider</center>

Now your provider should appear in the list. To change the settings for this provider, double-click on its name.

Image:InterSLIP Configuration Screen</center>

Serial Port, Baud Rate, Data Bits, Stop Bits, Parity

In most cases, this should read 'Modem Port', 57600, 8, 1, None.

Hardware Handshaking

Hardware handshaking is highly recommend if you're using a 9600 baud or greater modem.

Speaker on while dialing

Set to suit your tastes.

Dial Script

Set this to either 'DialSLiRP' or to the name of the Dialing script that you intend to use with InterSLIP.

Dial, Phone No., Modem Init

Set as appropriate.

Gateway

Set to 'GateSLiRP' or whichever Gateway Script you want to use.

Username, Prompt for password at connect time

Set username as appropriate. If you wish to have it automatically enter your password at login, uncheck the box and type your password in. Note that it will be shown in plain text now and in subsequent reconfigurations.

IP Address, Nameserver

These values can be left blank. MacTCP supplies both of these.

RFC 1144 TCP Header Compression

If you wish to use CSLIP, check this box. Since CSLIP offers slightly better per formance than SLIP (comparable to PPP), there;s no reason not have th is checked.

MTU Size

InterSLIP's default is 1500. SLiRP's default is 552. To start with, use 552. Once you've got the connection up and running, change to suit your needs.


Configuring SLiRP

There are two files that you will need to read. Danny (the author) finally wrote a comprehensive SLiRP manual that explains everything in gory, graphic detail. There's also a file that just goes thru the various SLiRP configuration options that can be used and the various methods for configuring SLiRP. However, in order to get SLiRP initially running, you can generally add options like baudrate and asyncmap when you invoke SLiRP from the Unix command line.


Invoking SLiRP

The minimal command line you will need to get SLiRP going is:
slirp -P (for PPP clients)
slirp (for SLIP clients)
If you need to change the baudrate parameter to 14400, you'd invoke SLiRP like:
slirp -b 14400 (for SLIP clients)
slirp -b 14400 -P (for PPP clients)
PPP users only: If you need a different asyncmap than 00000000 (like 000a0000), then invoke SLiRP as:
slirp -P "asyncmap 000a0000"
Other options are explained in this text file.
 


Short List of Problems and Questions

These are a short list of some of the problems I've seen in email in the time I've had these pages up: 

DNS doesn't work
(Otherwise known as: "Netscape can not find a DNS entry for host.foo.com")

Before you start messing with your DNS settings, verify your connection to SLiRP. (See below) Double-check your DNS information from your System Administrator. If it's correct, remove the file 'MacTCP DNR'. If you're using MacTCP, also delete the file 'MacTCP Prep'. Once you've done that, reboot.

I'm connected, but I can't seem to go anywhere

The good news is, if you've gotten this far, you've probably configured things properly. The first thing to check is if you can telnet (from the Mac) to 10.0.2.0 and check out SLiRP's 'on-the-fly' configuration program. If you can do this, then it might be that DNS isn't configured properly.

If you can't do that, you may not have an 8-bit clean path between you and your SLiRP host. This is basically required, though PPP software can partially account for it by using the 'asyncmap' option. The usual culprit is Ctrl-S and/or Ctrl-Q. If you use the asyncmap ffffffff and you still can't do anything, then you probably can't use SLiRP.

Another SLiRP user suggested adding an 'stty pass8' to the connection script. This may not work on your particular Unix system, so your mileage may vary.

I get "Link Dead" when I try to connect

Most likely, if you've gotten this far, SLiRP is at fault. It works better on some systems than others. In your MacPPP/InterSLIP script, invoke SLiRP with the '-d' option (debug). This information will not be of use to me, but will be of good use to SLiRP's author.

You may also want to check for 'core' files in the same directory as SLiRP's binary. That's usually an indication that SLiRP isn't working.

I have a serial connection into a terminal server. Can I make this work using scripts without an actual modem?

Theoretically yes, though I have not tried it. From what I can tell, you can't make MacPPP work without a modem so you're stuck with using InterSLIP if you must want scripting. InterSLIP can work without a modem as you can just specify "Direct Connect" for your dialing script. With an 8-bit clean connection and a properly written gateway script, which is the script that logs you in once you get connected, you should be able to make it work. I've created a hacked version of the gateway script for InterSLIP for use in these situations. It expects a prompt and a response before the actual "login" prompt. Warning: This script has only had minimal testing and requires a little modification before use, so use at your own risk! It would be impossble to write a "generic" script for this purpose as everyone has a different login procedure for their terminal server. Tom Guptill donated his gateslirp script that he uses to connect to the University of Rochester's Xyplex terminal server.

In all cases, you should be able to use it "manually". In the case of MacPPP, you may need to use the terminal window. In the case of InterSLIP, you'll have to use an external program (like ZTerm) to set up the connection and then use "Direct Connect" on both the Dialing and Gateway scripts.


So did this help?

Does this make sense? Was it useful? Do you have any other questions or comments? Email me at [email protected], and I'll see what I can do for you.

#Cybersecurity Evangelist, Podcaster, #noagenda Producer, Frequenter of shiny metal tubes, Expressor of personal opinions, and of course, a coffee achiever.