📄 dialout.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Dial-out Service</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Serial Communications" href="serialcomms.html" /><link rel="PREVIOUS" title="Dial-in Service" href="dialup.html" /><link rel="NEXT" title="Setting Up the Serial Console" href="serialconsole-setup.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="dialup.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 20 Serial Communications</td><td width="10%" align="right" valign="bottom"><a href="serialconsole-setup.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="DIALOUT" name="DIALOUT">20.5 Dial-out Service</a></h1><p>The following are tips for getting your host to be able to connect over the modem toanother computer. This is appropriate for establishing a terminal session with a remotehost.</p><p>This is useful to log onto a BBS.</p><p>This kind of connection can be extremely helpful to get a file on the Internet if youhave problems with PPP. If you need to FTP something and PPP is broken, use the terminalsession to FTP it. Then use zmodem to transfer it to your machine.</p><div class="SECT2"><h2 class="SECT2"><a id="AEN29335" name="AEN29335">20.5.1 My Stock Hayes Modem Is NotSupported, What Can I Do?</a></h2><p>Actually, the manual page for <tt class="COMMAND">tip</tt> is out of date. There is ageneric Hayes dialer already built in. Just use <var class="LITERAL">at=hayes</var> inyour <tt class="FILENAME">/etc/remote</tt> file.</p><p>The Hayes driver is not smart enough to recognize some of the advanced features ofnewer modems--messages like <var class="LITERAL">BUSY</var>, <var class="LITERAL">NODIALTONE</var>, or <var class="LITERAL">CONNECT 115200</var> will just confuse it. Youshould turn those messages off when you use <tt class="COMMAND">tip</tt> (using <ttclass="COMMAND">ATX0&W</tt>).</p><p>Also, the dial timeout for <tt class="COMMAND">tip</tt> is 60 seconds. Your modemshould use something less, or else tip will think there is a communication problem. Try<tt class="COMMAND">ATS7=45&W</tt>.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> As shipped, <tt class="COMMAND">tip</tt> does not yet support Hayesmodems fully. The solution is to edit the file <tt class="FILENAME">tipconf.h</tt> in thedirectory <tt class="FILENAME">/usr/src/usr.bin/tip/tip</tt>. Obviously you need thesource distribution to do this.</p><p>Edit the line <var class="LITERAL">#define HAYES 0</var> to <varclass="LITERAL">#define HAYES 1</var>. Then <tt class="COMMAND">make</tt> and <ttclass="COMMAND">make install</tt>. Everything works nicely after that.</p></blockquote></div></div><div class="SECT2"><h2 class="SECT2"><a id="DIRECT-AT" name="DIRECT-AT">20.5.2 How Am I Expected to EnterThese AT Commands?</a></h2><p>Make what is called a ``direct'' entry in your <tt class="FILENAME">/etc/remote</tt>file. For example, if your modem is hooked up to the first serial port, <ttclass="FILENAME">/dev/cuaa0</tt>, then put in the following line:</p><pre class="PROGRAMLISTING">cuaa0:dv=/dev/cuaa0:br#19200:pa=none</pre><p>Use the highest bps rate your modem supports in the br capability. Then, type <ttclass="COMMAND">tip cuaa0</tt> and you will be connected to your modem.</p><p>If there is no <tt class="FILENAME">/dev/cuaa0</tt> on your system, do this:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /dev</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sh MAKEDEV cuaa0</kbd></pre><p>Or use <tt class="COMMAND">cu</tt> as <tt class="USERNAME">root</tt> with thefollowing command:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cu -l<varclass="REPLACEABLE">line</var> -s<var class="REPLACEABLE">speed</var></kbd></pre><p><var class="REPLACEABLE">line</var> is the serial port (e.g.<ttclass="FILENAME">/dev/cuaa0</tt>) and <var class="REPLACEABLE">speed</var> is the speed(e.g.<var class="LITERAL">57600</var>). When you are done entering the AT commands hit <bclass="KEYCAP">~.</b> to exit.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29393" name="AEN29393">20.5.3 The <varclass="LITERAL">@</var> Sign for the pn Capability Does Not Work!</a></h2><p>The <var class="LITERAL">@</var> sign in the phone number capability tells tip to lookin <tt class="FILENAME">/etc/phones</tt> for a phone number. But the <varclass="LITERAL">@</var> sign is also a special character in capability files like <ttclass="FILENAME">/etc/remote</tt>. Escape it with a backslash:</p><pre class="PROGRAMLISTING">pn=\@</pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29402" name="AEN29402">20.5.4 How Can I Dial a Phone Numberon the Command Line?</a></h2><p>Put what is called a ``generic'' entry in your <tt class="FILENAME">/etc/remote</tt>file. For example:</p><pre class="PROGRAMLISTING">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:</pre><p>Then you can do things like:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">tip -115200 5551234</kbd></pre><p>If you prefer <tt class="COMMAND">cu</tt> over <tt class="COMMAND">tip</tt>, use ageneric <var class="LITERAL">cu</var> entry:</p><pre class="PROGRAMLISTING">cu115200|Use cu to dial any number at 115200bps:\ :dv=/dev/cuaa1:br#57600:at=hayes:pa=none:du:</pre><p>and type:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cu 5551234 -s 115200</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29421" name="AEN29421">20.5.5 Do I Have to Type in the bpsRate Every Time I Do That?</a></h2><p>Put in an entry for <var class="LITERAL">tip1200</var> or <varclass="LITERAL">cu1200</var>, but go ahead and use whatever bps rate is appropriate withthe br capability. <tt class="COMMAND">tip</tt> thinks a good default is 1200 bpswhich is why it looks for a <var class="LITERAL">tip1200</var> entry. You do not have touse 1200 bps, though.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29428" name="AEN29428">20.5.6 I Access a Number of HostsThrough a Terminal Server</a></h2><p>Rather than waiting until you are connected and typing <tt class="COMMAND">CONNECT<host></tt> each time, use tip's <var class="LITERAL">cm</var> capability. Forexample, these entries in <tt class="FILENAME">/etc/remote</tt>:</p><pre class="PROGRAMLISTING">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/cuaa2:br#38400:at=hayes:du:pa=none:pn=5551234:</pre><p>will let you type <tt class="COMMAND">tip pain</tt> or <tt class="COMMAND">tipmuffin</tt> to connect to the hosts pain or muffin, and <tt class="COMMAND">tipdeep13</tt> to get to the terminal server.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29439" name="AEN29439">20.5.7 Can Tip Try More Than One Linefor Each Site?</a></h2><p>This is often a problem where a university has several modem lines and severalthousand students trying to use them.</p><p>Make an entry for your university in <tt class="FILENAME">/etc/remote</tt> and use<var class="LITERAL">@</var> for the <var class="LITERAL">pn</var> capability:</p><pre class="PROGRAMLISTING">big-university:\ :pn=\@:tc=dialoutdialout:\ :dv=/dev/cuaa3:br#9600:at=courier:du:pa=none:</pre><p>Then, list the phone numbers for the university in <ttclass="FILENAME">/etc/phones</tt>:</p><pre class="PROGRAMLISTING">big-university 5551111big-university 5551112big-university 5551113big-university 5551114</pre><p><tt class="COMMAND">tip</tt> will try each one in the listed order, then give up. Ifyou want to keep retrying, run <tt class="COMMAND">tip</tt> in a while loop.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29453" name="AEN29453">20.5.8 Why Do I Have to Hit <bclass="KEYCAP">Ctrl</b>+<b class="KEYCAP">P</b> Twice to Send <bclass="KEYCAP">Ctrl</b>+<b class="KEYCAP">P</b> Once?</a></h2><p><b class="KEYCAP">Ctrl</b>+<b class="KEYCAP">P</b> is the default ``force'' character,used to tell <tt class="COMMAND">tip</tt> that the next character is literal data. Youcan set the force character to any other character with the <tt class="COMMAND">~s</tt>escape, which means ``set a variable.''</p><p>Type <tt class="COMMAND">~sforce=<var class="REPLACEABLE">single-char</var></tt>followed by a newline. <var class="REPLACEABLE">single-char</var> is any singlecharacter. If you leave out <var class="REPLACEABLE">single-char</var>, then the forcecharacter is the nul character, which you can get by typing <b class="KEYCAP">Ctrl</b>+<bclass="KEYCAP">2</b> or <b class="KEYCAP">Ctrl</b>+<b class="KEYCAP">Space</b>. A prettygood value for <var class="REPLACEABLE">single-char</var> is <bclass="KEYCAP">Shift</b>+<b class="KEYCAP">Ctrl</b>+<b class="KEYCAP">6</b>, which isonly used on some terminal servers.</p><p>You can have the force character be whatever you want by specifying the following inyour <tt class="FILENAME">$HOME/.tiprc</tt> file:</p><pre class="PROGRAMLISTING">force=<single-char></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29488" name="AEN29488">20.5.9 Suddenly Everything I Type Isin Upper Case??</a></h2><p>You must have pressed <b class="KEYCAP">Ctrl</b>+<b class="KEYCAP">A</b>, <ttclass="COMMAND">tip</tt>'s ``raise character,'' specially designed for people with brokencaps-lock keys. Use <tt class="COMMAND">~s</tt> as above and set the variable <varclass="LITERAL">raisechar</var> to something reasonable. In fact, you can set it to thesame as the force character, if you never expect to use either of these features.</p><p>Here is a sample .tiprc file perfect for <b class="APPLICATION">Emacs</b> users whoneed to type <b class="KEYCAP">Ctrl</b>+<b class="KEYCAP">2</b> and <bclass="KEYCAP">Ctrl</b>+<b class="KEYCAP">A</b> a lot:</p><pre class="PROGRAMLISTING">force=^^raisechar=^^</pre><p>The ^^ is <b class="KEYCAP">Shift</b>+<b class="KEYCAP">Ctrl</b>+<bclass="KEYCAP">6</b>.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29512" name="AEN29512">20.5.10 How Can I Do File Transferswith <tt class="COMMAND">tip</tt>?</a></h2><p>If you are talking to another <span class="TRADEMARK">UNIX</span>® system, you cansend and receive files with <tt class="COMMAND">~p</tt> (put) and <ttclass="COMMAND">~t</tt> (take). These commands run <tt class="COMMAND">cat</tt> and <ttclass="COMMAND">echo</tt> on the remote system to accept and send files. The syntaxis:</p><p><tt class="COMMAND">~p</tt> local-file [remote-file]</p><p><tt class="COMMAND">~t</tt> remote-file [local-file]</p><p>There is no error checking, so you probably should use another protocol, likezmodem.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN29530" name="AEN29530">20.5.11 How Can I Run zmodem with <ttclass="COMMAND">tip</tt>?</a></h2><p>To receive files, start the sending program on the remote end. Then, type <ttclass="COMMAND">~C rz</tt> to begin receiving them locally.</p><p>To send files, start the receiving program on the remote end. Then, type <ttclass="COMMAND">~C sz <var class="REPLACEABLE">files</var></tt> to send them to theremote system.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="dialup.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="serialconsole-setup.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Dial-in Service</td><td width="34%" align="center" valign="top"><a href="serialcomms.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Setting Up the Serial Console</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -