Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Tài liệu The Linux Network Administrators'''' Guide pot
Nội dung xem thử
Mô tả chi tiết
The Linux Network Administrators' Guide
Copyright c 1992-1994 Olaf Kirch
For Britta
Legal Notice
UNIX is a trademark of Univel.
Linux is not a trademark, and has no connection to UNIXTM or Univel.
Copyright c 1994 Olaf Kirch
Kattreinstr. 38, 64295 Darmstadt, Germany
\The Linux Network Administrators' Guide" may be reproduced and distributed in whole
or in part, subject to the following conditions:
0. The copyright notice above and this permission notice must be preserved complete
on all complete or partial copies.
1. Any translation or derivative work of \The Linux Network Administrators' Guide" must be approved by the author in writing before distribution.
2. If you distribute \The Linux Network Administrators' Guide" in part, instructions
for obtaining the complete version of \The Linux Network Administrators' Guide" must be included, and a means for obtaining a complete version provided.
3. Small portions may be reproduced as illustrations for reviews or quotes in other works without this permission notice if proper citation is given.
4. If you print and distribute \The Linux Network Administrators' Guide", you may
not refer to it as the \Ocial Printed Version".
5. The GNU General Public License referenced below may be reproduced under the
conditions given within it.
6. Several sections of this document are held under separate copyright. When these
sections are covered by a dierent copyright, the seperate copyright is noted. If
you distribute \The Linux Network Administrators' Guide" in part, and
that part is, in whole, covered under a seperate, noted copyright, the
conditions of that copyright apply.
Exceptions to these rules may be granted for academic purposes: Write to Olaf Kirch at
the above address, or email [email protected], and ask. These restrictions are here to
protect us as authors, not to restrict you as educators and learners.
All source code in \The Linux Network Administrators' Guide" is placed under the GNU
General Public License. See appendix C for a copy of the GNU \GPL."
The author is not liable for any damages, direct or indirect, resulting from the use of
information provided in this document.
Contents
Preface 5
Documentation on Linux ::::::::::::::::::::::::::::::: 6
About This Book :::::::::::::::::::::::::::::::::::: 7
The Ocial Printed Version :::::::::::::::::::::::::::::: 7
More Information :::::::::::::::::::::::::::::::::::: 8
On the Authors :::::::::::::::::::::::::::::::::: 9
Thanks ::::::::::::::::::::::::::::::::::::::::: 10
Typographical Conventions :::::::::::::::::::::::::::::: 11
The Linux Documentation Pro ject :::::::::::::::::::::::::: 12
Filesystem Standards :::::::::::::::::::::::::::::::::: 13
1 Introduction to Networking 14
1.1 History :::::::::::::::::::::::::::::::::::::: 14
1.2 UUCP Networks ::::::::::::::::::::::::::::::::: 15
1.2.1 How to Use UUCP :::::::::::::::::::::::::::: 15
1.3 TCP/IP Networks :::::::::::::::::::::::::::::::: 17
1.3.1 Introduction to TCP/IP-Networks ::::::::::::::::::: 18
1.3.2 Ethernets ::::::::::::::::::::::::::::::::: 19
1.3.3 Other Types of Hardware :::::::::::::::::::::::: 20
1.3.4 The Internet Protocol :::::::::::::::::::::::::: 21
1.3.5 IP over Serial Lines ::::::::::::::::::::::::::: 23
1.3.6 The Transmission Control Protocol ::::::::::::::::::: 23
1.3.7 The User Datagram Protocol :::::::::::::::::::::: 24
1.3.8 More on Ports :::::::::::::::::::::::::::::: 24
1.3.9 The Socket Library :::::::::::::::::::::::::::: 25
3
CONTENTS 4
1.4 Linux Networking ::::::::::::::::::::::::::::::::: 26
1.4.1 Dierent Streaks of Development :::::::::::::::::::: 26
1.4.2 Where to Get the Code ::::::::::::::::::::::::: 27
1.5 Maintaining Your System :::::::::::::::::::::::::::: 27
1.5.1 System Security ::::::::::::::::::::::::::::: 28
1.6 Outlook on the Following Chapters ::::::::::::::::::::::: 30
2 Issues of TCP/IP Networking 32
2.1 Networking Interfaces :::::::::::::::::::::::::::::: 32
2.2 IP Addresses ::::::::::::::::::::::::::::::::::: 33
2.3 Address Resolution :::::::::::::::::::::::::::::::: 34
2.4 IP Routing :::::::::::::::::::::::::::::::::::: 35
2.4.1 IP Networks :::::::::::::::::::::::::::::::: 35
2.4.2 Subnetworks ::::::::::::::::::::::::::::::: 36
2.4.3 Gateways ::::::::::::::::::::::::::::::::: 37
2.4.4 The Routing Table :::::::::::::::::::::::::::: 39
2.4.5 Metric Values ::::::::::::::::::::::::::::::: 40
2.5 The Internet Control Message Protocol ::::::::::::::::::::: 40
2.6 The Domain Name System ::::::::::::::::::::::::::: 41
2.6.1 Hostname Resolution ::::::::::::::::::::::::::: 41
2.6.2 Enter DNS :::::::::::::::::::::::::::::::: 42
2.6.3 Name Lookups with DNS :::::::::::::::::::::::: 45
2.6.4 Domain Name Servers :::::::::::::::::::::::::: 46
2.6.5 The DNS Database :::::::::::::::::::::::::::: 46
2.6.6 Reverse Lookups ::::::::::::::::::::::::::::: 48
3 Conguring the Networking Hardware 51
3.1 Devices, Drivers, and all that :::::::::::::::::::::::::: 51
3.2 Kernel Conguration ::::::::::::::::::::::::::::::: 53
3.2.1 Kernel Options in Linux 1.0 and Higher :::::::::::::::: 54
3.2.2 Kernel Options in Linux 1.1.14 and Higher :::::::::::::: 55
3.3 A Tour of Linux Network Devices :::::::::::::::::::::::: 58
3.4 Ethernet Installation ::::::::::::::::::::::::::::::: 59
CONTENTS 5
3.4.1 Ethernet Cabling ::::::::::::::::::::::::::::: 59
3.4.2 Supported Boards :::::::::::::::::::::::::::: 59
3.4.3 Ethernet Autoprobing :::::::::::::::::::::::::: 60
3.5 The PLIP Driver ::::::::::::::::::::::::::::::::: 62
3.6 The SLIP and PPP Drivers ::::::::::::::::::::::::::: 63
4 Setting up the Serial Hardware 64
4.1 Communication Software for Modem Links :::::::::::::::::: 64
4.2 Introduction to Serial Devices :::::::::::::::::::::::::: 65
4.3 Accessing Serial Devices ::::::::::::::::::::::::::::: 66
4.4 Serial Hardware :::::::::::::::::::::::::::::::::: 67
5 Conguring TCP/IP Networking 70
5.1 Setting up the proc Filesystem ::::::::::::::::::::::::: 71
5.2 Installing the Binaries :::::::::::::::::::::::::::::: 71
5.3 Another Example ::::::::::::::::::::::::::::::::: 72
5.4 Setting the Hostname :::::::::::::::::::::::::::::: 72
5.5 Assigning IP Addresses ::::::::::::::::::::::::::::: 73
5.6 Writing hosts and networks Files :::::::::::::::::::::::: 74
5.7 Interface Conguration for IP :::::::::::::::::::::::::: 76
5.7.1 The Loopback Interface ::::::::::::::::::::::::: 77
5.7.2 Ethernet Interfaces :::::::::::::::::::::::::::: 79
5.7.3 Routing through a Gateway ::::::::::::::::::::::: 81
5.7.4 Conguring a Gateway :::::::::::::::::::::::::: 82
5.7.5 The PLIP Interface :::::::::::::::::::::::::::: 82
5.7.6 The SLIP and PPP Interface :::::::::::::::::::::: 83
5.7.7 The Dummy Interface :::::::::::::::::::::::::: 84
5.8 All About ifcong :::::::::::::::::::::::::::::::: 84
5.9 Checking with netstat :::::::::::::::::::::::::::::: 87
5.9.1 Displaying the Routing Table :::::::::::::::::::::: 87
5.9.2 Displaying Interface Statistics :::::::::::::::::::::: 88
5.9.3 Displaying Connections ::::::::::::::::::::::::: 89
5.10 Checking the ARP Tables :::::::::::::::::::::::::::: 90
CONTENTS 6
5.11 The Future :::::::::::::::::::::::::::::::::::: 91
6 Name Service and Resolver Conguraton 93
6.1 The Resolver Library ::::::::::::::::::::::::::::::: 94
6.1.1 The host.conf File :::::::::::::::::::::::::::: 94
6.1.2 Resolver Environment Variables :::::::::::::::::::: 95
6.1.3 Conguring Name Server Lookups | resolv.conf ::::::::::: 96
6.1.4 Resolver Robustness ::::::::::::::::::::::::::: 97
6.2 Running named :::::::::::::::::::::::::::::::::: 97
6.2.1 The named.boot File ::::::::::::::::::::::::::: 98
6.2.2 The DNS Database Files ::::::::::::::::::::::::: 100
6.2.3 Writing the Master Files ::::::::::::::::::::::::: 103
6.2.4 Verifying the Name Server Setup :::::::::::::::::::: 104
6.2.5 Other Useful Tools :::::::::::::::::::::::::::: 109
7 Serial Line IP 110
7.1 General Requirements :::::::::::::::::::::::::::::: 110
7.2 SLIP Operation :::::::::::::::::::::::::::::::::: 111
7.3 Using dip ::::::::::::::::::::::::::::::::::::: 113
7.3.1 A Sample Script ::::::::::::::::::::::::::::: 113
7.3.2 A dip Reference ::::::::::::::::::::::::::::: 115
7.4 Running in Server Mode ::::::::::::::::::::::::::::: 119
8 The Point-to-Point Protocol 121
8.1 Untangling the P's :::::::::::::::::::::::::::::::: 121
8.2 PPP on Linux ::::::::::::::::::::::::::::::::::: 122
8.3 Running pppd ::::::::::::::::::::::::::::::::::: 123
8.4 Using Options Files :::::::::::::::::::::::::::::::: 124
8.5 Dialing out with chat :::::::::::::::::::::::::::::: 125
8.6 Debugging Your PPP Setup ::::::::::::::::::::::::::: 127
8.7 IP Conguration Options :::::::::::::::::::::::::::: 127
8.7.1 Choosing IP Addresses :::::::::::::::::::::::::: 128
8.7.2 Routing Through a PPP Link :::::::::::::::::::::: 129
8.8 Link Control Options ::::::::::::::::::::::::::::::: 130
CONTENTS 7
8.9 General Security Considerations ::::::::::::::::::::::::: 131
8.10 Authentication with PPP :::::::::::::::::::::::::::: 132
8.10.1 CHAP versus PAP :::::::::::::::::::::::::::: 132
8.10.2 The CHAP Secrets File ::::::::::::::::::::::::: 133
8.10.3 The PAP Secrets File :::::::::::::::::::::::::: 135
8.11 Conguring a PPP Server :::::::::::::::::::::::::::: 136
9 Various Network Applications 138
9.1 The inetd Super-Server ::::::::::::::::::::::::::::: 138
9.2 The tcpd access control facility ::::::::::::::::::::::::: 141
9.3 The services and protocols Files ::::::::::::::::::::::::: 142
9.4 Remote Procedure Call ::::::::::::::::::::::::::::: 144
9.5 Conguring the r Commands :::::::::::::::::::::::::: 146
10 The Network Information System 148
10.1 Getting Acquainted with NIS :::::::::::::::::::::::::: 149
10.2 NIS versus NIS+ ::::::::::::::::::::::::::::::::: 152
10.3 The Client Side of NIS :::::::::::::::::::::::::::::: 152
10.4 Running a NIS Server :::::::::::::::::::::::::::::: 153
10.5 Setting up a NIS Client with NYS ::::::::::::::::::::::: 154
10.6 Choosing the Right Maps :::::::::::::::::::::::::::: 155
10.7 Using the passwd and group Maps ::::::::::::::::::::::: 157
10.8 Using NIS with Shadow Support :::::::::::::::::::::::: 159
10.9 Using the Traditional NIS Code ::::::::::::::::::::::::: 160
11 The Network File System 161
11.1 Preparing NFS :::::::::::::::::::::::::::::::::: 163
11.2 Mounting an NFS Volume :::::::::::::::::::::::::::: 163
11.3 The NFS Daemons :::::::::::::::::::::::::::::::: 165
11.4 The exports File ::::::::::::::::::::::::::::::::: 166
11.5 The Linux Automounter ::::::::::::::::::::::::::::: 168
12 Managing Taylor UUCP 169
12.1 History :::::::::::::::::::::::::::::::::::::: 169
CONTENTS 8
12.1.1 More Information on UUCP ::::::::::::::::::::::: 170
12.2 Introduction :::::::::::::::::::::::::::::::::::: 171
12.2.1 Layout of UUCP Transfers and Remote Execution :::::::::: 171
12.2.2 The Inner Workings of uucico :::::::::::::::::::::: 172
12.2.3 uucico Command Line Options ::::::::::::::::::::: 173
12.3 UUCP Conguration Files :::::::::::::::::::::::::::: 174
12.3.1 A Gentle Introduction to Taylor UUCP :::::::::::::::: 174
12.3.2 What UUCP Needs to Know :::::::::::::::::::::: 177
12.3.3 Site Naming :::::::::::::::::::::::::::::::: 178
12.3.4 Taylor Conguration Files :::::::::::::::::::::::: 178
12.3.5 General Conguration Options { the cong File :::::::::::: 179
12.3.6 How to Tell UUCP about other Systems { the sys File :::::::: 180
12.3.7 What Devices there are { the port File ::::::::::::::::: 184
12.3.8 How to Dial a Number { the dial File ::::::::::::::::: 186
12.3.9 UUCP Over TCP :::::::::::::::::::::::::::: 187
12.3.10Using a Direct Connection :::::::::::::::::::::::: 188
12.4 The Do's and Dont's of UUCP { Tuning Permissions ::::::::::::: 188
12.4.1 Command Execution ::::::::::::::::::::::::::: 188
12.4.2 File Transfers ::::::::::::::::::::::::::::::: 189
12.4.3 Forwarding :::::::::::::::::::::::::::::::: 190
12.5 Setting up your System for Dialing in ::::::::::::::::::::: 191
12.5.1 Setting up getty ::::::::::::::::::::::::::::: 191
12.5.2 Providing UUCP Accounts ::::::::::::::::::::::: 191
12.5.3 Protecting Yourself Against Swindlers ::::::::::::::::: 193
12.5.4 Be Paranoid { Call Sequence Checks :::::::::::::::::: 193
12.5.5 Anonymous UUCP :::::::::::::::::::::::::::: 194
12.6 UUCP Low-Level Protocols ::::::::::::::::::::::::::: 195
12.6.1 Protocol Overview :::::::::::::::::::::::::::: 195
12.6.2 Tuning the Transmission Protocol ::::::::::::::::::: 197
12.6.3 Selecting Specic Protocols ::::::::::::::::::::::: 197
12.7 Troubleshooting :::::::::::::::::::::::::::::::::: 198
12.8 Log Files ::::::::::::::::::::::::::::::::::::: 200
CONTENTS 9
13 Electronic Mail 202
13.1 What is a Mail Message? :::::::::::::::::::::::::::: 203
13.2 How is Mail Delivered? :::::::::::::::::::::::::::::: 206
13.3 Email Addresses ::::::::::::::::::::::::::::::::: 207
13.4 How does Mail Routing Work? ::::::::::::::::::::::::: 208
13.4.1 Mail Routing on the Internet :::::::::::::::::::::: 208
13.4.2 Mail Routing in the UUCP World ::::::::::::::::::: 209
13.4.3 Mixing UUCP and RFC 822 :::::::::::::::::::::: 211
13.5 Pathalias and Map File Format ::::::::::::::::::::::::: 212
13.6 Conguring elm :::::::::::::::::::::::::::::::::: 214
13.6.1 Global elm Options ::::::::::::::::::::::::::: 215
13.6.2 National Character Sets ::::::::::::::::::::::::: 215
14 Getting smail Up and Running 217
14.1 UUCP Setup ::::::::::::::::::::::::::::::::::: 218
14.2 Setup for a LAN ::::::::::::::::::::::::::::::::: 219
14.2.1 Writing the Conguration Files ::::::::::::::::::::: 220
14.2.2 Running smail :::::::::::::::::::::::::::::: 221
14.3 If You Don't Get Through::: :::::::::::::::::::::::::: 222
14.3.1 Compiling smail ::::::::::::::::::::::::::::: 224
14.4 Mail Delivery Modes ::::::::::::::::::::::::::::::: 224
14.5 Miscellaneous cong Options :::::::::::::::::::::::::: 225
14.6 Message Routing and Delivery ::::::::::::::::::::::::: 226
14.7 Routing Messages ::::::::::::::::::::::::::::::::: 227
14.7.1 The paths database :::::::::::::::::::::::::::: 229
14.8 Delivering Messages to Local Addresses :::::::::::::::::::: 229
14.8.1 Local Users :::::::::::::::::::::::::::::::: 230
14.8.2 Forwarding :::::::::::::::::::::::::::::::: 230
14.8.3 Alias Files ::::::::::::::::::::::::::::::::: 231
14.8.4 Mailing Lists ::::::::::::::::::::::::::::::: 232
14.9 UUCP-based Transports ::::::::::::::::::::::::::::: 232
14.10SMTP-based Transports ::::::::::::::::::::::::::::: 233
14.11Hostname Qualication ::::::::::::::::::::::::::::: 234
CONTENTS 10
15 Sendmail+IDA 235
15.1 Introduction to Sendmail+IDA ::::::::::::::::::::::::: 235
15.2 Conguration Files | Overview :::::::::::::::::::::::: 236
15.3 The sendmail.cf File ::::::::::::::::::::::::::::::: 236
15.3.1 An Example sendmail.m4 File ::::::::::::::::::::: 237
15.3.2 Typically Used sendmail.m4 Parameters :::::::::::::::: 237
15.4 A Tour of Sendmail+IDA Tables :::::::::::::::::::::::: 243
15.4.1 mailertable :::::::::::::::::::::::::::::::: 243
15.4.2 uucpxtable ::::::::::::::::::::::::::::::::: 245
15.4.3 pathtable ::::::::::::::::::::::::::::::::: 245
15.4.4 domaintable :::::::::::::::::::::::::::::::: 246
15.4.5 aliases ::::::::::::::::::::::::::::::::::: 247
15.4.6 Rarely Used Tables :::::::::::::::::::::::::::: 248
15.5 Installing sendmail :::::::::::::::::::::::::::::::: 248
15.5.1 Extracting the binary distribution ::::::::::::::::::: 249
15.5.2 Building sendmail.cf ::::::::::::::::::::::::::: 249
15.5.3 Testing the sendmail.cf le ::::::::::::::::::::::: 250
15.5.4 Putting it all together - Integration Testing sendmail.cf and the tables253
15.6 Administrivia and Stupid Mail Tricks ::::::::::::::::::::: 255
15.6.1 Forwarding Mail to a Relay Host :::::::::::::::::::: 255
15.6.2 Forcing Mail into Miscongured Remote Sites ::::::::::::: 255
15.6.3 Forcing Mail to be Transferred via UUCP ::::::::::::::: 256
15.6.4 Preventing Mail from Being Delivered via UUCP ::::::::::: 257
15.6.5 Running the Sendmail Queue on Demand ::::::::::::::: 257
15.6.6 Reporting Mail Statistics :::::::::::::::::::::::: 257
15.7 Mixing and Matching Binary Distributions :::::::::::::::::: 258
15.8 Where to Get More Information :::::::::::::::::::::::: 259
16 Netnews 260
16.1 Usenet History :::::::::::::::::::::::::::::::::: 260
16.2 What is Usenet, Anyway? :::::::::::::::::::::::::::: 261
16.3 How Does Usenet Handle News? :::::::::::::::::::::::: 263
CONTENTS 11
17 C News 265
17.1 Delivering News :::::::::::::::::::::::::::::::::: 265
17.2 Installation :::::::::::::::::::::::::::::::::::: 267
17.3 The sys le :::::::::::::::::::::::::::::::::::: 269
17.4 The active le ::::::::::::::::::::::::::::::::::: 272
17.5 Article Batching ::::::::::::::::::::::::::::::::: 274
17.6 Expiring News :::::::::::::::::::::::::::::::::: 276
17.7 Miscellaneous Files :::::::::::::::::::::::::::::::: 279
17.8 Control Messages ::::::::::::::::::::::::::::::::: 280
17.8.1 The cancel Message ::::::::::::::::::::::::::: 281
17.8.2 newgroup and rmgroup :::::::::::::::::::::::::: 281
17.8.3 The checkgroups Message :::::::::::::::::::::::: 281
17.8.4 sendsys, version, and senduuname ::::::::::::::::::: 283
17.9 C News in an NFS Environment :::::::::::::::::::::::: 283
17.10Maintenance Tools and Tasks :::::::::::::::::::::::::: 284
18 A Description of NNTP 286
18.1 Introduction :::::::::::::::::::::::::::::::::::: 286
18.2 Installing the NNTP server ::::::::::::::::::::::::::: 288
18.3 Restricting NNTP Access :::::::::::::::::::::::::::: 288
18.4 NNTP Authorization ::::::::::::::::::::::::::::::: 290
18.5 nntpd Interaction with C News ::::::::::::::::::::::::: 290
19 Newsreader Conguration 292
19.1 tin Conguration ::::::::::::::::::::::::::::::::: 293
19.2 trn Conguration ::::::::::::::::::::::::::::::::: 294
19.3 nn Conguration ::::::::::::::::::::::::::::::::: 295
A A Null Printer Cable for PLIP 297
B Sample smail Conguration Files 298
C The GNU General Public License 306
C.1 Preamble ::::::::::::::::::::::::::::::::::::: 306
C.2 Terms and Conditions :::::::::::::::::::::::::::::: 307
CONTENTS 12
C.3 How to Apply These Terms ::::::::::::::::::::::::::: 311
Glossary 313
Annotated Bibliography 319
Books :::::::::::::::::::::::::::::::::::::::::: 319
General Books on the Internet ::::::::::::::::::::::::: 319
Administration Issues :::::::::::::::::::::::::::::: 319
The Background ::::::::::::::::::::::::::::::::: 321
HOWTOs :::::::::::::::::::::::::::::::::::::::: 322
What are Linux HOWTOs? ::::::::::::::::::::::::::: 322
Where to get Linux HOWTOs ::::::::::::::::::::::::: 322
HOWTO Index :::::::::::::::::::::::::::::::::: 323
Miscellaneous and Legalese ::::::::::::::::::::::::::: 324
RFCs :::::::::::::::::::::::::::::::::::::::::: 324
List of Figures
1.1 The three steps of sending a datagram from erdos to quark. ::::::: 22
2.1 Subnetting a class B network :::::::::::::::::::::::::: 36
2.2 A part of the net topology at Groucho Marx Univ. ::::::::::::: 38
2.3 A part of the domain name space ::::::::::::::::::::::: 43
2.4 An excerpt from the named.hosts le for the Physics Department. ::::: 47
2.5 An excerpt from the named.hosts le for GMU. ::::::::::::::: 48
2.6 An excerpt from the named.rev le for subnet 12. :::::::::::::: 49
2.7 An excerpt from the named.rev le for network 149.76. ::::::::::: 50
3.1 The relationship between drivers, interfaces, and the hardware. :::::: 52
5.1 Virtual Brewery and Virtual Winery { the two subnets. ::::::::::: 74
6.1 The named.boot le for vlager. ::::::::::::::::::::::::: 98
6.2 The named.ca le. :::::::::::::::::::::::::::::::: 104
6.3 The named.hosts le. :::::::::::::::::::::::::::::: 105
6.4 The named.local le. :::::::::::::::::::::::::::::: 106
6.5 The named.rev le. ::::::::::::::::::::::::::::::: 106
7.1 A sample dip script ::::::::::::::::::::::::::::::: 114
9.1 A sample /etc/inetd.conf le. ::::::::::::::::::::::::: 140
9.2 A sample /etc/rpc le. ::::::::::::::::::::::::::::: 145
10.1 Sample nsswitch.conf le. ::::::::::::::::::::::::::: 157
12.1 Interaction of Taylor UUCP Conguration Files. ::::::::::::::: 175
13
LIST OF FIGURES 14
15.1 sendmail Support Files. ::::::::::::::::::::::::::::: 236
15.2 A sample sendmail.m4 le for vstout. :::::::::::::::::::: 238
16.1 Usenet news ow through Groucho Marx University. :::::::::::: 262
17.1 News ow through relaynews. ::::::::::::::::::::::::: 267