Linux Administration Guide Bg

624
1 LINUX РЪКОВОДСТВО НА МРЕЖОВИЯ АДМИНИСТРАТОР ОЛАФ КИРХ , Т ЕР И ДОУСЪН

Transcript of Linux Administration Guide Bg

LINUX ,

1

Linux Network Administrators Guide, Second Editio nby Olaf Kirch and Terry Dawson SoftPress Ltd. 2001. Authorized translation of the English edition 2000 O'Reilly & Associates, Inc. This translation is published and sold by the permission of O'Reilly & Associates, Inc., the owner of all rights to publish and sell the same. Copyright 1993 Olaf Kirch. Copyright 2000 Terry Dawson. Copyright on O'Reilly printed version 2000 O'Reilly & Associates, Inc. Rights to copy the SoftPress printed version are reserved. The online version of this book, which at time of printing contains exactly the same text as the SoftPress printed version, is available under the GNU FDL. Rights to reprint the document under the FDL include the right to print and distribute printed copies of the online version. Appendix C contains a copy of the license. You can find the online copy of the license at http://www.soft-press.com/linux/index.html. The book is available online at http://www.soft-press.com/linux/index.html and may be reposted by others at other locations.

Linux , 2001 ISBN 954-685-146-9 : : , : - : , , , , 2001 . :: 1 40 7, .. 114 .: (02) 9 58 25 8 0, 95 8 25 67; : ( 02) 5 8 62 04 e-m ail: clie nts@s oft-press.c om; Web site: ww w.soft-pr ess.com

: . 19; .: 02/ 97 3 1 5 06; e- mail: i lie v@soft- press.c om . 13 9, 1 04; .: 03 2/ 62 7 5 62; ./ : 0 32/ 6 2 2 7 47; e- mail: pl ov div@ soft-pr ess.com . 4; .: 05 6/ 80 0 2 31; : 05 6/ 80 3 1 3 9; e-m ail: burg as@ soft-pr ess.com . 11 7; .: 04 2/ 60 2 7 75; e- mail: stza gor a@s oft-pres s.com . . 9, . , . 2, . 11; .: 05 2/ 30 4 2 69; e- mail: var na @soft-pr ess.c om

__________________________________ 19 .......................... 21 ....................................................... 21 , FTP....................................... 23 , WWW .................................. 23 ................................................. 24 Linux Journal Linux Magazine ............................................ 25 Usenet Linux ........................................................... 25 Linux ................................................. 26 Linux ...................................... 27 Linux............................................ 27 Linux .................................................... 28 ............................................ 29 Linu x ......................................................... 30 .................................................................................... 31 .................................................. 33 ....................................................... 34 , .......................................... 37 ............................................................. 38 ............................................................................ 39 ....................................................................... 40

1 ________________ 41 ....................................................................................... 41 TCP/IP ............................................................................. 423

TCP/IP ............................................... 43 Ethernet ...................................................................... 45 ........................................................... 47 IP....................................................................... 50 IP .......................................................... 52 TCP ................................................................... 52 UDP................................................................... 54 .................................................................. 54 ............................................................ 55 UUCP .............................................................................. 56 Linux......................................................... 57 ................................................ 58 ......................................................... 59 ........................................................ 60 ....................................................... 61

2

T CP/IP __________ 65

................................................................ 65 IP .................................................................................... 66 ............................................................. 69 IP ...................................................................... 70 IP ................................................................................ 70 ............................................................................. 71 ............................................................................... 72 ................................................. 74 ............................................................ 76 ICMP ...................................................................... 77 .......................................... 78

4

3 __________ 81

........................................................ 85 Linux 2.0 - ........... 86 Linux 2.0.0 - ................................................... 90 Linux ......................... 93 Ethernet............................................................ 95 Ethernet ..................... 96 PLIP .............................................................................. 99 PPP SLIP ............................................................... 102 ................................................................ 102

4

_________ 103

............... 104 ............................... 105 ......................................... 106 ................... 108 ........................................................................ 109 .............. 111 setserial.............................................................. 111 stty ..................................................................... 114 ............................................................ 116 mgetty ...................................... 117

5 T CP/IP

_____________ 121

/proc............................... 122 ..................................... 1235

......................................................... 123 IP ............................................................. 124 .......................................................... 126 hosts networ ks ............................ 126 IP...................................... 128 Loopback....................................................... 129 Ethernet ............................................................ 131 .............................................. 134 .................................................... 135 PLIP .............................................................. 136 SLIP PPP .................................................. 137 ....................................................... 138 IP ..................................................................... 138 ifconfig..................................................................... 139 netstat...................................................................... 143 .............................. 143 ............................ 145 ....................................................... 146 ARP ............................................ 147

6 _________________________________ 149

........................................................... 150 host.conf ................................................................. 150 nsswitch.conf .......................................................... 153 resolv.conf .................................................................. 156 .................................................. 158 DN S....................................................................... 159 DNS..................................................... 162 .................................................... 1636

DNS.......................................................... 164 ................................................................. 166 named .............................................................. 168 named.boot.............................................................. 169 host.conf BIND 8 ............................................... 172 DNS......................................... 174 named ....................... 179 ............................................. 180 ........... 183 ............................................... 186

7IP _______________________ 187 ..................................................................... 188 SLIP ....................................................................... 188 IP ....................................................... 191 dip..................................................................... 192 ................................................................ 193 dip............................................................... 195 ....................................................... 199

8 PPP ___________________________ 203PPP Linux ........................................................................... 205 pppd.................................................................. 206 ............................................ 208 chat ...... 209 IP.............................................. 212 IP ........................................................ 213 PPP ..................................... 214 ......................................... 217 ..................................... 2197

PPP............................ 221 PAP CHAP ............................................................... 221 CHA ............................................................ 223 PAP ............................................................... 224 ...................................... 226 - .................................. 226 PPP .......................................................................... 226 ......................................................... 229 ........................................................... 231

9T CP/IP ______________________ 233 ....................................................................... 234 ?................................. 236 IP ?................................. 238 Linu x ..................... 240 , IP ........................ 240 ipfwadm....................................................... 241 ipchains........................................................ 242 iptables ........................................................ 242 , .................. 242 IP ( 2.0) ................. 244 ipfwadm....................................................... 244 - ..................................................... 248 ipfwadm.................................. 250 IP ( 2.2).............................. 254 ipchains ....................................................... 255 ipchains ....................................... 256 ........................... 260 ipchains ..................................... 261 ................................. 262 IP ( 2.4) .......................... 2698

ipfwadm ipchains ..................... 272 iptables ........................................................ 273 ........... 279 TOS................................................ 280 TOS ipfwadm ipchains ............ 281 TOS iptables .................................. 282 ............. 283 ........................ 286

10IP ___________________________ 295 IP .................... 296 IP ..................................... 296 ....................................................... 297 ........................................ 299 ICMP ..................................... 302 ................................................. 304 IP .................. 304 ipfwadm....................... 305 ipchains........................ 305 iptables ........................ 306 ............................................................. 306 ......................................... 307 .............................. 308

11IP ____________________________________ 309 ........................... 312 IP ......................... 313 IP ........................................... 314 IP ............... 3179

..................... 318 .......................... 318

12 _______________ 321 inetd............................................................... 321 tcpd .................... 325 ..................................... 327 ................................... 329 ........................................................... 331 r- ............................................... 332 ssh................................ 333

13 ___________ 341 NIS.................................................................... 343 NIS NIS+ ....................................................................... 347 NIS.................................................... 347 NIS ...................................................... 348 NI S ...................................................... 349 NIS GNU libc ................................... 351 .................................................... 353 passwd gro up................................. 356 NIS ............ 359

14 __________________ 361 N FS.................................................................. 363 NFS ........................................................... 364 NFS ........................................................................... 36710

exports.......................................................................... 368 NFSv2 .............. 371 NFSv3 .............. 372

15IPX NCP _______________ 373Xerox, Novell .......................................................... 374 IPX Linux................................................................................ 375 Caldera......................................................... 376 NDS......................................... 376 IPX N CPFS......................... 377 IPX ...................................... 377 , IPX ............................ 378 IPX ........... 378 ipx_configure..................................................... 378 ipx_interface...................................................... 380 IPX ............................... 381 IPX ipx_route ....................................................... 383 IPX .......................... 384 NetWare ........................... 386 ncpmount................................. 387 - ncpmount................................. 388 NetWare................. 390 - ncpmount........................................... 390 IPX ..... 391 .......................................................... 391 NetWare .......... 392 bindary ......... 392 NetWare ......................................... 393 nprint lpd .......................... 394 ..................................... 396 NtWare ................................................ 39711

