14.5. Dial-out Service

Information integrated from FAQ.

The following are tips to getting your host to be able to connect over the modem to another computer. This is appropriate for establishing a terminal session with a remote host.

This is useful to log onto a BBS.

This kind of connection can be extremely helpful to get a file on the Internet if you have problems with PPP. If you need to FTP something and PPP is broken, use the terminal session to FTP it. Then use zmodem to transfer it to your machine.

14.5.1. Why cannot I run tip or cu?

On your system, the programs tip and cu are probably executable only by uucp and group dialer. You can use the group dialer to control who has access to your modem or remote systems. Just add yourself to group dialer.

Alternatively, you can let everyone on your system run tip and cu by typing:

    # chmod 4511 /usr/bin/tip

You do not have to run this command for cu, since cu is just a hard link to tip.

14.5.2. My stock Hayes modem is not supported, what can I do?

Actually, the man page for tip is out of date. There is a generic Hayes dialer already built in. Just use at=hayes in your /etc/remote file.

The Hayes driver is not smart enough to recognize some of the advanced features of newer modems--messages like BUSY, NO DIALTONE, or CONNECT 115200 will just confuse it. You should turn those messages off when you use tip (using ATX0&W).

Also, the dial timeout for tip is 60 seconds. Your modem should use something less, or else tip will think there is a communication problem. Try ATS7=45&W.

Actually, as shipped tip does not yet support it fully. The solution is to edit the file tipconf.h in the directory /usr/src/usr.bin/tip/tip Obviously you need the source distribution to do this.

Edit the line #define HAYES 0 to #define HAYES 1. Then make and make install. Everything works nicely after that.

14.5.3. How am I expected to enter these AT commands?

Make what is called a ``direct'' entry in your /etc/remote file. For example, if your modem is hooked up to the first serial port, /dev/cuaa0, then put in the following line:

    cuaa0:dv=/dev/cuaa0:br#19200:pa=none

Use the highest bps rate your modem supports in the br capability. Then, type tip cuaa0 and you will be connected to your modem.

If there is no /dev/cuaa0 on your system, do this:

    # cd /dev
    # MAKEDEV cuaa0

Or use cu as root with the following command:

    # cu -lline -sspeed

line is the serial port (e.g./dev/cuaa0) and speed is the speed (e.g.57600). When you are done entering the AT commands hit ~. to exit.

14.5.4. The @ sign for the pn capability does not work!

The @ sign in the phone number capability tells tip to look in /etc/phones for a phone number. But the @ sign is also a special character in capability files like /etc/remote. Escape it with a backslash:

    pn=\@

14.5.5. How can I dial a phone number on the command line?

Put what is called a ``generic'' entry in your /etc/remote file. For example:

    tip115200|Dial any phone number at 115200 bps:\
            :dv=/dev/cuaa0:br#115200:at=hayes:pa=none:du:
    tip57600|Dial any phone number at 57600 bps:\
            :dv=/dev/cuaa0:br#57600:at=hayes:pa=none:du:

Then you can things like:

    # tip -115200 5551234

If you prefer cu over tip, use a generic cu entry:

    cu115200|Use cu to dial any number at 115200bps:\
            :dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du:

and type:

    # cu 5551234 -s 115200

14.5.6. Do I have to type in the bps rate every time I do that?

Put in an entry for tip1200 or cu1200, but go ahead and use whatever bps rate is appropriate with the br capability. tip thinks a good default is 1200 bps which is why it looks for a tip1200 entry. You do not have to use 1200 bps, though.

14.5.7. I access a number of hosts through a terminal server.

Rather than waiting until you are connected and typing CONNECT <host> each time, use tip's cm capability. For example, these entries in /etc/remote:

    pain|pain.deep13.com|Forrester's machine:\
            :cm=CONNECT pain\n:tc=deep13:
    muffin|muffin.deep13.com|Frank's machine:\
            :cm=CONNECT muffin\n:tc=deep13:
    deep13:Gizmonics Institute terminal server:\
            :dv=/dev/cua02:br#38400:at=hayes:du:pa=none:pn=5551234:

will let you type tip pain or tip muffin to connect to the hosts pain or muffin; and tip deep13 to get to the terminal server.

14.5.8. Can tip try more than one line for each site?

This is often a problem where a university has several modem lines and several thousand students trying to use them...

Make an entry for your university in /etc/remote and use @ for the pn capability:

    big-university:\
            :pn=\@:tc=dialout
    dialout:\
            :dv=/dev/cuaa3:br#9600:at=courier:du:pa=none:

Then, list the phone numbers for the university in /etc/phones:

    big-university 5551111
    big-university 5551112
    big-university 5551113
    big-university 5551114

tip will try each one in the listed order, then give up. If you want to keep retrying, run tip in a while loop.

14.5.9. Why do I have to hit CTRL+P twice to send CTRL+P once?

CTRL+P is the default ``force'' character, used to tell tip that the next character is literal data. You can set the force character to any other character with the ~s escape, which means ``set a variable.''

Type ~sforce=single-char followed by a newline. single-char is any single character. If you leave out single-char, then the force character is the nul character, which you can get by typing CTRL+2 or CTRL+SPACE. A pretty good value for single-char is SHIFT+CTRL+6, which I have seen only used on some terminal servers.

You can have the force character be whatever you want by specifying the following in your $HOME/.tiprc file:

    force=<single-char>

14.5.10. Suddenly everything I type is in UPPER CASE??

You must have pressed CTRL+A, tip's ``raise character,'' specially designed for people with broken caps-lock keys. Use ~s as above and set the variable raisechar to something reasonable. In fact, you can set it to the same as the force character, if you never expect to use either of these features.

Here is a sample .tiprc file perfect for Emacs users who need to type CTRL+2 and CTRL+A a lot:

    force=^^
    raisechar=^^

The ^^ is SHIFT+CTRL+6.

14.5.11. How can I do file transfers with tip?

If you are talking to another UNIX system, you can send and receive files with ~p (put) and ~t (take). These commands run cat and echo on the remote system to accept and send files. The syntax is:

~p local-file [remote-file]

~t remote-file [local-file]

There is no error checking, so you probably should use another protocol, like zmodem.

14.5.12. How can I run zmodem with tip?

To receive files, start the sending program on the remote end. Then, type ~C rz to begin receiving them locally.

To send files, start the receiving program on the remote end. Then, type ~C sz files to send them to the remote system.

For questions about FreeBSD, e-mail <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.