⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0139-0144.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:






<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Connecting to the Outside World:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=09 //-->

<!-- PAGES=0139-0160 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->











<P><CENTER>

<a href="../ch08/0135-0138.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0145-0148.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-139"><P>Page 139</P></A>



<H3><A NAME="ch09_ 1">

PART<BR>

III

</A></H3>



<H2>



Connecting to the<BR>

Outside World



</H2>







<OL START="9">

<LI>          Using Communications Programs

<P>

<LI>          Connecting to the Internet

</P>

<LI>          Configuring Internet Email

<P>

<LI>          Configuring Internet News

</P>

<LI>          Internet Downloading and Browsing



</OL>







<A NAME="PAGENUM-140"><P>Page 140</P></A>









<A NAME="PAGENUM-141"><P>Page 141</P></A>







<H3><A NAME="ch09_ 4">

Hour 9

</A></H3>



<H2>

<A NAME="ch09_ 5">

Using Communications<BR>

Programs

</A>

</H2>



<P>In this hour, you'll learn about communicating with the outside world by

using programs installed from this book's CD-ROM. You'll learn how to set up

your serial port or modem, configure and use two communication programs,

and send and receive faxes with Linux.

</P>



<P>Although your CD-ROM contains all the software you'll need to run

Linux communications programs, you'll need a serial communications port

and modem to dial out with your Linux system. I assume that you're familiar

with modems; communication terms such as baud rate, parity, or stop bits;

and how to connect your modem to your computer.

</P>





<A NAME="PAGENUM-142"><P>Page 142</P></A>







<H3><A NAME="ch09_ 6">

Setting Up and Testing Your Modem

</A></H3>



<P>Your first task is to find your spare serial port. You should be able to find the port on

the back of your computer, and it will most likely have 9 or 25 pins. If you're using a

laptop, you may have a 9-pin male serial port, an RJ-11 telephone jack for an internal modem,

or a PCMCIA modem card with an RJ-11 telephone jack.

</P>



<P>You'll find your serial port in Linux by looking in the

device or /dev directory. Many devices are defined there, such as hard drives, floppies, and printers, but you should look

for devices of type cua or tty&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

# ls /dev/cua* /dev/ttyS*

/dev/cua0   /dev/cua2   /dev/ttyS0  /dev/ttyS2

/dev/cua1   /dev/cua3   /dev/ttyS1  /dev/ttyS

</PRE>

<!-- END CODE SNIP //-->



<P>These devices correspond to the traditionally defined DOS serial ports, as shown in

Table 9.1.

</P>



<P>Table 9.1. DOS and Linux serial ports.

</P><BR>



<TABLE>



<TR><TD>

DOS Port

</TD><TD>

Linux Device



</TD></TR><TR><TD>

COM1

</TD><TD>

/dev/cua0, /dev/ttyS0



</TD></TR><TR><TD>

COM2

</TD><TD>

/dev/cua1, /dev/ttyS1



</TD></TR><TR><TD>

COM3

</TD><TD>

/dev/cua2, /dev/ttyS2



</TD></TR><TR><TD>

COM4

</TD><TD>

/dev/cua3, /dev/ttyS3



</TD></TR></TABLE>



<P>If you have a laptop with a PCMCIA modem card, you won't be able to use your

modem (or any other PCMCIA devices) until you enable those services and tell Linux to look

for PCMCIA devices when it starts. To enable your PC card modem, make sure that

you're logged in as the root operator and edit the file named

pcmcia in the /etc/sysconfig directory, to look like the following:

</P>



<!-- CODE SNIP //-->

<PRE>	

PCMCIA=yes

PCIC=i82365

PCIC_OPTS=

CORE_OPTS=

</PRE>

<!-- END CODE SNIP //-->



<P>This tells Linux to install PCMCIA services. Save the file, and then reboot Linux.

Your PC card modem (and other PC cards, if installed) should be recognized during the reboot.

</P>







<A NAME="PAGENUM-143"><P>Page 143</P></A>









<TABLE BGCOLOR=#FFFF99>

<TR><TD>JUST A MINUTE</TD></TR>

<TR><TD>

<BLOCKQUOTE>

If you have trouble with PCMCIA devices, read David Hinds'

PCMCIA-HOWTO, which you'll find under the /usr/doc directory. If you want the

latest information, you can also browse to<BR>

<!-- CODE SNIP //-->

<PRE>

          <a href="http://hyper.stanford.edu/hypernews/get/pcmcia/home.html">

http://hyper.stanford.edu/HyperNews/get/pcmcia/home.html</A>

</PRE>

<!-- END CODE SNIP //-->

If you have trouble with setting up your serial ports, read Greg Hankins'