16 T AYLOR UUCP ________________ 399UUCP .................... 401 uucico................................. 403 uucico .................................... 404 UU CP .................................. 405 Tay lor UUCP .............................. 406 UUCP................................................ 409 ........................................................ 410 Tay lor ................................ 411 , config.................................................... 413 UUCP , sy s ......................................................... 413 port .................................................................... 419 dial.......... 421 UUCP TCP .................................................................. 422 .......................................... 423 UU CP.... 424 ..................................................... 424 .................................................... 425 ........................................................................ 426 ...................... 427 UUCP ........................................ 427 ....................................... 429 : ........................................................................... 429 UUCP................................................................. 431 UUCP ............................................ 431 ..................................................... 432 ............................ 433 ................................. 43412

......................................................... 435 uucico Wrong Time to Call............. 435 uucico , .................... 436 , chat- ....................................... 436 ........................................................ 436 , ... 437 , ................................................................................ 437 .................................... 437

17

__________________________ 441

?.............................................. 443 ?.......................................................... 446 E-mail ............................................................................ 447 RFC-822 ..................................................................................... 448 .................................................... 448 .............................. 449 ?......................... 450 ........................... 450 UU CP ............................ 452 UUCP RFC-822............................................... 453 elm............................................................ 458 elm........................................................... 458 .................................................. 459

18S ENDMAIL __________________________________ 461 sen dmail.............................................................. 461 sendmail........................................................ 46213

............................ 463 sendmail.cf sendmail.mc ................................... 463 sendmail.mc ...................................... 464 sendmail.mc .................. 465 sen dmail.cf .......................................... 470 ...................................................................... 471 R S sendmail.cf.............................................. 471 ...................................... 472 ...................................................................... 472 .................................................................... 473 ................................ 474 .................................... 475 sendmail.............................. 478 sen dmail.......................... 480 From:.... 480 ............................... 481 ...................................... 482 (SPAM) .................................................... 484 e-mail .................... 488 ........................................ 491 sendmail........................................................... 495 ..................................................................... 496 ....................................... 496 ................................................................ 497 aa a............................ 498

19 E XIM _____________ 501 Exim................................................................. 50214

........................... 504 Ex im............................................................. 505 ................................................ 506 ............................................ 508 ...................... 508 ......................................... 510 ..................... 510 ...................................................... 513 ............................................................. 514 .......................... 515 UUCP ............................................................ 516

20 _________________________ 519 Usenet.................................................................... 519 Usenet?................................ 521 Usenet ?........................................... 523

21 __________________________________ 527

............................................................... 528 ............................................................................. 530 sy s................................................................................. 533 active ............................................................................ 537 ............................................................. 539 ............................................. 542 .......................................................................... 546 ........................................................ 548 cancel............................................................ 548 newgroup rmgroup ............................................................ 548 checkgroups .................................................. 54915

sendsy s, version senduuname............................................. 550 News NFS ................................................................. 551 .................................... 552

22NNT P NNT PD _______________________ 555 NNTP ................................................................... 557 ...................................... 558 ............................ 559 NNRP ......................... 560 ........................ 561 .......................... 561 ....................................................... 562 .............................. 562 .............................................. 563 ...................... 563 ........................... 564 .................................. 564 ............................................ 565 NNTP ............................................. 566 NNTP ...................................... 566 NNTP .......................... 568 nntpd NEW S................................ 569

23 __________________________ 571 INN.................................. 571 INN .............................................................................. 575 INN................................................................ 575 INN: ...................... 576 INN ...................................... 577 ........................................................... 57716

............................... 579 .......................... 582 ........................................ 587 ............................... 590 ................................. 592 INN .................................................................. 596 INN: ctlinnd................................. 597 ...................................................... 598 ............................................................... 598 .......................................................... 598 .............................................. 599 / .................................... 599 .................. 599 ................. 600 ....................................... 600 ..................................... 600 ................... 601 .................................. 601 .................................................... 602 ................................................................ 602

24

__________ 603

tin .............................................................. 604 trn.............................................................. 605 nn .............................................................. 606

A : _____________________ 609 ................. 610

17

_____________ 611 PLIP........................................................ 611 n ull- ........................................................ 611

L INUX , . ____________ 6130. Preamble .............................................................................. 614 1. Applicability and Definitions .............................................. 614 2. Verbatim Copy ing................................................................ 616 3. Copy ing in Quantity ............................................................ 616 4. Mod ifications........................................................................ 617 5. Combin ing Documents ........................................................ 619 6. Collections of Documents ................................................... 619 7. Aggregation w ith .................................................................................................... 620 9. Termination .......................................................................... 620 10. Fu ture Revis ions of this License ........................................ 621

___________________________ 623

18

. , . . Usenet, Web, . , . , , . . , , Usenet ISDN , , DSL (Digital Subscriber Line ) , . , Unix. , Unix , , .19

, Unix , Unix- PC, 386BSD, FreeBSD Linux. Linux Unix . , Intel, Motorola 6800 Comodore Amiga Apple Macintosh; Sun SPARC Ultra-SPARC ; Alpha Compaq; MIPS; PowerPC, Apple Macintosh StrongArm Netwinder rebel.com Palm 3Com. Linux Fujitsu AP-100 Sy stem 390 IBM. , - Linux . Linux , . 1990 . . Linux Unix, , , , web- , . Linux TCP/IP , SLIP, PPP . , Linux IPX, , . Linux , . Linux General Public License GNU; , , Free Software Foundation. ( ), . free software , , .

20

Linux . , , Linux . , , , . . , Linux, , Unix, , Linux , . , , , - ( Linux , Linux, ). , , .

Linux, . , . LDP Linux (LDP - Linux Documentation Project) , , , HOWTO , Linux . LDP :

21

Linux Installation and Getting Started . , Linux. Unix , X Window . Linux System Administrators Guide Lars Wirzenius Joanna Oja. Linux , , . Linux System Administration Made Easy Steve Frampton. , Linux. Linux Programmers Guide B. Scott Burkett, Sven Goldt, John D. Harper, Sven van der Meer . , , Linux. The Linux Kernel David Rusling. Linux . . The Linux Kernel Module Programming Guide Ori Pomerantz. Linux. . LDP WWW http:// ww.linuxdoc.org . HOWTO HOWTO (. ... ..) Linux , 22

, X Window Linux. HOWTO FTP , -, Web LDP. HOWTO-INDEX HOWTO . Installation HOWTO, Linux ; Hardware Compatibility HOWTO, , , Linux Distributions HOWTO, , Linux CD-ROM. HOTWO, Linux. Linux Frequently Asked Questions FAQ ( Frequently Asked Questions with Answers ) . Linux.

, F TP FTP , - Linux , metalab.unc.edu: /pub/Linux/docs tsx-11.mit.edu:/pub/linux/docs. .

, WW W Web Linux. LDP http://www.linuxdoc.org/. OSWG (Open Source Writes Guild ) , Linux. OSWG, , . OSWG http://www.oswg.org.8080/oswg.

23

Linux .

LDP. : Specialized Sy stems Consultants, Inc. (SSC) http://www.ssc.com/ P.O.Box 55549 Seattle, WA 98155-0549 1-206-782-7733 1-206-782-7191 (FAX) [email protected] : Linux Sy stems Labs http://www.lsl.com/ 18300 Tara Drive Clinton Township, MI 48036 1-810-987-8807 1-810-987-3562 (FAX) [email protected] HOWTO, Linux. O'Reilly & Associates Linux. LDP, . : Running Linux1 , Linux.

1

Linux ..

24

Learning Debian GNU/Linux Learning Red Hat Linux - Running Linux , CD-ROM . Linux in a Nutshell in a Nutshell (). Linux.

Linux Journal Linux Magazin eLinux Journal Linux Magazine Linux , Linux . , . Usenet, Linux . Linux Journal - S.S.C. Incorporated, - . Web http://www.linuxjournal.com/ Linux Magazine -, . Web- http://www.linuxmagazine.com/

Us en et Linux Usenet, Linux : comp.os.linux.announce , , , Linux . Linux . [email protected]. comp.os.linux.help Linux.25

comp.os.linux.admin , Linux. comp.os.linux.networking , Linux. comp.os.linux.development Linux . comp.os.linux.misc , . , Linux, , , fr.comp.os.linux de.comp.os.linux .

Linu x Linux, , . - , Rutgers University . e-mail, :To: [email protected] Subject: anything at all Body: subscribe listname

, Linux, : linux-net , Linux. linux-ppp , Linux PPP linux-kernel , Linux.26

Linu x . , . OpenProjects IRC Network IRC , . Linux. IRC Internet Relay Chat (, ) , . IRC , . , , . IRC OpenProjects, 24 7 , Linux , , . IRC , irc-II , irc.openprojects.org:6667 #linpeople.

Linu x Linux . , , . Linux Linux . . - :

27

Groups of Linux Users Everywher http://www.ssc.com/glue/groups/ LUG list project http://www.nllgg.nl/lugww/ LUG registry http://wwwlinux.org/users/

Linux Linux; , Debian, RedHat, Caldera, Corel, SuSE Slackware. , , Linux : , , , . Linux , . FTP web-. : Caldera http://www.caldera.com/ftp://ftp.caldera.com/ Corel http://www.corel.com/ftp://ftp.corel.com/ Debian http://www.debian.org/ftp://ftp.debian.org/ RedHat http://www.redhat.com/ftp://ftp.redhat.com/ Slackware http://www.slackware.com/ftp://ftp.slackware.com/ SuS http://www.suse.com/ftp://ftp.suse.com/ FTP Linux. - :28

metalab.unc.edu:/pub/Linux/distributions/ ftp.funet.fi:/pub/Linux/mirrors/ tsx-11.mit.edu:/pub/linux/distributions/ mirror.aarnet.edu.au:/pub/linux/distributions/ . , , 2 . Linux CD-ROM . , . CD-ROM. , CD-ROM-, Linux. , - .

, Linux, , Linux, . . 1993 . Linux (FSSTND File Sy stem Standard Group). , - . Linux. , 2

... , 24- , , - 72- , - !

29

FSSTND, , . , , , . , , . FSSTND Linux , 1997 . FHS (File Hierarchy Standard ). FHS , , FSSTND. FHS FTP Linux http:// www. pathname.com/fhs/. Daniel Quinlan, FHS, [email protected].

Linux Linux, , - . , , . , , , . () , Linux. , Linux (LSB Linux Standard Base). , . , Linux. LSB web- http://www.linuxbase.org/.

30

, , , Linux .

Linux (LDP) 1992 ., UUCP smail, Sy stem Administrators Guide. TCP/IP - , . ! ! . , Linux, 1993 . - . sendmail, sendmail. , , e O'Reilly & Associates * . - 20 , 15 . NET-FAQ, HOWTO-. , Linux , , . exim Philip Hasel, .

*

[email protected]. Philip Hazel [email protected].

31

, , . TCP/IP . TCP/IP , rlogin , (NFS) (NIS). , UUCP . , TCP/IP UUCP: . IPX NCP , , Linux . , . exim, , , UUCP, sendmail, , - , UUCP. , Usenet news. INN C News, - NNTP . - Linux. , , . , , , . ( , - ), . , . , , . , 32

FTP Linux BBS . , . , Linux .

1993 . , LDP , O'Reilly & Associates. , , . O'Reilly , , . , : - LDP O'Reilly . , ? Tim O'Reilly , , , ? ? , , . O'Reilly & Associates , ( ). , , , . , , O'Reilly Linux (, ) , Linux , : . , Linux O'Reilly . O'Reilly ? . , , , Linux. , O'Reilly .33

LDP , . , . O'Reilly , . , , , . , ? , , . ( , , LDP, Linux ). , . , . , . , , . , . , O'Reilly . , , - . , O'Reilly . , , , -. , .

1, , Linux UUCP, TCP/IP, , . Linux TCP/IP34

. - IP 2, TCP/IP , . IP , . 3, , Ethernet . 4, , TCP/IP , UUCP. 5, TCP/IP , TCP/IP. , Ethernet , loopback . , , . 6, , - . 7, IP , SLIP dip, , . 8, PPP, PPP pppd. 9, TCP/IP, TCP/IP Linux : ipfwadm, ipchains iptables. , IP, . 10, IP , IP Linux, , , . 11. IP , Linux, IP , IP - , .35

12, , - rlogin, ssh . - inetd , . 13, 14, , NIS NFS. NIS , ( ). NFS . 15, IPX NCP, IPX NCP. Linux , Novell NetWare, -Linux . 16, Taylor UUCP Tay lor UUCP, UUCP. Usenet. 17, , , , . 18, Sendmail, 19, exim sendmail exim, , Linux. , exim - , sendmail UUCP. 20, Netnews 23, , , Usenet C News, nntpd INN Usenet. 20, 21, C News, C News , UUCP. - C News, NNTP (Network News Transfer Protocol ). 22, NNTP nntpd 36

,

NNTP nntpd, . 23 INN (InterNet News). 24, , .

, , , , sh (shell, , ). bash sh Linux. csh, . , : , , , , email , URLs . , , , , .

, , , .

, , . , .

37

, , . , .

, , ( , !). , , , : O'Reilly & Assosites, Inc. 101 Morris Street Sebastopol, Ca 95472 1-800-998-9938 ( U.S. Canada) 1-707-829-0515 ( ) 1-707-829-0104 (FAX) . , e-mail : [email protected] , e-mail : [email protected] OReilly web- , , . : http://www.oreilly.com/catalog/linag2 O'Reilly : http://www.oreilly.com

38

. , , . , , . , , ( , ). Phil Hughes, John MacDonalds Eric Ratcliffe ( , ) . , O'Reilly , : Sarah Jane Shangrow, , ; Maureen Dempsey, ; Rob Romano, Rhon Porter Chris Railly , ; Hana Day er, ; Alisa Cech, David Futato Jennifer Niedherst ; ; Judy Hoer ; , Tim O'Reilly . Andre Sepulveda, Wolfgang Michaelis, Michael K. Johnson , , . Phil Hughes, John MacDonalds Eric Ratcliffe . , , . Thanks . , Holger Grothe, , . , Linux : Linux Support Team, Erlangen, ; S.u.S.E. GmbH, Fuerth, Linux39

Sy stem Labs, Inc., Clinton Twp., RedHat Software, , . , , , , . , Linux , , . , .

, , . . , . Al Longyear, Alan Cox, Andres Seplveda, Ben Cooper, Cameron Spitzer, Colin McCormack, D.J. Roberts, Emilio Lopes, Fred N. van Kempen, Gert Doering, Greg Hankins, Heiko Eissfeldt, J.P. Szikora, Johannes Stille, Karl Eichwalder, Les Johnson, Ludger Kunz, Marc van Diest, Michael K. Johnson, Michael Nebel, Michael Wing, Mitch D'Souza, Paul Gortmaker, Peter Brouwer, Peter Eriksson, Phil Hughes, Raul Deluth Miller, Rich Braun, Rick Sladkey , Ronald Aarts, Swen Themmler, Terry Dawson, Thomas Quinot Yury Shevchuk.

40

1

, . , , . , , , . , , , . ? : 1) , 2) - 3) , A B . . , . , , , , , , *. , , .

*

( -) .

41

1:

. - TCP/IP, - , , . UUCP IPX. UUCP . - , . IPX - , Novell NetWare, Linux Netware. -. , . , . , . , ; - . . . . , - , , , . , , , .

TCP/IP . Linux , , , , , . , , ( packet switching). , . , 42

TCP/IP

. , . , Unix-, , TCP/IP. TCP/IP , , , . , TCP/IP .

TCP/IP TCP/IP (Defense Advanced Research Project Agency DARPA) 1969 . ARPANET , , , , 1975 . . 1983 . TCP/IP . ARPANET ( ARPANET 1990 .), TCP/IP . , TCP/IP, , . . , TCP/IP Groucho Marx (GMU), . , , . . , Linux Unix erdos. , quark, :$ rlogin quark.physics Welcome to the Physics Department at GMU (ttyq2) login:

43

1:

, andres, . shell-* quark, , . , . - , TCP/IP: (remote login). quark, , , web- . X Window - . , , DISPLAY:$ DISPLAY=erdos.maths:0.0 $ export DISPLAY

, , quark, . , 11 erdos. , TCP/IP quark erdos 11- , , - . . TCP/IP- NFS, Networks File System ( ). , , . , , . , . ( ,

* (shell) Unix. .. DOS prompt Microsoft Window s, .

44

TCP/IP

), . NFS 14, . , , TCP/IP . - . - TCP/IP. . .

Ethern et - Ethernet. - , (), . Ethernet , 10, 100 1000 / (Mbps) . Ethernet : ( thick ), ( thin) a ( twisted pair). Ethernet , . Ethernet - BNC, . Ethernet .. . . Ethernet 200 500 10base-2 10base-5. base () baseband modulation , . Mbps, . , (). 10base-T, Twisted ( ). , 100 Mbps, 100base-T.45

1:

Ethernet , . , Ethernet -, . -. , , . , . Ethernet , PC $30 ( ), . , - - Ethernet . , GMU Ethernet, , . . , . - , - , Ethernet . GMU , . Ethernet , , . , Ethernet , . , , Ethernet . , . -. , Ethernet.46

TCP/IP

Ethernet , ( ) 1500 . 6- , (NIC Network Interface Card) Ethernet. e , , aa:bb:cc:dd:ee:ff . , , , - . , . Ethernet , . , Ethernet 30 . Ethernet 30 . - Ethernet 60 , .*

- , GMU, Ethernet . , . Linux, . HOWTO , , , , . GMU , , FDDI ( Fiber Distribution

*

Ethernet FAQ ( http://www.faqs.org/faqs/ LANs/ethernet-faq/), web- Ethernet Charles Spurgeon http:// www.host.ots.utexas.edu/ethernet.

47

1:

Data Interface ). FDDI , ( tokens) . , . , . , - , 100 Mbps FDDI. FDDI, , , - 200 , GMU, . , IBM, Token Ring IBM. Token Ring Ethernet FDDI , - (4 Mbs 16 Mbps) - , , . Linux Token Ring , Ethernet, . - , LAN ArcNet DECNet. Linux, . . - , .25. Tymnet , Austpac Datex-P , . .25 , , , (.25 ). .25 , . .25 , , PAD (Packet Assembler Disassembler). PAD , . .25, .25 .48

TCP/IP

.25 , TCP/IP. IP .25 ( ), .25 . Linux .25. - , , Frame Relay ( . ). Frame Relay .25, IP. .25, Frame Relay . , . , , , FRAD (Frame Relay Access Device Frame Relay), Ethernet Frame Relay . Frame Relay TCP/IP . Linux , Frame Relay . - , , ATM (Asy nchronous Transfer Mode ). ATM , , , , (Q.S. Quality of Service). ATM , , . ATM TCP/IP. Networking-HOWTO Linux. - -, ; (packet radio). , - , .25 ( ) .25. - .25, TCP/IP . .25, .25, , Terminal Node Controller ( 49

1:

), , . . Z8530 SCC - , . , .25, NetRom Rose, . .25, . Linux .25, NetRom Rose. AX.25-HOWTO Linux. , (, ISDN ..). , SLIP PPP, -.

IP , Ethernet --. , , . - , GMU, , . GMU Ethernet . FDDI . , ( gateway ), , Ethernet FDDI . , Linux quark , quark, . , . ( sophus) niels , niels - . erdos quark 1-1.50

TCP/IP

FDDI 2

sophus

niels

1

3

quark erdos

1-1. erdos quark.

, . , - , : IP . 2, TCP/IP , I - . IP , . , - . - . -. , IP . 32- , IP . IP , , 8- . , quark IP 0953004, 149.76.12.4. - , 51

1:

. - IPv4 ( , 4), IPv6 - , . IPv6 . , : , quark, IP 6- Ethernet . , rlogin quark , IP quark, IP , Ethernet IP . 2. , ( hostname resolution), IP ( address resolution) IP .

IP SLIP Serial Line IP (IP ) . SLIP, CSLIP SLIP, IP, - , . PPP Point-to-Point Protocol ( --). PPP - SLIP , -. SLIP , IP , , .

TC P . quark, rlogin erdos shell- quark. , , . , .52

TCP/IP

, IP , . , web- Netscape FTP- GMU. - , . quark, sophus . IP . , . , TCP ( Transmission Control Protocol ), IP. TCP , IP, , . , TCP , . . TCP IP . . , , IP ( ), ( ). , . rlogin, ( rlogin) erdos 513 quark, , rlogind. TCP . , rlogind . TCP , , rlogin , TCP .

53

1:

UDP , TCP TCP/IP . rlogin, NFS, TCP , UDP (User Datagram Protocol ). TCP, UDP , . , UDP, . , . TCP , . UDP . UDP . ; , , . -, - TCP , UDP . , , .

. , ( ). , , . , . , , . , , , 513.54

TCP/IP

TCP , . , quark erdos, rlogin 1023, 1022. 513 quark. erdos. , , . , . rlogin . IETF (Internet Engineering Task Force), RFC-, Assigned Numbers (RFC-1700). , , . Linux /etc/ services, . TCP, UDP , . , TCP 513, , UDP 513. , rlogin (TCP) rwho (UDP).

Unix , - , . Linux. - Unix Berkeley Socket Library ( ). , , . bind, , , ( connect, listen accept). - , TCP/IP- ( AF_INET), , , ( AF_UNIX). XNS (Xerox Networking System) .25. Linux, C libc . AF_INET AF_INET6 TCP/IP 55

1:

AF_UNIX Unix . , AF_IPX Novell, AF_X.25 .25, AF_ATMPVC AF_ATMSVC ATM AF_X25, AF_NETROM AF_NTROSE () . , , .

UUCP UUCP (Unix-to-Unix Copy Unix Unix) , , . , , . , . UUCP - Bell Laboratories 1977 . Unix . 1978 . 80 . , . , . UUCP Unix . , AmigaOS, DOS TOS Atari. UUCP , . , . UUCP UUCP . , , . , UUCP. , . UUCP , UUCP , . 56

Linux

, rlogin. , UUCP , , . UUCP , - . UUCP , , , UUCP UUCP , . UUCP , . UUCP , , , , UUCP TCP/IP.

Linux , Linux . , , . UUCP Linux, TCP/IP- 1992 ., Ross Biro , Net-1. Ross 1993 ., Fred van Kempen , . Net-2. Net-2d 1993 . ( 0.99.10) , Alan Cox* . Alan Net-2Debugged. , Net-3,

*

Alan [email protected]

57

1:

Linux 1.0. Net-3 Linux 1.2 Linux 2.0. 2.2 - Net-4, , . Net-4 Linux . Net-4 SLIP PPP ( ), FLIP ( ), IPX ( Novell , 15, IPX NCP), Appletalk ( Apple) AX.25, NetRom Rose ( -). Net-4 IP , IP ( - 9, TCP/IP 10, IP ), IP ( 11, IP ). IP . Ethernet , FDDI, Token Ring, Frame Relay , ISDN ATM . , , Linux. SMB, Samba, lanmanager Microsoft Windows, Andrew Tridgell, Novell NCP (NetWare Core Protocol)* .

Linux. Net-2Debugged Linux, Fred . Net-2e, . Fred (DDI Device Driver Interface), Net-2 . TCP/IP Matthias Urlichs, ISDN Linux FreeBSD. *

NCP , Novell

58

Linux

BSD Linux. . Linux, , . , , . , , , upgrade - , . Linux, . Net-4 . Net-4 - . Linux web, . Linux, Linux - , IP IPv6 .

, Linux, , . , Linux. Linux ftp.kernel.org /pub/linux/kernel/v2x/, . Linux ftp.kernel.org /pub/linux/kernel/v2y/, y . Linux . Linux .

59

1:

. , . , , . . (log-) . shell-, cron. inn C News . . cron- e-mail . , log- root . , root ; - root . , 19, exim 18, Sendmail. , , . , , . , e-mail root, , , . , postmaster, newsmaster usenet. hostmaster , DNS , .

60

. . , , . , , . . , , . , . , , , , . . . COPS, , . , , . shadow password , . , - . , . , root (setuid root) , . , , , . , , TFTP ( Trivial File Transfer Protocol 61

1:

), /boot. , TFTP . , TFTP /boot.* , . 12 tcpd, . - 9. . , , , , , , . . , .+ , , -, , .# setuid- , - , . , , . rlogin, rsh rexec , . , ( -), . r-

* +

12, . Unix ( ), setuid-root shell-, root 1988 ., RTM , , send mail. .

#

62

ssh, - . , . , , . , , , . , tripwire Gene Kim Gene Spafford, . tripwire . , , .

63

64

2

TCP/IP

, , Linux TCP/IP , IP , . , , , , . TCP/IP Internetworking with TCP/IP Douglas R. Comer ( Prentice Hall). - TCP/IP , TCP/IP Network Administration Craig Hunt ( OReilly).

, , TCP/IP , . , . . , Ethernet Linux eth0 eth1; PPP- ( 8, PPP) ppp0 ppp1, FDDI- fddi0 fddi1. , 655.

2: TCP/IP

, . TCP/IP , IP , . , -. , , . , , . MTU ( Maximum Transfer Unit ). - . , .

IP 1, , IP 32- . .* , TCP/IP , . IP , . 2-1. , , , NIC ( Network Information Center ) +. IP , . , quark.phisycs.groucho.edu IP

*

- IP 4. , IP 6. IPv6 - . IPv6 Linux, , . IPv6 Linux , . - IP , IP . , NIC, IP , e-mail [email protected] http://www.internic.net/

+

66

IP

0954004, 149.76.12.4. ( dotted quad notation). , IP e , , , . NIC IP , , . , , IP . , , . , , IP . - : 1.0.0.0 127.0.0.0. . 24 , 1,6 . 128.0.0.0 191.255.0.0. . 16,320 65,024 . 192.0.0.0 223.255.255.0, . 2 254 . D, E F , 224.0.0.0 254.0.0.0 , . IP Multicast, , . 1, , 149.76.12.4, quark, 12.4 149.76.0.0.67

2: TCP/IP

, . , 0 255 . , - 0, , , 1, broadcast . . , 149.76.255.255 , 149.76.0.0. . 0.0.0.0 127.0.0.0. , .. loopback (-). , IP . 127.0.0.0 IP , . , 127.0.0.1 , ( loopback ), . IP , TCP UDP, , , - . , . , - . , ; , UUCP- IP , INN. Linux, INN loopback . . . , , . 2-1. 2-1. IP , . 68 10.0.0.0 10.255.255.255 172.16.0.0 172.31.0.0 192.168.0.0 192.168.255.0

IP , Ethernet Token Ring . , , IP , ? . IP . ARP ( Address Resolution Protocol ). , ARP Ethernet Token Ring , A.25 . , ARP , , - 150 : , , , - X , . , . ARP Ethernet , IP , Ethernet, broadcasting ( ), . Broadcast-, ARP, IP . , , IP , ARP . , Ethernet- . , , . , . . ARP. Ethernet , ARP , , . , ; Ethernet ARP . , ARP , IP .69

2: TCP/IP

IP , Ethernet . , , . , , , Ethernet ! , broadcast , IP . , RARP (Reverse Address Resolution Protocol ). BOOTP, .

IP , IP . ; , .

IP , , , . , : , . : , , , , . IP . , . , . , - .

70

IP

IP -, -. , IP . , IP .* , - , - Ethernet. IP IP . IP . , A, B C. . , , ( subnet mask) ( netmask ). 32- , IP . GMU . - 149.76.0.0, 255.255.0.0. , GMU - . , IP 254 149.76.1.0 149.76.254.0. , 149.76.12.0. 149.76.1.0. IP , , . , 255.255.255.0. 2-1 149.76.12.4, quark, , , . , . *

-. IP .

71

2: TCP/IP

( ). , , ( Ethernet ), ( ) ( ), . .

2-1. .

; . , Ethernet, : . , (gateway ). , . 2-2 GMU. , , . IP , IP . , 149.76.4.0 . quark, erdos IP72

IP

149.76.12.4, ( sophus). sophus : . eth0 fddi0. , IP ? 149.76.1.0 149.76.4.0?

2-2. GMU

. sophus 149.76.1.1 149.76.1.0 149.76.4.1 146.76.4.0. IP , . 73

2: TCP/IP

, . , sophus : eth0 fddi0 lo 149.76.4.1 149.76.1.1 127.0.0.1 255.255.255.0 255.255.255.0 255.0.0.0

loopback lo, . . , ( erdos), -- IP , , , Ethernet , IP . , .

, IP , . , erdos quark, , . erdos sophus, . sophus , quark , , , . niels, . sophus , . IP , , . ( ); , 0.0.0.0. , 32- . , 74

IP

. sophus : 149.76.1.0 149.76.2.0 149.76.3.0 149.76.4.0 149.76.5.0 ... 0.0.0.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 ... 0.0.0.0 149.76.1.2 149.76.1.3 149.76.1.5 ... 149.76.1.2 fddi0 fddi0 fddi0 eth0 fddi0 ... fddi0

, sophus , ; . . , . , (AND) , . : , , ( - ) . IP - , , . , , , , . IP ? . , - . - , . 75

2: TCP/IP

, - ; , , - . , - , 24- . , , , - . , , , . . , - IP route ( 5, TCP/IP ). - , ; , . . ( GMU) . - RIP ( Routing Information Protocol), BSD- routed. EGP ( External Gateway Protocol) BGP (Border Gateway Protocol). RIP gated Cornell.

- - ( hops). , , , . - , RIP. 16 .

76

ICMP

RIP , gated. , gated . ( loopback ), , . , RIP . , gated , . .* , , , , , . , RIP gated.

ICMP IP, . ICMP ( Internet Control Message Protocol ), , . , erdos telnet 12345 quark, . TCP quark, ICMP erdos, , . ICMP , . , (redirect

*

, - , . .

77

2: TCP/IP

message). , , , . , erdos, . , FDDI , GMU (gcc1). , quark gcc1 niels . , gcc1 , niels, ICMP sophus, - . , - . , , , RIP ICMP, . ICMP RIP . - . , Linux . , , . , , ICMP . ICMP .

-, TCP/IP , IPv4, 32- . , . , gauss strange . IP , , . ( hostname resolution). IP , gethostname(3) gethos78

tbyaddr(3) . , , resolverlibrary ; Linux libc . , (the resolver). 6, . Ethernet , . , /etc/hosts. e/e , , , hosts . , , . (NIS), Sun Microsy stems, YP . NIS hosts ( ) , . , , hosts . NIS 13, . , HOSTS.TXT. NIC ( Network Information Center ) . , . HOST.TXT, , , . - NIC, , . , 1994 . : DNS ( Domain Name System ). DNS Paul Mockapetris . DNS 6.79

3

TCP/IP, , . , . , , , Ethernet, FDDI Token Ring , , PC. , . , Linux , . , , . Linux : ISA, PCI, MCA, EISA, , PCMCIA, , USB. , , ? Ethernet . , : , .816.

3:

IBM , / , / . , , . / . Ethernet ISA 0280 0300. PCI / . , , . (auto probing), , / , , . , , ; , . , , . , . , , . , , . PC ISA , 15- , 0, 1, 3 .. 15. , , IRQ (Interrupt Request Number ).* 2, TCP/IP , , . , .*

2 9 , IBM PC , ; IRQ 2 .

82

. Unix , /dev/. ls las /dev/, . , (permissions) , , , . . - b, , / , c, , . ls, , , (major) (minor) . , . . . , tty /dev/tty , , c 4, /dev/tty1 1, /dev/tty2 2. , , , . Linux /dev . - Linux. , . , Ethernet eth0, eth1. SLIP- , . SLIP, . 3-1 , .

83

3:

3-1. ,

, , , . :. . This processor honors the WP bit even when in supervisor mode./ Good. Swansea University Computer Society NET3.035 for Linux 2.0 NET3: Unix domain sockets 0.13 for Linux NET3.035. Swansea University Computer Society TCP/IP for NET3.034 IP Protocols: IGMP,ICMP, UDP, TCP Swansea University Computer Society IPX 0.34 for NET3.035 IPX Portions Copyright (c) 1995 Caldera, Inc. Serial driver version 4.13 with no serial options enabled tty00 at 0x03f8 (irq = 4) is a 16550A tty01 at 0x02f8 (irq = 3) is a 16550A CSLIP: code copyright 1989 Regents of the University of California PPP: Version 2.2.0 (dynamic channel allocation) PPP Dynamic channel allocation code copyright 1995 Caldera, Inc. PPP line discipline registered. eth0: 3c509 at 0x300 tag 1, 10baseT port, address 00 a0 24 0e e4 e0,/ IRQ 10. 3c509.c:1.12 6/4/97 [email protected] Linux Version 2.0.32 (root@perf) (gcc Version 2.7.2.1) #1 Tue Oct 21 15:30:44 EST 1997 . .

, TCP/IP SLIP, CSLIP PPP. 84

, Ethernet 3C509 eth0. D-Link , dl0 D-Link . , , . - Ethernet .

Linux , PC. , . , , . , . , , , ; , . , Linux , . , , , . , , . Linux Running Linux ( O'Reilly) *. , . , , , . Linux , : 2.2.14. . , .

*

Linux ..

85

3:

, 1 2, , Intel. . - . Linux , , . , , - . - Linux, , , . .* make menuconfig, , , . TCP/IP . , , y.

Linux 2.0 - , SCSI . . ?, , . ( y), aa , ( n), . , , ( m). , *

, ; , , . , , /usr/src/linux/REPORTINGBUGS Linux.

86

, . . , . , 2.0 2.1 :* * Network device support ( ) * Network device support (CONFIG_NETDEVICES) [Y/n/?]

, Ethernet, SLIP, PPP , ( y). y, Ethernet . , :PLIP (parallel port) support (CONFIG_PLIP) [N/y/m/?] y PPP (point-to-point) support (CONFIG_PPP) [N/y/m/?] y * * CCP compressors for PPP are only built as modules * SLIP (serial line) support (CONFIG_SLIP) [N/y/m/?] m CSLIP compressed headers (CONFIG_SLIP_COMPRESSED) [N/y/?] (NEW) y Keepalive and linefill (CONFIG_SLIP_SMART) [N/y/?] (NEW) y Six bit SLIP encapsulation (CONFIG_SLIP_MODE_SLIP6) [N/y/?] (NEW) y

, Linux. PPP SLIP IP . PPP , . , PPP, , , , PPP TCP/IP ; , IPX. y m SLIP (SLIP support), , . (compressed headers) CSLIP , 87

3:

TCP/IP . , CSLIP; . Keepalive and linefill , SLIP, , . Six bit SLIP encapsulation SLIP , 8- . unencoding binhex, . PLIP IP . PC-, DOS. PC , PLIP - PPP SLIP, - , , . . , , - . , , , :. . Ethernet (10 or 100Mbit) (CONFIG_NET_ETHERNET) [Y/n/?] 3COM cards (CONFIG_NET_VENDOR_3COM) [Y/n/?] 3c501 support (CONFIG_EL1) [N/y/m/?] 3c503 support (CONFIG_EL2) [N/y/m/?] 3c509/3c579 support (CONFIG_EL3) [Y/m/n/?] 3c590/3c900 series (592/595/597/900/905) "Vortex/Boomerang" support/ (CONFIG_VORTEX) [N/y/m/?] AMD LANCE and PCnet (AT1500 and NE2100) support (CONFIG_LANCE) [N/y/?] AMD PCInet32 (VLB and PCI) support (CONFIG_LANCE32) [N/y/?] (NEW) Western Digital/SMC cards (CONFIG_NET_VENDOR_SMC) [N/y/?] WD80*3 support (CONFIG_WD80x3) [N/y/m/?] (NEW) SMC Ultra support (CONFIG_ULTRA) [N/y/m/?] (NEW) SMC Ultra32 support (CONFIG_ULTRA32) [N/y/m/?] (NEW) SMC 9194 support (CONFIG_SMC9194) [N/y/m/?] (NEW) Other ISA cards (CONFIG_NET_ISA) [N/y/?] Cabletron E21xx support (CONFIG_E2100) [N/y/m/?] (NEW) DEPCA, DE10x, DE200, DE201, DE202, DE422 support (CONFIG_DEPCA) [N/y/m/?]/ (NEW)

88

EtherWORKS 3 (DE203, DE204, DE205) support (CONFIG_EWRK3) [N/y/m/?] (NEW) EtherExpress 16 support (CONFIG_EEXPRESS) [N/y/m/?] (NEW) HP PCLAN+ (27247B and 27252A) support (CONFIG_HPLAN_PLUS) [N/y/m/?] (NEW) HP PCLAN (27245 and other 27xxx series) support (CONFIG_HPLAN) [N/y/m/?]/ (NEW) HP 10/100VG PCLAN (ISA, EISA, PCI) support (CONFIG_HP100) [N/y/m/?] (NEW) NE2000/NE1000 support (CONFIG_NE2000) [N/y/m/?] (NEW) SK_G16 support (CONFIG_SK_G16) [N/y/?] (NEW) EISA, VLB, PCI and on card controllers (CONFIG_NET_EISA) [N/y/?] Apricot Xen-II on card ethernet (CONFIG_APRICOT) [N/y/m/?] (NEW) Intel EtherExpress/Pro 100B support (CONFIG_EEXPRESS_PRO100B) [N/y/m/?]/ (NEW) DE425, DE434, DE435, DE450, DE500 support (CONFIG_DE4X5) [N/y/m/?] (NEW) DECchip Tulip (dc21x4x) PCI support (CONFIG_DEC_ELCP) [N/y/m/?] (NEW) Digi Intl. RightSwitch SE-X support (CONFIG_DGRS) [N/y/m/?] (NEW) Pocket and portable adaptors (CONFIG_NET_POCKET) [N/y/?] AT-LAN-TEC/RealTek pocket adaptor support (CONFIG_ATP) [N/y/?] (NEW) D-Link DE600 pocket adaptor support (CONFIG_DE600) [N/y/m/?] (NEW) D-Link DE620 pocket adaptor support (CONFIG_DE620) [N/y/m/?] (NEW) Token Ring driver support (CONFIG_TR) [N/y/?] IBM Tropic chipset based adaptor support (CONFIG_IBMTR) [N/y/m/?] (NEW) FDDI driver support (CONFIG_FDDI) [N/y/?] Digital DEFEA and DEFPA adapter support (CONFIG_DEFXX) [N/y/?] (NEW) ARCnet support (CONFIG_ARCNET) [N/y/m/?] Enable arc0e (ARCnet "Ether-Encap" packet format)(CONFIG_ARCNET_ETH)/ [N/y/?] (NEW) Enable arc0s (ARCnet RFC1051 packet format) (CONFIG_ARCNET_1051)/ [N/y/?] (NEW) . .

, , (NFS). NFS , , , :NFS file system support (CONFIG_NFS_FS) [Y]

NFS 14, .89

3:

Linux 2.0.0 - Linux 2.0.0 . ( IPX) . . . - , , Networking HOWTO. . TCP/IP , y. n, , IPX:Networking options----> [*] TCP/IP networking

( SLIP), . , , . , , . , . - , , ( 9, TCP/IP) :[*] IP: forwarding/gatewaying

IP . , , , 90

, . IP (IP aliases) :[*] Network aliasing IP: aliasing support

IP ( 10, IP ):[*] IP: accounting

PC hug PC/TCP TCP/IP DOS PC-. , Unix , :--- (it is safe to leave these untouched) [*] IP: PC/TCP compatibility mode

RARP ( Reverse Address Resolution Protocol ). RARP - IP . , RARP. RARP , rarp, : IP: Reverse ARP

MTU TCP, , IP. MTU (Maximum Transfer Unit ). , Ethernet, MTU, Ethernet91

3:

- 1500 . IP , , , - - , IP .* - MTU IP TCP . . y , . - , (, SLIP ), mss route , :[ ] IP: Disable Path MTU Discovery (normally enabled)

IP , Source Routing ( ). , , . RIP OSPF , . , . , :[*] IP: Drop source routed frames

Novell IPX , Novell. Linux IPX ; *

, IP , Ethernet

92

Linux

, Novell. NCP IPX Novell , ( IPX NCP 15, IPX NCP): The IPX protocol

Linux: AX.25, NetRom Rose ( , AX25 HOWTO): Amateur Radio AX.25 Level 2 Amateur Radio NET/ROM Amateur Radio X.25 (Rose)

Linux : dummy () . : Dummy net driver support

, PPP/SLIP . - (loopback). , PPP/SLIP, , , IP . - 5, TCP/IP . IP , IP .

Linux Linux . , .93

3:

Linux . , , eth0 eth1: lo -. , . , . loopback .

eth0, eth1, ... Ethernet. Ethernet , Ethernet- . tr0, tr1, Token Ring. Token Ring , , IBM. sl0, sl1, SLIP . , SLIP. ppp0, ppp1, PPP . SLIP , PPP , PPP . plip0, plip1, PLIP . PLIP IP . PLIP . 2.0. / , , SLIP PPP .

94

Ethernet

ax0, ax1, AX.25 . AX.25 , - . AX.25 SLIP . . - . - . Networking HOWTO , , AX25 HOWTO -.

Ethernet Linux Ethernet . Donald Becker, , 8390 National Semiconductors; Becker. Ethernet , Linux. Ethernet , , . - Linux Ethernet , . , Paul Gortmaker Ethernet HOWTO, Linux.+ comp.os.linux.answers LDP. , Ethernet , Ethernet HOWTO, +

Paul [email protected]

95

3:

. , . , , DMA Ethernet , DMA , SCSI Adaptec 1542. DMA , Ethernet . Ethernet Linux, Linux. , . , , - , , ; .

Eth ern et Ethernet Linux , Ethernet . . Ethernet HOWTO / . . , . - . , , . , , . - , Ethernet . , , . , , , , , . PCI . 96

Ethernet

, . , . , Ethernet , Ethernet , . lilo, , , append lilo.conf. Ethernet , :ether=irq,_,[1,][ 2,]

, . irq, _ , . , , . IRQ, . IRQ . , 3503 IRQ 5, 9, 3, 4 . _ / ; , -. . WD80x3, . 1 debug-. 1 7 , 8 ; 0 . 3503 2 ( ) ( 1). BNC , AUI . , .

97

3:

- . Ethernet , . Ethernet , Linux lilo, - . , , , . reserve lilo, / , . , Linux Ethernet 0300 eth1, :reserve=0x300,32 ether=0,0x300,eth1

reserve , / . , eth0:reserve=0x340,32 ether=0,0x340,eth0

. , , Ethernet , . 1 _:ether=0,-1,eth0

, boot: lilo. , Control, Alt Shift lilo. Tab , , . , , , , . Enter, lilo , . , , /etc/98

PLIP

lilo.conf append=. :boot=/dev/hda root=/dev/hda2 install=/boot/boot.b map=/boot/map vga=normal delay=20 append="ether=10,300,eth0" image=/boot/vmlinuz-2.2.14 label=2.2.14 read-only

lilo.conf, lilo, .

PLIP PLIP ( Parallel Line IP IP ) , . , 10 20 . PLIP Cry nwr, Inc. (, , ), IBM PC ; , .# PLIP Crynwr , , , . PLIP 0. , , #

! , , , , , . , . (New Hackers Dictionary ).

99

3:

8- PLIP PLIP 1. Linux 2.0 PLIP 0. 1 patch 2.0 2.2 .% PLIP, PLIP Cry nwr, PLIP NCSA telnet.! PLIP, , Null Printer Turbo Laplink cable. ; , . PLIP Linux . Niibe Yutaka.* , plip0 lp0, plip1 lp1 .. 2.0 2.2. 2.0 drivers/net/Spacd.c . :

plip0 plip1 plip2

/ 0x3BC 0x378 0x278

IRQ 7 7 5

, drivers/net/Spacd.c .%

Patch-, 2.0 http://www.cyberelc.demon.co.uk/parport.html. NCSA telnet DOS, TCP/IP Ethernet PLIP telnet FTP. Niibe [email protected].

! *

100

PLIP

2.2, PLIP parport, Philip Blundell.* , Ethernet PPP , PLIP plip0, plip1 .. . , . - / . parport_pc.o , , , lilo. IRQ - IRQ proc/parport/*/irq. / 2.2 . , , ( PC-) / 0278 0x378, IRQ 5 7, :modprob parport_pc io=0x278,0x378 irq=5,7

, :parport=0x278,5 parport=0x278,7

, append. PLIP , , , plip.o, plip. plip0, plip1 .. . ,

*

Philip [email protected]

101

3: parport1 plip0 parport0 plip1, :plip=parport1 plip=parport0

, . PLIP .

PPP SLIP PPP SLIP IP . PPP SLIP , IP (, ). PPP SLIP ; . TCP/IP , . 4, . PPP 8, PPP, SLIP 7, IP .

Ethernet. , , , . /usr/src/linux/Documentation/networking Linux.

102

4

. , SLIP, PPP UUCP, . , , . ( , , , ), Linux , . , , setserial stty . , , Serial HOWTO David Lawyer.

103

4:

Linux. , , . Unix kermit. , , . - , , -, . minicom, - DOS. X11 . seyon X11- . . - . , , . . , - . , , , - . UUCP . , . . UUCP Ian Tay lor, Linux, 16: Taylor UUCP. Fidonet. Fidonet ifmail, , , , . PPP SLIP - , . PPP SLIP, 104

FTP web-. PPP SLIP , ISDN .

Unix , tty . tty Teletype device ( Telety pe), Unix. - . Linux, . Linux tty : , ( Alt-F1 Alt-Fnn ) ( , X11). tty , - Unix . tty , . SLIP PPP - . tty , Ethernet , ifconfig. , tty , . , tty . SLIP, PPP , tty . , , , . , . SLIP PPP, , , 105

4:

, . ; SLIP PPP , .

Unix , , /dev . , , . - , . , , , , . , . - 4, ttyS0, ttyS1 .. 5 , ; cua0, cua1 .. Unix, 0, 1. , COM1: /dev/ttyS0, COM2: /dev/ttyS1 .. , IBM PC , COM3: . cua ( callout) , , , . , . . Linux, Unix, , , . , tty , . , tty , . ( lock files) . 106

tty , , , . , tty . , , . , , , , ; . , . , Linux . , Linux Filesy stem Standard , tty . , , , : /usr/spool/locks/, /var/ spool/locks/, /var/lock/ /usr/lock/. . , tty ; . cua , . , , , , . ttyS , cua , , . cua ttyS, , .. , cua . , , . , , . ! , .

107

4:

, Linux Filesy stem Standard , /var/lock/ , ttyS1 LCK.ttyS1. cua , . cua , - , . , ttyS , Linux FSSTND, , , , . , tty , . LOCKDIR Makefile - . , , FSSTND . , , :strings binaryfile | grep lock

, , , /var/lock/. , .

. COM1: COM4:, COM- 63. , - ; . Serial-HOWTO , .

108

, COM2:. 65, 4 . , ttyS1, . tty /dev/. , :$ 0 0 0 0 1s -1 /dev/ttyS* crw-rw---- 1 uucp crw-rw---- 1 uucp crw-rw---- 1 uucp crw-rw---- 1 uucp dialout dialout dialout dialout 4, 4, 4, 4, 64 Oct 13 1997 65 Jan 26 21:55 66 Oct 13 1997 67 Oct 13 1997 /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3

4 65, . :# mknod -m 666 /dev/ttyS1 c 4 65 # chown uucp.dialout /dev/ttyS1

Linux , . root, ; uucp. , , , . /dev/ modem -, ttyS1. , modem, . .

RS-232 - . . ( ) . Linux , RS-232.109

4:

, . , . , , CTS (Clear to Send) RTS (Ready to Send), : RTS/CTS. , , XON/XOFF. XON /XOFF , Ctrl-S Ctrl-R, . , , , , , . , - . , XON/XOFF, . IBM PC, RS-232 UART , 8250. PC- 486 UART, 16450. 8250. , Pentium, - UART, 16550. (- , Rockwell) , 16550 . Linux . 16550 8250 16450, 16- FIFO (). 16550 UART , 16550, 16550 16550AFN ( 16550DN). FIFO ; 16550AFN , . NS16550, FIFO . 8250 16450 UART 1- . , 16450 .

110

16450 9,600 bps ISA . , COM1: COM4:. , UART FIFO 16550, .

, - : setserial stty.

s ets er ial , . , 100% . , , , -. UART-, , 16 FIFO , 16450 UART : , 16550 , . 4- , IRQ . , IRQ IRQ . setserial , . setserial - Osetserial rc.serial . , . setserial :setserial [ ]

, ttyS0.111

4:

setserial . - 4-1. , setserial. 4-1. setserial port __ I/O . , 0x2f8. , . UART . - 16450 16550. none . , ASP Fourport. UART 57.6 kbps, 38.4 kbps. UART 115 kbps, 38.4 kbps. UART 38.4 kbps. , spd_hi spd_vhi . IRQ . , IRQ. IRQ , irq.

irq uart uar t_type

fourport

spd_hi

spd_vhi

spd_norm al

auto_irq

112

autoconf ig port. , setserial UART, . auto_irq, IRQ. UART . , UART.

skip_tes t

rc -, , 4-1. Linux - -. 4-1: setserial rc.serial# /etc/rc.serial - . # # /sbin/setserial /dev/ttyS0 auto_irq skip_test autoconfig /sbin/setserial /dev/ttyS1 auto_irq skip_test autoconfig /sbin/setserial /dev/ttyS2 auto_irq skip_test autoconfig /sbin/setserial /dev/ttyS3 auto_irq skip_test autoconfig # # /sbin/setserial -bg /dev/ttyS*

-bg /dev/ttyS* . 4-2. 4-2: setserial -bg /dev/ttyS/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A /dev/ttyS1 at 0x02f8 (irq = 3) is a 16550A

113

4:

stt y stty set tty ( tty), . setserial, stty . . stty. stty - , . - , tty stty . - stty . -. . ; , , . , ( ), . stty crtscts, ; . - rc.serial ( ) , 4-3. 4-3: stty rc.serial# stty stty stty stty # crtscts crtscts crtscts crtscts < < < < /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3

, stty , (, , . , IP , . :> set type=type

type , ANY (). nslookup:$ nslookup Default Server: tao.linux.org.au Address: 203.41.101.121 > metalab.unc.edu Server: tao.linux.org.au Address: 203.41.101.121 Name: metalab.unc.edu Address: 152.2.254.81

>

183

6:

DNS , . , IP , DNS, nslookup ., No type A records found ( ). , , , set type . SOA unc.edu, :> unc.edu Server: tao.linux.org.au Address: 203.41.101.121 *** No address (A) records available for unc.edu > set type=SOA > unc.edu Server: tao.linux.org.au Address: 203.41.101.121 unc.edu origin = ns.unc.edu mail addr = host-reg.ns.unc.edu serial = 1998111011 refresh = 14400 (4H) retry = 3600 (1H) expire = 1209600 (2W) minimum ttl = 86400 (1D) unc.edu name server = ns2.unc.edu unc.edu name server = ncnoc.ncren.net unc.edu name server = ns.unc.edu ns2.unc.edu internet address = 152.2.253.100 ncnoc.ncren.net internet address = 192.101.21.1 ncnoc.ncren.net internet address = 128.109.193.1 ns.unc.edu internet address = 152.2.21.1

MX :> set type=MX > unc.edu Server: tao.linux.org.au Address: 203.41.101.121 unc.edu unc.edu unc.edu unc.edu unc.edu preference = 0, mail exchanger = conga.oit.unc.edu preference = 10, mail exchanger = imsety.oit.unc.edu name server = ns.unc.edu name server = ns2.unc.edu name server = ncnoc.ncren.net

184

namedconga.oit.unc.edu imsety.oit.unc.edu internet address = 152.2.22.21 internet address = 152.2.21.99

ns.unc.edu ns2.unc.edu ncnoc.ncren.net ncnoc.ncren.net

internet internet internet internet

address address address address

= = = =

152.2.21.1 152.2.253.100 192.101.21.1 128.109.193.1

ANY , . nslookup, , . NS , :> set type=NS > . Server: tao.linux.org.au Address: 203.41.101.121 Non-authoritative answer: (root) name server = A.ROOT-SERVERS.NET (root) name server = H.ROOT-SERVERS.NET (root) name server = B.ROOT-SERVERS.NET (root) name server = C.ROOT-SERVERS.NET (root) name server = D.ROOT-SERVERS.NET (root) name server = E.ROOT-SERVERS.NET (root) name server = I.ROOT-SERVERS.NET (root) name server = F.ROOT-SERVERS.NET (root) name server = G.ROOT-SERVERS.NET (root) name server = J.ROOT-SERVERS.NET (root) name server = K.ROOT-SERVERS.NET (root) name server = L.ROOT-SERVERS.NET (root) name server = M.ROOT-SERVERS.NET Authoritative answers can be found from: A.ROOT-SERVERS.NET internet address H.ROOT-SERVERS.NET internet address B.ROOT-SERVERS.NET internet address C.ROOT-SERVERS.NET internet address D.ROOT-SERVERS.NET internet address E.ROOT-SERVERS.NET internet address I.ROOT-SERVERS.NET internet address F.ROOT-SERVERS.NET internet address G.ROOT-SERVERS.NET internet address J.ROOT-SERVERS.NET internet address K.ROOT-SERVERS.NET internet address

= = = = = = = = = = =

198.41.0.4 128.63.2.53 128.9.0.107 192.33.4.12 128.8.10.90 192.203.230.10 192.36.148.17 192.5.5.241 192.112.36.4 198.41.0.10 193.0.14.129

185

6: L.ROOT-SERVERS.NET M.ROOT-SERVERS.NET internet address = 198.32.64.12 internet address = 202.12.27.33

help nslookup.

, BIND. . , , . hostcvt BIND /etc/hosts named. () (PTR), . , , SOA MX . , . hostcvt BIND, Linux FTP . , . , : dnswalk, Perl- . nslint. DNS , , , . host dig, DNS . DNS . . dnswalk nslint http://www.visi.com/~barr/dnswalk/ ftp://ftp.ee.lbl.gov/nslint.tar.Z. host dig ftp:// ftp.nikhef.nl/pub/network/ ftp://ftp.is.co.za /networking/ip/dns/dig/.

186

named

7

IP

IP IPX , . , , delimitation. Ethernet LAN , SLIP PPP . IP , . , SLI P PPP, . , , , FIFO . SLIP - . PPP. , ; - - . Linux SLIP PPP. , . .

187

7: IP

SLIP PPP, , . - . , - DNS. PPP: DNS IP /etc /resolv.conf

SLIP IP SLIP . , ; shell-, SLIP . . , SLIP ; Linux , -. SLIP . tty , SLIPDISC. tty (DISC0), , read(2) write(2) , SLIP tty . SLIPDISC : tty , , , SLIP . SLIP SLIP. SLIP, SLIP, Van Jacobsen ( RFC-1144) IP . . , - .

188

SLIP

SLIP slattach. , /dev/ttyS3 SLIP . :# slattach /dev/ttyS3 &

ttyS3 SLIPDISC SLIP . SLIP , sl0; sl1 .. , 256 SLIP . , slattach, SLIP. , p. SLIP ( ), :# slattach -p slip /dev/ttyS3 &

7-1 . -, adaptive, SLIP . 7-1. Linux SLIP slip cslip slip6 SLI . SLIP Van Jacobsen. SLIP - . , uuencode, SLIP ASCII , . , , . SLIP Van Jacobsen - . ; . 189

cslip6 adaptive

7: IP

, , . , cowslip SLIP, . SLIP , , , , , . , adaptive slip. . slattach SLIP, , , PPP KISS (, ). - . slattach (8). SLIP , . ifconfig route . , cowslip vlager . vlager :# ifconfig sl0 vlager-slip pointopoint cowslip # route add cowslip # route add default gw cowslip

cowslip, cowslip , cowslip . ifconfig: pointopoint, vlager-slip SLIP .

, , Ethernet vlager SLIP . , vlager-slip 172.16.1.1. , SLIP . IP , . -. vlager-slip, SLIP .190

IP

SLIP , cowslip, route del, hangup ( ) slattach. , :# # # # route del default route del cowslip ifconfig sl0 down kill -HUP 516

: 516 ( ps ax ) slattach, slip , .

IP 5, TCP/IP , Ethernet- IP , , . ; vlager cowslip , , . , vlager . SLIP IP ( , cowslip). , vlager, - ftp, telnet lynx , . telnet, vlager , . , vlager . WWW , , proxy- vlager , . , vlager , . ( ) IP , 191

7: IP

(firewall). , . - 9, TCP/IP. 11, IP , Linux, IP , proxy-. , IP 192.168.5.74 SLIP . , , , , -, /etc/hosts, vlager-slip. SLIP .

dip, . , , -. - ,