Megapipe Communications

Dialing Up with GNU/Linux

Introduction

GNU/Linux is a collection of operating systems that have become a popular alternative to Windows in recent years. Unlike Windows, GNU/Linux is available for free with sourcecode. In testing this document, Red Hat Linux 7.0 and Slackware 8.0 were used to set up the connection. Best results from this document are to be gained from Red Hat Linux 7.x or above, or Slackware Linux 8.x or above. Hopefully the directions in here will carry over very well to other Linux flavors.

Disclaimer

Megapipe presently offers no official technical support for operating systems other than Windows and Macintosh. These directions may help you, but any damage you do to your Linux filesystem is yours to repair. These directions come with no warrenty, express nor implied.

Background Information

In preparing these directions, the dialer configuration tools in GNOME and KDE were not used. These directions are designed to allow you to use your terminal to set up a dial-up connection using GNU's pppd, which comes standard with many versions of UNIX. If you feel you know your system well, have experience in GNU/Linux, or are at least confident your modem is functioning properly with GNU/Linux, you may be able to skip straight to the configuration.

Red Hat Linux 7.0 and Slackware Linux 8.0 were the distributions these directions were tested with and are used only as examples. These directions should carry over to other Linux distributions, but it is the user's responsibility to fill in any gaps. Other popular Linux distributions include Debian GNU/Linux and SuSE Linux. Problems may arise if you're using an older version of pppd available with an older Linux distribution. It may be best to upgrade if you're using a version of Linux predating the year 2001.

Notes on Style

  • Quotes are used to denote commands to be typed into your shell. Don't copy quotes when you see them, unless they're part of a script. Copy what's inside the quotes.
  • Tables with gray backgrounds are used to denote what needs to be copied into a script. However, you may need to modify such scripts to represent your account. For instance, you will need to put your username, password, and nearest Megapipe phone number into the dial-in script.
  • Sometimes periods are omitted in sentences after file (e.g, /etc/resolv.conf) and device names (e.g., /dev/modem) so that the user won't be led to believe they are part of the pathname. Neither file names nor device names will ever end with periods, though sometimes file extensions will have them (e.g., resolv.conf).

What You Need to Know

The aim of this document is to help you set up a dial-up connection using a modem and standard phoneline. Because of the lack of support available for Linux at present (December 2002), there are many details you will likely need to know about your system that couldn't possibly be covered in one short document. This document will not help you configure DSL, ISDN, or Centrex. This document requires you to know/do at least the following:

  • You have at least a basic understanding of how Linux works.
  • You know how to use a UNIX text editor. The most common UNIX text editor is vi, but it is very archaic. Most Linux distributions include emacs and pico. pico is probably the easiest text editor for you to use.
  • You know what the root account does and you know your root password.
  • You need to use the root account throughout the entire procedure laid out in this document.
  • You use the root account when opening and closing connections. (Note: this is a great way to childproof your Internet connection. Your children won't be able to get online unless you let them know the password to the root account or log them on yourself.)
  • Your kernel is configured correctly with PPP support included (this usally shouldn't be a problem).
    • Most Linux distributions come with a generic kernel that offers support for PPP already compiled in.
    • Sometimes you may want to compile a custom kernel. Though this document doesn't cover kernel compilation, it should be noted that a custom kernel can improve performance system significantly. If you're using Red Hat as an end user, you probably won't need to recompile your kernel for any reason. On Slackware, you'll most likely want to configure a kernel to meet your system's specifications.
  • Your modem is connected, configured properly, and functions in Linux (see below).
  • You know the path to your modem device (even if you don't, it's often /dev/modem).
  • You have an Intel or compatible computer using x86 CPU architecture. That is, you have a 386, 486, or a Pentium of some sort. AMD, Cyrix, and Transmeta are other companies that make compatible architectures.
    • Some 90% of computer uses will have this type of architecture.
    • If you use Windows 95, 98, NT, Me, 2000, or XP, you really have no need to even pay attention to this detail. Most old computers running DOS and Windows 3.x should work too, as long as they're at least a 386. Having the proper CPI architecture does not ensure that other essential pieces of hardware will run properly.
    • If you're using some other architecture (PowerPC, Alpha, Sparc, etc.), these directions may help, but they haven't been tested on none-x86 platforms.

Comments. It would also help to know that anything coming after a hash mark (#) in the scripts and configuration files mentioned below is just a comment. For instance, if the line
ping 208.244.242.2 #pings a Megapipe nameserver
were to appear in a script, the computer would read only "ping 208.244.242.2" and ignore everything on that line after the hash mark. You aren't required to add the hashmarks or what comes after into your scripts, but sometimes it may help to keep them around for future reference. However, keep that top comment saying #!/bin/sh!

If you need additional help, you should look at the documentation made available on Linux.org. If you bought a commercial GNU/Linux distribution, you may be entitled to technical support. Sadly, making GNU/Linux work on some computers requires buying additional hardware.

Tips on Possible Pitfalls

Dialing in with GNU/Linux is not too difficult. The most difficult factor in dialing in with GNU/Linux often is configuring your hardware properly. Red Hat Linux is known to configure very easily because it can detect most hardware during installation or when rebooting. In fact, most distributions of Linux have made great strides in detecting hardware. First, here are some things to look out. Be very attentive about the following, especially if you don't know what kind of modem you have.

  • Internal vs. External Modems. Assuming you have a standard, vanilla modem, it probably doesn't matter too much whether it's internal or external. However, external modems are more desirable because you can see the lights indicating whether or not you're connected and whether there is any activity.
  • Winmodems or "Software Modems." As the name suggests, Winmodems are designed rather exclusively for Microsoft Windows.
    • A winmodem is an internal modem that uses software to replace many processes that a regular modem does itself.
    • These have become popular because they are cheaper to produce and that savings is passed on to the consumer.
    • The low price of winmodems makes them especially popular in less expensive PCs. The compactness makes them popular in laptops.
    • Some winmodems have drivers for Linux that you can (perhaps rather ironically) download separately. As of April 2002, however, most won't work no matter what you do.
    • It most likely will be easier to replace your winmodem with a standard modem.
    • If possible, replacing your winmodem will most likely have performance benefits in both Windows and Linux, since resources used to process network communications will be freed from the computer to be handled by the modem.
  • PCMCIA modems. PCMCIA devices are hardware expansions to laptops fitting into what's called a PCMCIA slot. This document doesn't take PCMCIA modems into account, but Linux is supposed to offer good PCMCIA support. You may want to do some additional research to make sure your PCMCIA devices will work before you install Linux on your laptop.
  • USB external modems are known to work in Linux, but this document doesn't cover them. Most Linux distributions will probably detect them properly and your modem device will just be /dev/modem
  • Know your modem device!
    • If your modem is connected to a serial port, the path to your modem would likely be /dev/ttyS0, /dev/ttyS1, /dev/ttyS2, or /dev/ttyS3.
    • Sometimes Linux may detect the modem when the operating system is being installed or a recognizable modem is added. The operating system may identify the modem simply as /dev/modem so that you will not need to know your modem's device path.
    • This is another area where you need to watch out for those winmodems. You may be absolutely correct about the path to your modem's device, but it won't do you much good if the operating system doesn't have the necessary drivers to execute connections via the modem.
  • Typographical errors. It may sound silly, but almost any typo will cause your connection script to fail. Leaving out a parameter will also probably cause your connection script to fail. Be very careful to write your script up correctly.

Network Configuration Files

 
domain megapipe.net
nameserver 208.195.115.14 #primary Megapipe nameserver
nameserver 208.244.242.2  #secondary Megapipe nameserver

The Dial-Up Script

Now, you need to create the dial-up, which is the script that tells the modem to dial in. This script should work with any generic modem. We're going to assume the phone number you're dialing into is is (703) 779-1000. The hypothetical login name we're going to use is mjohnson and the password is goldfish. You will need to change the login, password, phone number, and modem path accordingly. /dev/modem is used below and will work assuming you have the modem device properly linked to this path. If your modem's path is not linked to /dev/modem, simply supply the correct path (for example, /dev/ttyS0). If you don't know that path, you may need to do some searching (try /dev/ttyS0, /dev/ttyS1, /dev/ttyS3, and /dev/ttyS4). The script looks like this:

#!/bin/sh
pppd connect									\
	'chat -v "" ATDT7037791000 CONNECT "" ogin: mjohnson word: goldfish'	\
	/dev/modem								\
	38400									\
	debug									\
	crtscts									\
	defaultroute								\
	0.0.0.0:0.0.0.0

Just copy the script above into your favorite text editor and make the necessary changes. Save the file as /etc/ppp/ppp-on and then make it executable. Type "cd /etc/ppp" and hit enter. Then type "chmod +x ppp-on" and hit enter again. What does all this mean and why the strange characters?

  • The field above where you place your username is supposed to read "ogin:" and not "login:"!
  • "word:" is the correct field for your password, not "password:"!
  • The backslash ("\") tells your Linux box that the next line is actually part of the pppd command. If you were to execute the entire script in your shell, you would erase all the backslashes and put the entire script on one line.
  • ATDT7037791000 is the modem initialization line on a Hayes-compatible modem. You most likely have one of these.

Now just type "./ppp-on" and hit enter. Assuming your kernel, hardware, configuration files, and modem are set up correctly, your modem should now start dialing.

Testing your Connection

Now, your modem should have dialed in. If your modem speaker is turned up, you should have heard the modem making noise, as it would in any other operating system. Now, to test the connection, try pinging a machine on the Internet: type ping netgate.anent.com and hit Enter. You should see something that looks like this:

64 bytes from 63.65.99.2: icmp_seq=0 ttl=122 time=15.283 ms
64 bytes from 63.65.99.2: icmp_seq=1 ttl=122 time=16.891 ms
64 bytes from 63.65.99.2: icmp_seq=2 ttl=122 time=20.187 ms
64 bytes from 63.65.99.2: icmp_seq=3 ttl=122 time=11.617 ms
64 bytes from 63.65.99.2: icmp_seq=4 ttl=122 time=12.714 ms

If you get that response, you should be good to go. Otherwise, you may need to review your connection scripts to make sure you didn't make any typographical errors.

Shutting Down Your PPP Connection

The script below will allow you to shut down your PPP connection. Copy the script below to a file named ppp-off and set that file to be executable (chmod +x ppp-off). (The script was taken from the official Linux PPP-Howto.)

#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
	DEVICE=ppp0
else
	DEVICE=$1
fi

######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
	kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
	if [ ! "$?" = "0" ]; then
		rm -f /var/run/$DEVICE.pid
		echo "ERROR: Removed stale pid file"
		exit 1
	fi
#
# Success. Let pppd clean up its own junk.
	echo "PPP link to $DEVICE terminated."
	exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1
Home | Services | Destinations | HelpWeb |Terms of Service | Acceptable Use | Contact Us | WebMail