Serial-HOWTO, also under the /usr/doc directory. You'll find a complete discussion

on setting up your serial ports and troubleshooting installation.

</BLOCKQUOTE>

</TD></TR>

</TABLE>



<P>You can check to make sure that your serial ports are enabled by checking portions of

the Linux startup message, dmesg, which is found under the

/var/log directory. You can use the dmesg command,

found under the /bin directory, to read this startup log&#151;for example,

</P>



<!-- CODE //-->

<PRE>

# dmesg

...

Serial driver version 4.13 with no serial options enabled

tty00 at 0x03f8 (irq = 4) is a 16550A

tty03 at 0x02e8 (irq = 3) is a 16550A

...

</PRE>

<!-- END CODE //-->



<P>A portion of the dmesg file is reproduced here, so you can see what to look for. If you

don't see a serial driver, or serial port listing, you must make sure that serial-line support

is enabled for your Linux kernel.

</P>



<P>To test your modem, make sure that you're running as the root operator, make sure

that your modem is on and connected, and then try

</P>



<!-- CODE SNIP //-->

<PRE>

# echo &quot;ATDTXXX-XXXX/n&quot; &gt;/dev/cuaN

</PRE>

<!-- END CODE SNIP //-->



<P>The number represented as XXX-XXXX is your phone number; N is the serial port

you want to test. Wait at least 30 seconds or so and you should hear a dial tone, followed

by the dialing, and then a busy signal. This can also be a handy way, when you have

your modem working, to get the current time (albeit spoken in the tinny voice of your

modem's speaker). Just insert the phone number for your local phone company's time-of-day

service, save the command line in a file, and make it executable. Here's an example:

</P>



<!-- CODE SNIP //-->

<PRE>

# cat &gt; dotime

echo &quot;ATDT373-0660/n&quot; &gt;/dev/cua1

# chmod +x dotime

# ./dotime

</PRE>

<!-- END CODE SNIP //-->



<P>This creates the file with the cat command (after you type the command line, press Ctrl

and the D key to save it). The chmod command then makes the file executable so you can

run it with the final command line. If you want to test your modem interactively, you can

try the minicom program discussed in the section &quot;Dialing Out with

Communications 

</P>





<A NAME="PAGENUM-144"><P>Page 144</P></A>





<P>Programs.&quot;</P>



<H4><A NAME="ch09_ 7">

Creating /dev/modem with the modemtool Command

</A></H4>



<P>You can also use the Red Hat X11 control-panel client to set up your modem. Make

sure that you're running as the root operator, and then run the control-panel client. When

you click the modemtool command in the control panel, the program

modemtool, found under the /usr/bin/ directory, will run and present a list of serial ports. Select one, and then click OK.

</P>



<P>This program makes a symbolic link (discussed in Hour 5, &quot;Manipulation and

Searching Commands&quot;) from the selected device to a file called

/dev/modem. You can do the same thing from the command line by using the

ln command to create the symbolic link yourself.

For example, if you have your modem connected to COM2, make sure that you're running

as root, and enter

</P>



<!-- CODE SNIP //-->

<PRE>

# ln -s /dev/cua1 /dev/modem

</PRE>

<!-- END CODE SNIP //-->



<P>This will create a symbolic link, /dev/modem, which points to the serial port connected to

your modem.

</P>



<H3><A NAME="ch09_ 8">

Dialing Out with Communications Programs

</A></H3>



<P>This section covers two communications programs that come with your Linux

distribution: minicom and seyon. The minicom program can be used with or without running X11.

The seyon program must be used while you're running the X Window System.

</P>



<P>You'll also find an old communications program, called

cu, under the /usr/bin directory. This program isn't as friendly as

minicom or seyon, but if you're interested in setting up and

trying this program, read the cu man page, and definitely read the

uucp software documentation under the /usr/doc directory.

</P>



<H4><A NAME="ch09_ 9">

Setting Up and Calling Out with minicom

</A></H4>



<P>The minicom program, by Miquel van Smoorenburg and located under the

/usr/bin directory, is a friendly communication program you can use to dial out and connect with

other computers or BBSs. You can use minicom without running X11, but if you're running

X11, you should use the xminicom script, also located under the

/usr/bin directory.

</P>



<P>The first time you use minicom, make sure that you're running as the root operator so

you can set up and save minicom's default file,

minirc.dfl, which will be created and saved in the <BR>

/etc directory. Assuming that you're using X11, you can start

minicom with

</P>



<!-- CODE SNIP //-->

<PRE>

# xminicom &amp;

</PRE>

<!-- END CODE SNIP //-->



<P><CENTER>

<a href="../ch08/0135-0138.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0145-0148.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -