home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / NetBSD / docs-netbsd / Networking-FAQ / nwf.txt (.txt) < prev    next >
GNU Info File  |  1994-11-27  |  65KB  |  1,300 lines

  1. This is Info file nwf.info, produced by Makeinfo-1.55 from the input
  2. file nwf.ti.
  3. This file documents the setup of networking with NetBSD-Amiga.
  4. Copyright (C) 1994 Hubert Feyrer.
  5. This info-file contains the NetBSD-Amiga Beginner's Guide to TCP/IP
  6. Networking and Networking-FAQ. This guide has been devided into several
  7. parts with each one having a somewhat different goal in mind.
  8. * Menu:
  9. * Preface::          Miscellaneous about this text.
  10. * Theory::           Theoretical introduction to most basic concepts.
  11. * Practice::         Applying the theory to NetBSD-Amiga
  12. * Advanced::         Some advanced features and how to set them up.
  13. * FAQs::             The *real* Networking-FAQ :-)
  14. Appendices:
  15. * Abbrevs::          A List of all the abbreviations used in the text.
  16. * References::       Some useful texts & books.
  17. Preface
  18. *******
  19. This guide was written to describe how TCP/IP networking is set up on an
  20. Amiga running NetBSD, a flavour of Unix. Therefore, whenever I mention
  21. Unix or NetBSD, NetBSD-Amiga is meant, if not otherwise stated.
  22. * Menu:
  23. * WarmWords::        Some warm words about the intention of the author and
  24.                      the prerequirements the reader needs.
  25. * Disclaimer::       Legal mumbo-jumbo.
  26. * AboutAuthor::      How to reach the author.
  27. Some warm words
  28. ===============
  29. This summary is intended to help people with little knowledge about
  30. networks to participate in that game. The reader is assumed to know
  31. about basic system administration tasks: how to become root, edit
  32. files, change permissions, stop processes, etc. See [AeleenFrisch] for
  33. further information on this topic.
  34. Besides that, you should know how to handle the utilities we're going to
  35. set up here, i. e. you should know how to use telnet, FTP, ... I will
  36. not explain the basic features of those utilities, please refer to the
  37. appropriate man-pages or to the references listed instead.
  38. This guide is devided into four chapters In the first one I'll try to
  39. introduce all the basic concepts which will be needed throughout the
  40. whole guide.  The second chapter shows the most basic steps to set up
  41. networking in practice, while chapter three explains how to set up some
  42. common network services.  The last chapter lists some frequently asked
  43. questions (FAQs) and answers to them.
  44. I write this guide with the intention in mind to give the unweary some
  45. basic knowledge. If you really want to know what's it all about, read
  46. [CraigHunt]. This book does not only cover the basics, but goes on and
  47. explains all the concepts, services and how to set them up in detail.
  48. It's great, I love it! :-)
  49. Disclaimer
  50. ==========
  51. I hereby refuse to take any responsibility for any mistakes and wrong
  52. information that is contained within this document.
  53. Any reprint is allowed, as long as the origin of the information and the
  54. author's name (mine :-) is stated. I'd like to get one issue then.
  55. Further distribution of this text is allowed as long as it remains
  56. unchanged.
  57. I'd also like to be informed if this is to be included on any PD-disks
  58. or CD-ROM-distributions.
  59. Furthermore, I'd be glad to hear any comments (good & bad) about this
  60. guide. Please (e)mail me!
  61. About the author
  62. ================
  63. SMail:
  64.      Hubert Feyrer
  65.      Bachstr. 40
  66.      84066 Mallersdorf
  67. Phone:
  68.      +49 (0)941 / 943-2415 (Work, best chances on weekdays)
  69.      +49 (0)941 / 701788 (Home on weekday's, rarely)
  70.      +49 (0)8772 / 6084 (Weekends)
  71. EMail:
  72.      `hubert.feyrer@rz.uni-regensburg.de'
  73. Theory
  74. ******
  75. In this first section, I'd like to give you some technical background
  76. and explain all the concepts, before actually starting to set up
  77. anything.
  78. * Menu:
  79. * Protocols::        The protocols supported by NetBSD.
  80. * AddressFormat::    TCP/IP address format.
  81. * SubnetRouting::    Subnetting and Routing.
  82. * t_NSConcepts::     Name service concepts.
  83. Protocols supported by NetBSD
  84. =============================
  85. There are several protocol suites supported by NetBSD. The first one
  86. implemented was DARPA's Transmission Control Protocoll/Internet
  87. Protocoll (TCP/IP). Shortly afterwards, the Xerox Network System (XNS)
  88. was added.  The last protocol suites -- parts of them still being
  89. implemented -- are the ISO protocol suite, CCITT X.25 and ARGO TP.
  90. Today, TCP/IP is the most widespread of the above. It's implemented on
  91. almost any hardware and operating system and it is also the most-used
  92. protocol in heterogenous environments. So, if you just want to connect
  93. your Amiga running NetBSD to some other machine at home, or you want to
  94. integrate it into your company's or university's network, TCP/IP is
  95. most probably the right choice.
  96. The Xerox Network System was only implemented at UCB to connect isolated
  97. machines to the net, and the ISO-protocols are by far not as widespread
  98. as TCP/IP, also their popularity grows.
  99. However, there are no such things as DECnet and Novell's NetWare for
  100. NetBSD-Amiga, though! These two protocols differ from the protocols
  101. mentioned above in that they are proprietary, in contrast to the
  102. others, which are well-defined in several RFCs and other open standards.
  103. * Menu:
  104. * IPoverSer::        Little issue on IP over serial lines.
  105. IP over serial lines
  106. --------------------
  107. TCP/IP can be used on a wide range of media, NetBSD-Amiga supports
  108. Ethernet and serial lines. There are three reasons for using a serial
  109. line protocol in preference to ethernet:
  110.    * It's almost impossible to get a A2065 or Ameristar board for an
  111.      Amiga.
  112.    * Your remote host is only reachable via telephone, so you have to
  113.      use your modem to access it.
  114.    * Every Amiga has a serial port (which you don't have to pay for)
  115.      and the cable you need is also cheaper than the one you need for
  116.      Ethernet.
  117. The disadvantage of a serial connection is, that you can connect only to
  118. one host, as no multi-serial boards (e.g. A2232) are supported (yet).
  119. Besides that, NetBSD can use at most 57,6kBd making it a lot slower
  120. than Ethernet's 10MBd.
  121. There are two possible protocols to connect a host running NetBSD-Amiga
  122. to another host using a serial line (possibly over a phone-line):
  123.    * Serial Line IP (SLIP)
  124.    * Point to Point Protocol (PPP)
  125. The choice here is mainly influenced by the host you want to connect to.
  126. If you want to connect to another Amiga, possibly running under
  127. AmigaOS, use SLIP, as this is supported by AS225, AmiTCP and NetBSD.
  128. Also, if you want to connect to a Linux box or (using your modem) to a
  129. terminal server or another unix box which offers SLIP, the choice is
  130. clear.
  131. Otherwise, if you want to connect to a host which only offers PPP, you
  132. can use that one.
  133. From my personal experiences, if I had the choice I'd prefer SLIP
  134. instead of PPP, as it's more difficult to get a connection with the
  135. latter one. With PPP, both sides do an initial handshake which is *very*
  136. easy to timeout if you do the startup by hand; with SLIP, there's no
  137. such initial handshake, i.e.  you start up one side, and when the
  138. othersite has its first packet, it will send it over the line.
  139. RFCs 1331 and 1332 describe PPP and TCP/IP over PPP. SLIP is defined in
  140. RFC 1055.
  141. TCP/IP address format
  142. =====================
  143. TCP/IP uses 4-byte (32-bit) addresses, also called IP-numbers
  144. (Internet-Protocol numbers).
  145. Those IP-numbers are worldwide unique. To assure this, they are
  146. administrated by one central organisation, the DDN Network Information
  147. Center. They give certain ranges of addresses (network-addresses)
  148. directly to sites which want to participate in the internet or to
  149. internet-providers, which give the addresses to their customers.
  150. If your university or company is connected to the Internet, it has (at
  151. least) one such network-address for it's own use.
  152. If you just want to run your private network at home, see below on how
  153. to "build" your own IP-numbers. However, if you want to connect your
  154. machine to the (real :-) internet, you should get an IP-number from
  155. your local network-administrator or -provider.
  156. When writing down IP-numbers, this is done in "dotted quad"-notation
  157. most of the time, i. e. the four bytes are written down in decimal (MSB
  158. first), separated by dots. For example, 132.199.15.99 would be a valid
  159. address.  Another way to write down IP-addresses would be as one 32-bit
  160. hex-word, e.g. 0x84c70f63. This is not as convenient as the
  161. dotted-quad, but quite useful at times, too. (See below!)
  162. Being assigned a network means nothing else but setting some of the
  163. above-mentioned 32 address-bits to certain values. These bits that are
  164. used for identifying the network are called network-bits. The remaining
  165. bits can be used to address hosts on that network, therefore they are
  166. called host-bits.
  167. In the above example, the network is 132.199.0.0 (host-bits are set to
  168. 0 in network-addresses), the host's address is 15.99 on that network.
  169. How do you know that the host's address is 16 bit wide? Well, there are
  170. four classes of networks. Each one starts with a certain bit-pattern
  171. identifying it. Here are the four classes:
  172.    * Class A starts with "0" as most significant bit. The next seven
  173.      bits  of a class A address identify the network, the remaining 24
  174.      bit can  be used to address hosts. So, within one class A network
  175.      there can be  2^24 hosts.  It's not very likely that you (or your
  176.      university, or  company, or whatever) will get a whole class A
  177.      address.
  178.    * Class B starts with "10" as most significant bits. The next 14 bits
  179.      are used for the networks address, the remaining 16 bits can be
  180.      used  to address more than 65000 hosts. Class B addresses are
  181.      usually given  to universities.
  182.      Returning to our above example, you can see that 132.199.15.99 (or
  183.      0x84c70f63, which is more appropriate here!) is on a class B
  184.      network,  as 0x84... = *10*00... (base 2).
  185.      Therefore, the address 132.199.15.99 can be split into an
  186.      network-address of 132.199.0.0 and an host-address of 15.99.
  187.    * Class C is identified by the MSBs being "110", allowing only 256
  188.      (actually: only 254, see below) hosts on each of the 2^21 possible
  189.      class C networks. Class C addresses are usually found at (small)
  190.      companies.
  191.    * There are also other addresses, starting with "111". Those are used
  192.      for special purposes (e. g. multicast-addresses) and are not of
  193.      interrest here.
  194. Please note that the bits which are used for identifying the
  195. network-class are part of the network-address.
  196. When seperating host-addresses from network-addresses, the "netmask"
  197. comes in handy. In this mask, all the network-bits are set to "1", the
  198. host-bits are "0". Thus, putting together IP-address and netmask with a
  199. locical AND-function, the network-address remains.
  200. To continue our example, 255.255.0.0 is a possible netmask for
  201. 132.199.15.99.  When applying this mask, the network-address
  202. 132.199.0.0 remains.
  203. By default, every network-class has a fixed netmask assigned:
  204. Class A:
  205.      default-netmask: 255.0.0.0, first byte of address: 1-127
  206. Class B:
  207.      default-netmask: 255.255.0.0, first byte of address: 128-191
  208. Class C:
  209.      default-netmask: 255.255.255.0, first byte of address: 192-223
  210. Another thing that should be mentioned here is the "broadcast-address".
  211. When sending to this address, *all* hosts on the corresponding network
  212. will receive the message sent. The broadcast address is characterized by
  213. having all host-bits set to "1".
  214. Taking 132.199.15.99 with its netmask 255.255.0.0 again, the
  215. broadcast-address would result in 132.199.255.255.
  216. You'll ask now: But what if I want a hosts address to be all bits "0"
  217. or "1"?  Well, this doesn't work, as network- and broadcast-address
  218. must be present!  Because of this, a class B network can contain at
  219. most 2^16-2 hosts, a class C network can hold no more than 254 hosts.
  220. Besides all those categories of addresses, there's the special
  221. IP-address 127.0.0.1 which always refers to the "local" host, i. e. if
  222. you talk to 127.0.0.1 you'll talk to yourself without starting any
  223. network-activity.  This is sometimes useful to use services installed
  224. on your own machine or to play around if you don't have other hosts to
  225. put on your network.
  226. Let's put together the things we've introduced in this section:
  227.    * IP-address:     32 bit-address, with network- and host-bits.
  228.    * Network-address:     IP-address with all host bits set to "0".
  229.    * Netmask:     32-bit mask with "1" for network- and "0" for
  230.      host-bits.
  231.    * Broadcast:     IP-address with all host bits set "1".
  232.    * The local host's IP-number is always 127.0.0.1.
  233. Subnetting and Routing
  234. ======================
  235. After talking so much about netmasks, network-, host- and other
  236. addresses, I have to admit that this is not the whole truth!
  237. Imagine the situation at your university, which usually has a class B
  238. address, allowing it to have up to 65534 hosts on that net. Maybe it
  239. would be a nice thing to have all those hosts on one single network,
  240. but it's simply not possible due to limitations in the transport media
  241. commonly used today!
  242. For example, when using thin wire ethernet, the maximum length of the
  243. cable is 185 meters. Even with repeaters in between, which refresh the
  244. signals, this is not enough to cover all the locations where machines
  245. are located.  Besides that, there is a maximum number of 1024 hosts on
  246. one ethernet wire, and you'll loose quite a bit of performance if you
  247. go to this limit.
  248. So, are you hosed now? Having an address which allows more than 60000
  249. hosts, but being bound to media which allows far less than that limit?
  250. Well, of course not! :-)
  251. The idea is to devide the "big" class B net into several smaller
  252. networks, commonly called sub-networks or simply subnets. Those subnets
  253. are only allowed to have, say, 254 hosts on them (i.e. you devide one
  254. big class B network into several class C networks!).
  255. To do this, you adjust your netmask to have more network- and less
  256. host-bits on it. This is usually done on a byte-boundary, but you're
  257. not forced to do it there! (I don't really know if NetBSDs networking
  258. software understands subnets on non-byte-boundaries; Linux' is said to
  259. have problems there) So, commonly your netmask will not be 255.255.0.0
  260. as supposed by a class B network, but it will be set to 255.255.255.0.
  261. This gives you one additional network-byte to assign to each (physical!)
  262. network. All the 254 hosts on that subnet can now talk directly to each
  263. other, and you can build 256 such class C nets. This should fit your
  264. needs.
  265. To explain this better, let's continue our above example. Let's have
  266. our host 132.199.15.99 (I'll call him DUSK from now; we'll talk about
  267. assigning hostnames later) have a netmask of 255.255.255.0 and thus
  268. being on the subnet 132.199.15.0. Let's furthermore introduce some more
  269. hosts so we have something to play around with:
  270.                                      ftp               cisco
  271.                                 132.199.1.202       132.199.1.8
  272.       Subnet 132.199.1.0     \        |                  |
  273.       Broadcast 132.199.1.255 >-------+--+---------------+------------
  274.       Netmask 255.255.255.0  /           |
  275.                                     132.199.1.33
  276.                                         rzi
  277.                                     132.199.15.1
  278.                                          |          / Subnet 132.199.15.0
  279.           ----+------------------+-------+---------<  Broadcast 132.199.15.255
  280.               |                  |                  \ Netmask 255.255.255.0
  281.         132.199.15.100      132.199.15.99
  282.              dawn               dusk
  283.                             132.199.15.98
  284.                                  |
  285.                                  |S
  286.                                  |L
  287.                                  |I
  288.                                  |P
  289.                                  |
  290.                             132.199.15.97
  291.                                 noon
  292. (Picture 1: This demo-network shows a part of the University of
  293. Regensburg's campus-wide network as of March 1st 1994. All hosts except
  294. noon are really there.)
  295. In the above network, DUSK can talk directly to DAWN, as they are both
  296. on the same subnet. (There are other hosts attached to the
  297. 132.199.15.0-subnet, I'm just too lazy to list them all ;-)
  298. But what, if DUSK wants to talk to a host on another subnet?
  299. Well, the traffic will then go through one or more gateways (routers),
  300. which are attached to two subnets. Because of this, a router always has
  301. two different addresses, one for each of the subnets. The router is
  302. functionally transparent, i. e. you don't have to address it to reach
  303. hosts on the "other" side.  Instead, you address that host directly and
  304. the packets will be routed to it correctly.
  305. Example. Let's say DUSK wants to get some files from the local
  306. ftp-server.  As DUSK can't reach FTP directly (because it's on a
  307. different subnet), all its packets will be forwarded to it's
  308. "defaultrouter" RZI (132.199.15.1), which knows where to forward the
  309. packets to.
  310. DUSK knows the address of it's defaultrouter in its network (RZI,
  311. 132.199.15.1), and it will forward any packets to it which are not on
  312. the same subnet, i.e. it will forward all IP-packets in which the third
  313. address-byte isn't 15.
  314. The (default)router then gives the packets to the appropriate host, as
  315. it's also on the FTP-server's network.
  316. In this example, *all* packets are forwarded to the 132.199.1.0-network,
  317. simply because it's the network's backbone, the most important part of
  318. the network, which carries all the traffic that passes between several
  319. subnets.  Almost all other networks besides 132.199.15.0 are attached
  320. to the backbone in a similar manner.
  321. But what, if we had hooked up another subnet to 132.199.15.0 instead of
  322. 132.199.1.0? Maybe something like this:
  323.      132.199.1.0 ----------------------+--------------------
  324.      (Backbone)                        |
  325.                                  132.199.1.33
  326.                                       rzi
  327.                                  132.199.15.1
  328.                                        |
  329.      132.199.15.0 -----------+---------+-----------+--------
  330.                              |                     |
  331.                        132.199.15.2          132.199.15.99
  332.                           route2                  dusk
  333.                        132.199.16.1
  334.                              |
  335.      132.199.16.0 -----------+------------------------------
  336. (Picture 2: Attaching one subnet to another one.)
  337. When you now want to reach a host which is located in the
  338. 132.199.16.0-subnet from DUSK, it won't work routing it to RZI, but
  339. you'll have to send it directly to ROUTE2 (132.199.15.2). DUSK will
  340. have to know to forward those packets to ROUTE2 and send all the others
  341. to RZI.
  342. When configuring DUSK, you tell it to forward all packets for the
  343. 132.199.16.0-subnet to ROUTE2, and all others to RZI. Instead of
  344. specifying this default as 132.199.1.0, 132.199.2.0, etc., 0.0.0.0 can
  345. be used to set the default-route.
  346. Returning to ***picture 1, there's a similar problem when DAWN wants to
  347. send to NOON, which is connected to DUSK via a serial line running.
  348. When looking at the IP-addresses, NOON seems to be attached to the
  349. 132.199.15.0-network, but it isn't really. Instead, DUSK is used as
  350. gateway, and DAWN will have to send its packets to DUSK, which will
  351. forward them to NOON then.
  352. The same goes when hosts from other subnets want to send to NOON. They
  353. have to send their packets to DUSK (possibly routed via RZI),
  354. Name service concepts
  355. =====================
  356. In the previous sections, when I talked about hosts, I referred to them
  357. by their IP-addresses. This was necessary to introduce the different
  358. kinds of addresses. When talking about hosts in general, it's more
  359. convenient to give them "names", as I did when talking about routing.
  360. Most applications don't care whether you give them an IP-number or an
  361. hostname.  However, they'll use IP-numbers internally, and there are
  362. several methods for them to map hostnames to IP-numbers, each one with
  363. its own way of configuration. In this section I'll introduce the idea
  364. behind each method, in the next chapter, I'll talk about the
  365. configuration-part.
  366. The mapping from hostnames (and domainnames) to IP-addresses is done by
  367. a piece of software called the "resolver". This is not an extra
  368. service, but some library routines which are linked to every
  369. application using networking-calls.  The resolver will then try to
  370. resolve (hence the name ;-) the hostnames you give into IP-numbers. See
  371. RFCs 1034 and 1035 for details on the resolver.
  372. Hostnames are usually up to 10 characters long, and contain letters,
  373. numbers, dashes ("-") and underscores ("_"); case is ignorred.
  374. Just as with networks and subnets, it's possible (and desirable) to
  375. group hosts into domains and subdomains. When getting your
  376. network-address, you also obtain a domainname by your provider. As with
  377. subnets, it's up to you to introduce subdomains. Other as with
  378. IP-addresses, (sub)domains are not directly related to (sub)nets; for
  379. example, one domain can contain several subnets.
  380. ***Picture 1 shows this: Both subnets 132.199.1.0 and 132.199.15.0 (and
  381. others) are part of the subdomain "RZ.UNI-REGENSBURG.DE". The domain
  382. the University of Regensburg got from it's IP-provider is
  383. "UNI-REGENSBURG.DE" (".DE" is for Deutschland, Germany), the subdomain
  384. "RZ" is for Rechenzentrum, computing center.
  385. Hostnames, subdomain- and domainnames are separated by dots ("."). It's
  386. also possible to use more than one stage of subdomains, although this
  387. is not very common. An example would be FOX_IN.SOCS.UTS.EDU.AU.
  388. A hostname which includes the (sub)domain is also called a fully
  389. qualified domain name (FQDN). For example, the IP-address 132.199.15.99
  390. belongs to the host with the FQDN DUSK.RZ.UNI-REGENSBURG.DE.
  391. Further above I told you that the IP-address 127.0.0.1 always belongs
  392. to the local host, regardless what's the "real" IP-address of the host.
  393. Therefore, 127.0.0.1 is always mapped to the name "LOCALHOST".
  394. The three different ways to translate hostnames into IP-numbers are:
  395. * Menu:
  396. * t_hosts::          /etc/hosts
  397. * t_DNS::            Domain Name Service (DNS)
  398. * t_YP::             Yellow Pages (YP)
  399. `/etc/hosts'
  400. ------------
  401. The first and most simplest way to translate hostnames into
  402. IP-addresses is by using a table telling which IP-number belongs to
  403. which hostname(s). This table is stored in `/etc/hosts' and has the
  404. following format:
  405.      <IP-address>    <hostname> [<nickname> [...]]
  406. Lines starting with a hash mark ("#") are treated as comments. The
  407. other lines contain one IP-address and the corresponding hostname(s).
  408. It's not possible for a hostname to belong to several IP-numbers, even
  409. if I made you think so when talking about routing. RZI for example has
  410. really two distinct names for each of its two addresses: RZI and RZIA
  411. (but please don't ask me which name belongs to which address!).
  412. Giving a host several nicknames can be convenient if you want to
  413. specify your favourite host providing a special service with that name,
  414. as is commonly done with FTP-servers. The first (leftmost) name is
  415. usually the real (canonical) name of the host.
  416. Besides giving nicknames, it's also convenient to give a host's full
  417. name (including domain) as its canonical name, and using only its
  418. hostname (without domain) as a nickname.
  419. *Important:* There *must* be an entry mapping localhost into 127.0.0.1!
  420. The Domain Name Service (DNS)
  421. -----------------------------
  422. `/etc/hosts' bears an inherent problem, especially in big networks:
  423. when one host is added or one hosts's address changes, all the
  424. `/etc/hosts'' on all machines have to be changed! This is not only
  425. time-consuming, it's also very likely that there will be some errors and
  426. inconsistencies, leading to problems.
  427. Another appoach is to hold only one hostnames-table (-database) for a
  428. network, and make all the clients query that "name-server". Updates
  429. will be made only on the name-server.
  430. This is the basic idea behind the Domain Name Service (DNS).
  431. Usually, there's one name-server for each domain (hence DNS), and every
  432. host (client) in that domain knows which domain it is in and which DNS
  433. to query for its domain.
  434. When the DNS gets a query about an host which is not in its domain, it
  435. will forward the query to a DNS which is either the DNS of the domain
  436. in question or knows which DNS to ask for the specified domain. If the
  437. DNS forwarded the query doesn't know how to handle it, it will forward
  438. that query again to a DNS one step higher. This is not ad infinitum,
  439. there are several "root"-servers, which know about any domain.
  440. Network Information Service (NIS) / Yellow Pages (YP)
  441. -----------------------------------------------------
  442. Yellow Pages (YP) was invited by Sun Microsystems. The name has been
  443. changed into Network Information Service (NIS) because YP was already a
  444. trademark of the british telecom. So, when I'll talk about NIS you'll
  445. know what I'm talking about. ;-)
  446. There are quite some configuration files on a unix-system, and often
  447. it's desired to maintain only one set of those files for a couple of
  448. hosts. Those hosts are grouped together in a NIS-domain (which has
  449. *nothing* to do with the domains built by using DNS!) und are usually
  450. contained in one workstation cluster.
  451. Examples for the config-files shared among those hosts are
  452. `/etc/passwd', `/etc/group' and -- last but not least -- `/etc/hosts'.
  453. So, you can "abuse" NIS for getting a unique name-to-address-translation
  454. on all hosts throughout one (NIS-)domain.
  455. There's only one drawback, which prevents NIS from actually being used
  456. for that translation: In contrast to the DNS, NIS provides no way to
  457. resolve hostnames which are not in the hosts-table. There's no hosts
  458. "one level up" which the NIS-server can query, and so the translation
  459. will fail! (Suns NIS+ seems to take measures against that problem, but
  460. as NIS+ is only available on Solaris-systems, this is of little use for
  461. us now.)
  462. Don't get me wrong: NIS is a fine thing for managing e.g.
  463. user-information (`/etc/passwd', ...) in workstation-clusters, it's
  464. simply not useful for resolving hostnames!
  465. Practice - Essential setup
  466. **************************
  467. In the previous chapter I've introduced all the basic concepts necessary
  468. for setting up networking even in non-trivial environments. Here, I will
  469. show you how to bring your machine up to use networking-applications
  470. such as finger, FTP and telnet.
  471. Throughout this chapter, I'll use DUSK (see ***Picture 1) as an example
  472. for a host hooked up to an ethernet based network, and the connection
  473. between DUSK and NOON will show how to set up PPP and SLIP.
  474. The following steps are described in this chapter:
  475. * Menu:
  476. * Requirements::     What you need before actually starting.
  477. * IfConfig::         Configuring the interface.
  478. * Routing::          How to set up routing.
  479. * p_NSConcepts::     Translating hostnames to IP-numbers.
  480. * UseOnEtc::         How to use the above on `/etc/*'
  481. Requirements
  482. ============
  483. There are several things which are needed to do networking. Most
  484. significant is -- of course -- the hardware you'll use. This has impact
  485. on all the other things, mainly the packages you've to compile into your
  486. kernel and the informations you need to get everything running.
  487. * Menu:
  488. * Hardware::         Hardware requirements.
  489. * Kernel::           Options to compile into /vmunix.
  490. * Addresses::        All kind of addresses you need.
  491. Hardware
  492. --------
  493. There are two possible types of networking hardware:
  494. * Menu:
  495. * Ethernet::         Ethernet.
  496. * SerLine::          Serial Line.
  497. Ethernet
  498. ........
  499. There are drivers available for NetBSD-Amiga for the following
  500. Ethernet-cards:
  501.    * Commodore A2065
  502.    * Ameristar Board (sorry, don't know exact type)
  503. The significant thing with ethernet is, that it uses a
  504. broadcast-medium, i.e.  there can be several hosts attached to one
  505. cable.
  506. Serial line
  507. ...........
  508. In order to use TCP/IP over a serial line, you only need a null modem.
  509. Here's how the pins are connected on the cable I use:
  510.       2 <--->   3
  511.       3 <--->   2
  512.       4 <--->   5
  513.       5 <--->   4
  514.       6 <--->  20
  515.       7 <--->   7
  516.       8 <--->  20
  517.      20 <---> 6+8
  518. This cable has proved to work with SLIP and PPP, as well as for using
  519. the other side as simple dumb terminal.
  520. Kernel-requirements
  521. -------------------
  522. Here are the necessary changes for `.../conf/MACHINE' in order to
  523. incorporate the various networking-facilities into your kernel:
  524.    * Enable TCP/IP networking in general:
  525.           option         INET            # Basic networking support - mandatory
  526.           pseudo-device  LOOP            # Loopback network - mandatory
  527.    * Put this entry in if you want to run SLIP:
  528.           pseudo-device  sl      1       # Serial Line IP (SLIP)
  529.    * This one is needed to do PPP:
  530.           pseudo-device  ppp     1       # Point-to-Point-Protocol (PPP)
  531.    * If you're proud owner of a Ameristar or Commodore A2065
  532.      Ethernet-card, add the following two items:
  533.           pseudo-device  ether           # Ethernet support
  534.           device le0     at manufacturer ?       product ?
  535.    * Enable the following two options, if you want to run your system as
  536.      NFS-client or -server:
  537.           option         NFSSERVER       # NFS server side code
  538.           option         NFSCLIENT       # NFS client side code
  539. All those options are already included in the GENERIC kernel. They are
  540. listed here rather as an hint for those who want to known what to
  541. *exclude* from a kernel. Leaving out all the networking stuff should
  542. save you about 300-500k of memory, but please note that e.g. X needs
  543. TCP/IP networking facilities.
  544. Addresses: IP, Broadcast, Netmask, ...
  545. --------------------------------------
  546. If you're about to hook your machine up to your company's, school's or
  547. university's network (i.e. most probably the real Internet :), go to
  548. your local network-administrator and get the following informations:
  549.    * your IP-Number
  550.    * your host's name, including domain.
  551.    * Netmask
  552.    * Broadcast-address
  553.    * Defaultrouter (IP-number)
  554.    * Nameserver (primary and secondary)
  555. If you're about to use SLIP or PPP, possibly via a telephone line,
  556. you'll probably need the following informations:
  557.    * Phone-number of your terminal-server
  558.    * Account, password etc. to get access to your terminal-server
  559.    * IP-number(s) of the terminal-server's dial-ins
  560. If you just want to run your own little LAN at home, you can choose your
  561. own values for most of the things above:
  562. IP-number:
  563.      Choose an IP-number from either class B or C. As you're isolated
  564.      from the  internet, it doesn't really matter what address(es) you
  565.      choose, as long as  they are valid addresses (*note TCP/IP address
  566.      format: AddressFormat.).
  567.      If you choose a couple of addresses, please pay attention that
  568.      they are  all in the same (sub)net! (*note Subnetting and Routing:
  569.      SubnetRouting.)
  570. Hostname:
  571.      Any valid hostname you like, see *Note Name service concepts
  572.      (Theory): t_NSConcepts.
  573.      You'd better not choose a domainname because you'll only have to
  574.      type  longer hostnames (and believe me, you'll have to type those
  575.      hostnames  quite some times during tuning your network! :-).
  576. Netmask:
  577.      Determine this one according to the rules from *Note TCP/IP
  578.      address format: AddressFormat. As you surely don't want to invent
  579.      subnets, the netmask goes hand in hand with the IP-number(s) you
  580.      choose.
  581. Broadcast-address:
  582.      If there's no 4.2BSD-system on your network, determine your
  583.      broadcast-address after the rules stated in *Note TCP/IP address
  584.      format: AddressFormat, i.e. set all host-bits to "1".
  585.      If you've got one or more 4.2BSD-systems on your network, you've
  586.      to pay  attention to set the right broadcast-address, as 4.2BSD
  587.      has a bug in its  networking code, concerning the broadcast
  588.      address.  This bug forces you to  set all host-bits in the
  589.      broadcast-address to "0"!!!
  590. Defaultrouter:
  591.      Most probably not needed at home.
  592. Nameserver:
  593.      You don't need this for the first steps, and most probably you
  594.      won't set  up DNS at home. *Note Domain Name Service (Theory):
  595.      t_DNS, for some details.
  596. To illustrate this, I'll give you the addresses for DUSK and for
  597. connecting DUSK and noon.
  598. Example 1: DUSK
  599.    - IP-number: 132.199.15.99
  600.    - Netmask: 255.255.255.0
  601.    - Broadcast: 132.199.15.255
  602.    - Name: DUSK.RZ.UNI-REGENSBURG.DE
  603.    - Defaultrouter: 132.199.15.1 (RZI.RZ.UNI-REGENSBURG.DE)
  604.    - Nameserver(1): 132.199.1.2
  605.    - Nameserver(2): 132.199.1.1
  606. I got all these values from the local network admin. As the system is
  607. connected to the internet, I use the University of Regensburg's class C
  608. network (132.199.0.0) and their domainname (UNI-REGENSBURG.DE).
  609. Example 2: DUSK & noon
  610.    * DUSK:
  611.         - IP-number: 132.199.15.98
  612.         - Broadcast: 132.199.15.255
  613.         - Name: DUSK
  614.    * noon:
  615.         - IP-number: 132.199.15.97
  616.         - Broadcast: 132.199.15.255
  617.         - Name: noon
  618. I used the second setup at home, with no connection to the internet.
  619. Therefore, I have chosen neither domainname nor defaultrouter or
  620. nameserver. (I choose those IP-numbers for the case that I'm going to
  621. hook up noon to the net, just for fun :-).
  622. Configuring the interface
  623. =========================
  624. I'll tell you here what's to do to get up your network connection. I'll
  625. tell you how you can set this up permanently in `/etc/rc' etc. later,
  626. see *Note How to use on `/etc/*': UseOnEtc.
  627. Before configuring any network-device, let's first configure the
  628. loopback device:
  629.      # ifconfig lo0 inet 127.0.0.1
  630. By now, you should be able to ping 127.0.0.1.
  631. Next, we'll configure the hardware we have:
  632. * Menu:
  633. * ConfEth::          Ethernet-board.
  634. * ConfSer::          Serial line.
  635. Configuring your ethernet-board
  636. -------------------------------
  637. Enter the following:
  638.      # ifconfig le0 inet <ip-number> netmask <netmask> broadcast <broadcast>
  639. For example, I can use the following commands to configure DUSK:
  640.      # ifconfig le0 inet 132.199.15.99 netmask 255.255.255.0 \
  641.                     broadcast 132.199.15.255
  642. If you've got a defaultrouter on your network, route all unknown
  643. packets to it:
  644.      # route add default <defaultrouter-ip>
  645.      # route add default 132.199.15.1
  646. After that, you can try to reach several hosts on the local and other
  647. networks with the ping-command. Here's what I did on DUSK to check if
  648. everything's fine (please refer to ***Picture 1):
  649.      # ping 132.199.15.99            # dusk.rz.uni-regensburg.de
  650.      # ping 132.199.15.100           # dawn.rz.uni-regensburg.de
  651.      # ping 132.199.15.1             # rzi.rz.uni-regensburg.de
  652.      # ping 132.199.1.202            # ftp.uni-regensburg.de
  653.      # ping 128.252.135.4            # wuarchive.wustl.edu
  654. Setting up serial protocols
  655. ---------------------------
  656. Here, I'll tell you how to set up NetBSD for dial-out, either on
  657. directly connected machines or via modem.
  658. Any hints for how to setup dial-in welcome (`sliplogin', ...)!
  659. Before you start setting up anything, be sure to kill your getty first:
  660.   1. comment out the line starting with `/dev/tty00' in  `/etc/ttys'
  661.   2. Get the kernel to read the new `/etc/ttys': `kill -HUP 1'
  662.   3. Kill any still-running gettys: `kill -9 `ps -aux | grep  gett[y] |
  663.      awk '{ print $2; }'`'
  664. Available protocols over serial lines are:
  665. * Menu:
  666. * PPP::              Point-to-Point-Protocol (PPP).
  667. * SLIP::             Serial Line Internet Protocol (SLIP).
  668. * term::             term.
  669. Point to Point Protocol (PPP)
  670. .............................
  671. Here's what Markus Landgraf
  672. (`landgraf@crunch.ikp.physik.th-darmstadt.de') does:
  673.   1. ifconfig ppp0
  674.           # ifconfig ppp0 inet <local-ip> -arp -trailer <remote-ip>
  675.   2. Connect to remote machine via kermit:
  676.           kermit> set line /dev/tty00
  677.           kermit> set speed 9600           # or whatever
  678.           kermit> set flow rts/cts
  679.           kermit> connect
  680.      If your're using a modem, you'll have to dial before connecting:
  681.           kermit> dial <your terminal-server's phone number>
  682.      Log into your remote machine and start `dplogin', `pppd' or
  683.      whatever's used to start PPP on the remote site.
  684.      After that (when you get weird chars on your display) terminate
  685.      kermit  (CTRL-\ q) and perform the next step *fast* to avoid a
  686.      timeout.
  687.   3. run pppd
  688.           # pppd /dev/tty00 9600
  689.   4. ppp0 up
  690.           # ifconfig ppp0 up
  691.   5. Turn on routing:
  692.           # route add 0.0.0.0 <remote-ip>
  693.   6. ping some remote site, see *Note Configuring your ethernet-board:
  694.      ConfEth.  Those pings should  succeed.
  695. Serial Line IP (SLIP)
  696. .....................
  697. The steps for SLIP are basically the same:
  698.   1. Configure sl0:
  699.           # ifconfig sl0 inet <local-ip> -arp -trailers <remote-ip>
  700.   2. Connect to remote machine via kermit:
  701.           kermit> set line /dev/tty00
  702.           kermit> set speed 9600           # or whatever
  703.           kermit> set flow rts/cts
  704.           kermit> connect
  705.      If your're using a modem, you'll have to dial before connecting:
  706.           kermit> dial <your terminal-server's phone number>
  707.      Log into your remote machine's SLIP-account or start SLIP  by hand
  708.      (using `slattach' or such; please consult your  network-admin!).
  709.      After that (when you get weird chars on your display) terminate
  710.      kermit.
  711.   3. Start up the local SLIP service:
  712.           # slattach -s 9600 /dev/tty00
  713.   4. Enable the network connection
  714.           # ifconfig sl0 inet up
  715.   5. Turn on routing:
  716.           # route add 0.0.0.0 <remote-ip>
  717.   6. ping some remote site, see *Note Configuring your ethernet-board:
  718.      ConfEth. Those pings should  succeed.
  719. You can use higher baud-rates than 9600 on both, PPP and SLIP. NetBSD
  720. supports baud-rates up to 38400Bd.
  721. As I don't own a modem, I haven't made any experiences with term, sorry.
  722. From what I know, term is not really a method to do TCP/IP, but rather
  723. to tunnel TCP/IP-packets over a serial line using its own protocol and
  724. some own servers on both sides. Markus Wild's comment on term: "A
  725. Linux-beast".
  726. Anybody who likes to put some wise words here, please contact me
  727. (first)!
  728. Routing
  729. =======
  730. Let's talk one more word about routing. When running SLIP or PPP, it's
  731. sufficient to have a `route add default <remote-ip>' somewhere.
  732. However, if you want to hook up your machine to a more complex network,
  733. it's wise to use `routed' instead of static routes. Therefore, set
  734. `routed_flags' to `"-q"' in `/etc/netstart' then, and it will listen
  735. for routing-updates.
  736. If you are a gateway yourself (e.g. SLIP/PPP-Ethernet), set
  737. `routed_flags' to `""' instead to advertise that route.  Also, if there
  738. are several gateways on your network, put information about them into
  739. `/etc/gateways'.
  740. For example, when DUSK is the SLIP-gateway for NOON (see ***Picture 1),
  741. I set `routed_flags' to `""' and put the following into DUSKs
  742. `/etc/gateways':
  743.      host    132.199.15.97   gateway 132.199.15.98   metric 1 active
  744. This example establishes a route to NOON (132.199.15.97) via DUSKs
  745. SLIP-interface (132.199.15.98). "`metric 1'" says that NOON is one hop
  746. away from DUSK, i.e. that it's directly connected.
  747. Translating names to IP-numbers
  748. ===============================
  749. At this point, you should be able to use all TCP/IP-applications such
  750. as ftp, telnet, etc. But up to now, you have to specify all hosts by
  751. their IP-number, which is not very convenient. So, here are the
  752. different ways to set up IP-to-name-resolving.
  753. * Menu:
  754. * p_hosts::          /etc/hosts
  755. * p_DNS::            Domain Name Service (DNS)
  756. * p_YP::             Yellow Pages (YP)
  757. `/etc/hosts'
  758. ------------
  759. As explained previously (*note `/etc/hosts': t_hosts.), `/etc/hosts'
  760. contains a table telling which hostname to map to which IP-number.
  761. If you plan to use DNS, you will nevertheless have at least entries for
  762. localhost (127.0.0.1), your hostname (with it's own IP-number) and maybe
  763. the defaultrouter in `/etc/hosts'.
  764. For example, here's a minimal `/etc/hosts' for DUSK:
  765.      # /etc/hosts
  766.      127.0.0.1       localhost
  767.      132.199.15.99   dusk
  768. Besides these two entries, it's convenient to put any hosts into it
  769. which your system relies on, e.g. NFS-servers. This way, you can reach
  770. those hosts even during boot-time or if DNS is down.
  771. But, if you're just running your pri64te network at home, it's
  772. sufficient to put all your hostnames in `/etc/hosts', there's no need
  773. to set up DNS at home!
  774. Domain Name Service (DNS)
  775. -------------------------
  776. The Domain Name Service is the usual way to resolve IP-numbers from
  777. hostnames in larger networks. All you have to know to set it up is your
  778. domainname and the nameserver's (and maybe it's secondaries, if any)
  779. IP-numbers. Put all these informations into `/etc/resolv.conf':
  780.      # Example /etc/resolv.conf
  781.      domain your.domain.here
  782.      nameserver <primary-IP>
  783.      nameserver <secondary-ip>
  784. As an example, here's DUSKs `/etc/resolv.conf':
  785.      # dusk's /etc/resolv.conf
  786.      domain rz.uni-regensburg.de
  787.      nameserver 132.199.1.2
  788.      nameserver 132.199.1.1
  789. This file is all that's necessary to use DNS.
  790. Network Information Service (Yellow Pages)
  791. ------------------------------------------
  792. Sorry, I haven't tried NetBSD's NIS yet. If anyone did, please tell me!
  793. Besides that, there's no server-code for NetBSD, so you need another
  794. machine, which is able to run a NIS-server.
  795. How to use the above on `/etc/*'?
  796. =================================
  797. Now, as you know how to set up everything by hand, I'll tell you how to
  798. use that knowledge to change the config-files to get all
  799. networking-services started at boot-time.
  800. I want to go through the following files from `/etc' and show you what
  801. you need and what it's good for:
  802. * Menu:
  803. * e_netstart::       `/etc/netstart'.
  804. * e_rc::             `/etc/rc'.
  805. * e_rclocal::        `/etc/rc.local'.
  806. This is Info file nwf.info, produced by Makeinfo-1.55 from the input
  807. file nwf.ti.
  808. This file documents the setup of networking with NetBSD-Amiga.
  809. Copyright (C) 1994 Hubert Feyrer.
  810. `/etc/netstart'
  811. ---------------
  812.      #!/bin/sh -
  813.      #
  814.      #       @(#)netstart   5.9 (Berkeley) 3/30/91
  815.      #       $Id: netstart,v 1.15 1994/01/10 16:57:24 mycroft Exp $
  816.      
  817.      # set these to "NO" to turn them off.  otherwise, they're used as flags
  818.      routed_flags=NO         # for 'normal' use: routed_flags=-q
  819. As stated before, the following rules apply to `routed_flags':
  820.    * `NO': no need for routed if you're hooked up via SLIP or PPP.
  821.    * `"-q"': Useful if you've got a Ethernet-card and you are hooked
  822.        up to a non-trivial network (i.e. there's at least one gateway,
  823.      ...)
  824.    * `""': Use this if your machine's a gateway itself.
  825.      rarpd_flags=NO          # for 'normal' use: rarpd_flags="-a"
  826. If you want to become a RARP-server (Reverse Address Resolution
  827. Protocol, converts Ethernet- to IP-addresses; see RFC903), enable this.
  828. Do this only if you know what you do, and read `rarpd'(8) before!
  829.      bootparamd_flags=NO     # for 'normal' use: bootparamd_flags=""
  830. Set this to `""' to run the bootparamd-RPC-service which is needed for
  831. remote boot of diskless clients. Do this only if you know what you do,
  832. and read `rpc.bootparamd'(8) before!!!
  833.      sendmail_flags=NO       # for 'normal' use: sendmail_flags="-bd -q30m"
  834. If you want to send and receive mail, you'll need to set this to `"-bd
  835. -q30m"' or any appropriate settings that fit your needs. You will also
  836. need a properly configured `/etc/sendmail.cf' for this to run.
  837. *Warning!* If you're not on your own network, please consult your
  838. postmaster before doing anything fatal. It's *very* easy to produce
  839. mailloops etc. which can blow your whole site's mailsystem!!!
  840.      timed_flags=NO
  841. Leave this at `"NO"', it doesn't help anyway.
  842. The `timed' is thought to keep all the clocks on a network in sync, but
  843. it doesn't help with that CIA-timer-inaccuracy in NetBSD-Amiga (744).
  844.      # set the following to "YES" to turn them on, "NO" to disable.
  845.      rwhod=NO
  846. Set this to `NO'. `rwhod' is good for burning quite some CPU-cycles to
  847. tell other hosts on your network who's logged on. Set to `"YES"' if you
  848. want to be able to use `rwho' anyway.
  849.      nfs_server=YES
  850. This is useful if you've got some directories to export to other
  851. machines via NFS. If you do so, set it to `YES'. If you want to mount
  852. your own disks via NFS (which is quite nonsense, but nevertheless
  853. possible), do so, too.
  854. Set it to `NO' otherwise. E.g. it's *definitely* no fun to do
  855. NFS-mounts via a SLIP- or PPP-link, as this will be dead slow.
  856.      nfs_client=YES
  857. If there's a host on your network which disks you want to use or you
  858. want to mount your own disks (see above), set this to `YES'. Set to
  859. `NO' otherwise.
  860.      name_server=NO
  861. Leave at `"NO"' unless you know how to set up your own nameserver. See
  862. [CraigHunt] for details.
  863.      gated=NO
  864. Leave at `"NO"'.
  865. This is a replacement for routed which is only useful in very complex
  866. network-setups, e. g. if you need to set up wide-area networking (WAN).
  867.      kerberos_server=NO
  868. I've never used this, so you can most probably live without it, too.
  869. Set to `YES' if your site depends on Kerberos-security.
  870.      amd=NO
  871. If you're a NFS-client and don't want to mount all the remote disks all
  872. the time, you can mount them "on demand" using the Auto Mount Daemon
  873. `amd'.
  874. If you want to use this, read `amd''s man-page.
  875.      # miscellaneous other flags
  876.      # gated_flags only used if gated == YES
  877.      gated_flags=
  878. If you need to use `gated', put the appropriate flags for it to run
  879. here.
  880.      # /etc/myname contains my symbolic name
  881.      #
  882.      hostname=`cat /etc/myname`
  883.      hostname $hostname
  884. Put your host's name without domain into `/etc/myname', e.g. `echo dusk
  885. >/etc/myname'
  886.      if [ -f /etc/defaultdomain ]; then
  887.              domainname `cat /etc/defaultdomain`
  888.      fi
  889. This is only used by NIS/YP, so if you're about to use NIS, put the
  890. name of your NIS-domain into `/etc/defaultdomain', e.g. `echo
  891. nis1.rz.uni-regensburg.de >/etc/defaultdomain'.
  892. *Beware!* The domainname used here has *nothing* to do with the domain
  893. introduced by the domain name service (DNS)!
  894.      # configure all of the interfaces which we know about.
  895.      # do this by reading /etc/hostname.* files, where * is the name
  896.      # of a given interface.
  897.      #
  898.      # these files are formatted like the following, but with no # at the
  899.      # beginning of the line
  900.      #
  901.      # addr_family hostname netmask broadcast_addr options
  902.      # dest dest_addr
  903.      #
  904.      # addr_family is the address family of the interface, generally inet
  905.      # hostname is the host name that belongs to the interface, in /etc/hosts.
  906.      # netmask is the network mask for the interface.
  907.      # broadcast_addr is the broadcast address for the interface
  908.      # options are misc. options to ifconfig for the interface.
  909.      #
  910.      # dest is simply the string "dest" (no quotes, though) if the interface
  911.      # has a "destination" (i.e. it's a point-to-point link, like SLIP).
  912.      # dest_addr is the hostname of the other end of the link, in /etc/hosts
  913.      #
  914.      # the only required contents of the file are the addr_family field
  915.      # and the hostname.
  916.      
  917.      (
  918.          tmp="$IFS"
  919.          IFS="$IFS."
  920.          set -- `echo /etc/hostname.*`
  921.          IFS=$tmp
  922.          unset tmp
  923.      
  924.          while [ $# -ge 2 ] ; do
  925.              shift            # get rid of "hostname"
  926.              (
  927.                  read af name mask bcaddr extras
  928.                  read dt dtaddr
  929.      
  930.                  if [ ! -n "$name" ]; then
  931.                      echo "/etc/hostname.$1: invalid network configuration file"
  932.                      exit
  933.                  fi
  934.      
  935.                  cmd="ifconfig $1 $af $name "
  936.                  if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
  937.                  if [ -n "$bcaddr" ]; then cmd="$cmd broadcast $bcaddr"; fi
  938.                  cmd="$cmd $extras"
  939.                  if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi
  940.      
  941.                  $cmd
  942.              ) < /etc/hostname.$1
  943.              shift
  944.          done
  945.      )
  946. First, please note that the order of arguments of the
  947. `ifconfig'-command, which are built here, might be different in your
  948. `/etc/netstart'. Put them in the above order (using your favourite
  949. editor), paying special attention that the destination-address (if any)
  950. is the last option to the ifconfig-command, after those extra-options!!!
  951. Here's what `diff' says:
  952.      *** /usr/src/current/etc/netstart       Thu Feb  3 20:35:52 1994
  953.      --- /etc/netstart       Mon Mar 14 12:27:35 1994
  954.      ***************
  955.      *** 73,83 ****
  956.                    fi
  957.      
  958.                  cmd="ifconfig $1 $af $name "
  959.      -           if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi
  960.                  if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
  961.                  if [ -n "$bcaddr" ]; then cmd="$cmd broadcast $bcaddr"; fi
  962.                  cmd="$cmd $extras"
  963.      --- 73,84 ----
  964.                  if [ -n "$mask" ]; then cmd="$cmd netmask $mask"; fi
  965.                  if [ -n "$bcaddr" ]; then cmd="$cmd broadcast $bcaddr"; fi
  966.                  cmd="$cmd $extras"
  967.      +           if [ "${dt}" = "dest" ]; then cmd="$cmd $dtaddr"; fi
  968.      
  969.                  $cmd
  970.                ) < /etc/hostname.$1
  971. After that, create appropriate files `/etc/hostname.*', which describe
  972. your network-device(s):
  973. Ethernet:
  974.      Put the following into `/etc/hostname.le0':
  975.           inet <hostname> <netmask> <broadcast>
  976.           dest
  977. SLIP:
  978.      Put the following into `/etc/hostname.sl0':
  979.           inet <local-hostname> <netmask> <broadcast>
  980.           dest <remote-hostname>
  981.      Put the following into `/etc/hostname.ppp0':
  982.           inet <local-hostname> <netmask> <broadcast>
  983.           dest <remote-hostname>
  984. Note also that both, the local and the remote host together with their
  985. IP-numbers must be in `/etc/hosts', as the resolver and default-router
  986. are not known at that time (and which you need to use the DNS).
  987.      # set the address for the loopback interface
  988.      ifconfig lo0 inet localhost
  989.      
  990.      # use loopback, not the wire
  991.      route add $hostname localhost
  992. As the comments say, this configures the loopback-device (127.0.0.1,
  993. localhost), so don't forget this in `/etc/hosts'. Furthermore, packets
  994. which are sent to `$hostname' will go to straight back instead of using
  995. any Ethernet, PPP- or SLIP-device.
  996.      # /etc/mygate, if it exists, contains the name of my gateway host
  997.      # that name must be in /etc/hosts.
  998.      if [ -f /etc/mygate ]; then
  999.              route add default `cat /etc/mygate`
  1000.      fi
  1001. If you're on a subnetted network, here's the chance to set up your
  1002. default-router when booting up: just put it's name into `/etc/mygate'.
  1003. For example, on DUSK (see ***Picture 1) I did `echo 132.199.15.1
  1004. >/etc/mygate'.
  1005. Note that you can use a hostname here, but it has to be in `/etc/hosts',
  1006. as the nameserver is most probably not in your subnet and thus wouldn't
  1007. be reachable at boottime to resolve the router's name.
  1008. `/etc/rc'
  1009. ---------
  1010. There's only NIS left, for which there isn't a flag yet:
  1011.      if [ -f /usr/sbin/ypbind -a -d /var/yp ]; then
  1012.              echo -n ' ypbind';              ypbind
  1013.      fi
  1014. This is only started if the directory `/var/yp' exists. As there need
  1015. to be several config- and datafiles in this directory in order to have a
  1016. working NIS, be sure that you know what you do when creating `/var/yp'.
  1017. `/etc/rc.local'
  1018. ---------------
  1019. Besides starting local daemons, `/etc/rc.local' is useful for either
  1020. starting `pppd' or `slattach'. In order to not block any
  1021. networking-services that are also started in `/etc/rc.local', the
  1022. corresponding command should occur quite early, best place is after
  1023. `/etc/motd' is generated.
  1024. Configure `/etc/hostname.ppp0' or `/etc/hostname.sl0' and `/etc/mygate'
  1025. as described above. Also, change the baudrate to fit your needs.
  1026. SLIP:
  1027.      In order to start up SLIP at boottime, insert the following lines
  1028.      into  `/etc/rc.local':
  1029.           # Start SLIP-networking
  1030.           echo -n 'Preparing SLIP-interface ... '
  1031.           slattach 9600 /dev/tty00 >/dev/null 2>&1
  1032.           echo -n 'ready.'
  1033.      This should work, although I've never tried it:
  1034.           # Start PPP-networking
  1035.           echo -n 'Preparing PPP-interface ... '
  1036.           pppd /dev/tty00 9600
  1037.           echo -n 'ready.'
  1038.      The big problem that stays with PPP is that you've to start it up
  1039.      on  the other side at (exactly) the same time, and there must no
  1040.      timeout  occur in order to get a connection. Use SLIP if this is a
  1041.      problem.
  1042. Note that there's barely a way to dial out during boot-time, so the
  1043. above mainly belongs to direct (nullmodem) connections.
  1044. Advanced features and how to set them up
  1045. ****************************************
  1046. I'd like to explain how to set up the following services here:
  1047. * Menu:
  1048. * FTP::              Anonymous File Transfer Protocol (FTP).
  1049. * NFS::              Network File System (NFS).
  1050. * rTools::           The Berkeley r-tools.
  1051. * X11::              The X Window System.
  1052. * DNS::              The Domain Name Service (DNS).
  1053. * Mail::             Electronic Mail.
  1054. * RemPrint::         Remote printing.
  1055. Anonymous FTP server
  1056. ====================
  1057. Read `ftpd'(8).
  1058. Network File System (NFS)
  1059. =========================
  1060. Sun's Network File System (NFS) has become a standard for using remote
  1061. disks not only in the Unix- but in the whole TCP/IP-world. The idea is
  1062. quite simple: one host "exports" a directory, and other hosts can mount
  1063. that directory and access it and its subdirectories.
  1064. When users from several machines want to use the same set of files,
  1065. special care has to be taken for the user-ids and group-ids the files
  1066. have: UID and GID of the users must be unique across the (NFS-)network,
  1067. or one won't be able to read a file on one machine created on another
  1068. one (where the same user had a different UID).
  1069. There are also some security-mechanisms built in to prevent unauthorized
  1070. machines from mounting directories or which prevent root-access to files
  1071. from remote machines. I won't introduce those mechanisms here and I'll
  1072. assume no special measures for mounting/exporting filesystems here. If
  1073. you need to know about those mechanisms, please read `mount'(8),
  1074. `exports'(5).
  1075. See RFC 1094 for a description of NFS.
  1076. * Menu:
  1077. * NFSmount::          Mounting remote filesystems.
  1078. * NFSexport::         Exporting filesystems.
  1079. Mounting remote filesystems
  1080. ---------------------------
  1081. Mounting a directory from a remote host is pretty simple. All you have
  1082. to know is the host's name (`remote-host'), the directory exported by
  1083. the remote host (`remote-dir') and the directory from which you want to
  1084. access those files (`local-dir', must be absolute!).
  1085. All you have to do then is:
  1086.      # mount <remote-host>:<remote-dir> <local-dir>
  1087. To make the same mount permanent, put the following line into
  1088. `/etc/fstab' (See `mount'(8) for a description of all those options:
  1089. `rw,soft,...'):
  1090.      <remote-host>:<remote-dir>  <local-dir>  nfs  rw,soft,bg,retry=4  0  0
  1091. Here's an example I use on DUSK: How to mount
  1092. `/usr/aftp/pub/os/NetBSD/NetBSD-Amiga' from ftp.uni-regensburg.de
  1093. (which is only an alias for the rrzs3) on DUSKs
  1094. `/usr/ftp/pub/NetBSD-Amiga'. This can be done by issuing `mount
  1095. ftp.uni-regensburg.de:/usr/aftp/pub/os/NetBSD/NetBSD-Amiga
  1096. /usr/ftp/pub/NetBSD-Amiga' or putting the following line into
  1097. `/etc/fstab':
  1098.      rrzs3:/usr/aftp/pub/os/NetBSD/NetBSD-Amiga /usr/ftp/pub/NetBSD-Amiga nfs
  1099.                                                           rw,soft,bg,retry=4 0 0
  1100. (This line is split only to fit on the page. Put this all in one line!)
  1101. Exporting filesystems
  1102. ---------------------
  1103. To mount a directory from a remote host, the host has to export that
  1104. directory via NFS. To do this, put the directorys name into
  1105. `/etc/exports' on the remote host. Then issue `showmount -e 127.0.0.1'
  1106. to (re-)read `/etc/exports' and actually export that filesystem. Also,
  1107. this command will show you all the directories you currently export.
  1108. Here's what FTP.UNI-REGENSBURG.DE's `/etc/exports' looks like to give
  1109. DUSK (and everyone else) access to `/usr/aftp/pub/NetBSD-Amiga':
  1110.      /usr/aftp/pub -rw=dusk.rz.uni-regensburg.de,root=dusk.rz.uni-regensburg.de
  1111. Again, there are a number of options to restrict access. Please refer to
  1112. `export'(5) for documentation.
  1113. Berkeley r-tools
  1114. ================
  1115. The university of Berkeley has developped its own set of networking
  1116. applications, of which the most important are:
  1117. `rlogin':
  1118.      Interactive login into remote host, similar to  `telnet'.
  1119. `rsh':
  1120.      Execute command on remote host. Stdin is read from the  local
  1121.      stdin, stdout and stderr of the remote command  are returnet to
  1122.      the local host.
  1123. `rcp':
  1124.      Copy file from local to remote machine or vice  versa. The
  1125.      difference to `ftp' is that `rcp'  is not used interactively but
  1126.      via commandline-arguments  similar to the `cp'-command.
  1127. There are several prerequirements and security-issues to be paid
  1128. attention when using the Berkeley R-Tools.
  1129. * Menu:
  1130. * rreq::              Prerequirements/Security.
  1131. Prerequirements/Security
  1132. ------------------------
  1133. All the r-tools are based on the concept of trusted hosts and users,
  1134. i.e. on one host, you say which user(s) from what host(s) you allow to
  1135. access a specific account. There are two places where this information
  1136. is kept:
  1137.    * `/etc/hosts.equiv':  Systemwide information, should be either
  1138.      removed or  zero-length (`cp /dev/null /etc/hosts.equiv') as this
  1139.      file is mostly a big security hole.
  1140.    * `~/.rhosts':  This file contains information on which users and
  1141.      hosts to  allow to login or execute commands (via `rsh').   If
  1142.      you're really upset about your system's security, keep your  users
  1143.      from having such files.
  1144. Both files contain pairs of *host*-*user*-combinations, where *host* is
  1145. the host that users are allowed to log in from, and *user* tells
  1146. *which* user is actually allowed to log in from that host (to that
  1147. specific account, in the case of `~/.rhosts'.
  1148. Example! I've got an account "`c9020'" on RRZSG1.RZ.UNI-REGENSBURG.DE.
  1149. When I want to login into hubert's account on DUSK without giving a
  1150. password, I've got to put the following into hubert's `~/.rhosts':
  1151.      rrzsg1.rz.uni-regensburg.de c9020
  1152. If you've trouble what to take as hostname (i.e., with or without
  1153. domain, or even IP-number), login (probably *with* giving a password),
  1154. then start `who'. This will tell you the hostname you've to put into
  1155. your `~/.rhosts':
  1156.      dusk% who
  1157.      hubert   ttyp0   Mar 21 13:59   (rrzsg1.rz.uni-reg)
  1158. This shows that I have to use *rrzsg1.rz.uni-regensburg.de* as hostname.
  1159. The most common question concerning networking and X is "How far do I
  1160. have to start networking to be able to work with X?".
  1161. Well, it should be sufficient to configure the loopback-device
  1162. properly. As this is done by default, there should be no
  1163. network-problems with X.
  1164. Tell me if this is wrong!
  1165. Domain Name Server (DNS)
  1166. ========================
  1167. See RFCs 1032 and 1033 for guides on operation and domain
  1168. administration.
  1169. See also [CraigHunt] for a detailed description.
  1170. In order to set up electronic mail, there are several steps to be
  1171. performed:
  1172.   1. Set `sendmail_flags' to `-bd -q30m' in `/etc/netstart'.
  1173.      This tells sendmail to start as a daemon (`-bd') and scan the
  1174.      queues for mail every 30 minutes (`-q30m').
  1175.   2. Get a `/etc/sendmail.cf', e.g. from sun-lamp or one of its mirrors.
  1176.   3. Ask your DNS-admin for an MX-entry on your host and -- if your
  1177.      machine's       not always on the net -- also one on a machine
  1178.      which stores your mail       while your machine's down and
  1179.      forwards it later.
  1180. Most of the time, sending mail is no problem, but receiving is. So, if
  1181. you experience any problems, consult your local postmaster!
  1182. Remote Printing
  1183. ===============
  1184. This is a topic which I haven't tried out yet, but which I'd really
  1185. like to see here. If anyone has detailed information about
  1186.   1. using a remote printer
  1187.   2. offering print services
  1188. please tell me and I'll insert it here!
  1189. How do I set up networking?
  1190. ===========================
  1191. Read the "NetBSD-Amiga Beginners Guide to Networking and
  1192. Networking-FAQ".
  1193. I've choosen two IP-numbers, 1.1.1.1 and 2.2.2.2, but nothing works!
  1194. ====================================================================
  1195. These two numbers are in different subnets, so you either have to
  1196.    * set up routing propperly for them to work, or
  1197.    * choose numbers which are in the same subnet.        *Note TCP/IP
  1198.      address format: AddressFormat.
  1199. Netstat doesn't output anything
  1200. ===============================
  1201. Please ensure that the running Kernal is the same as `/vmunix'.
  1202. I can't get `vmunix.613' to work with my Ethernet-board
  1203. =======================================================
  1204. Ethernet-support was first introduced in 622, so you've to update your
  1205. kernel and some of the networking-programs.
  1206. The system hangs when going into multiuser-mode
  1207. ===============================================
  1208. Set `name_server=NO' in `/etc/netstart' or set up your
  1209. `/etc/resolv.conf' properly to get access to the DNS.
  1210. `timed' and `routed' report some errors. Should I comment them out, too?
  1211. ========================================================================
  1212. You can if you want, although those don't disturb the rest of the
  1213. system, they may just fail, but so what. The corresponding flags in
  1214. `/etc/netstart' are:
  1215.    * routed_flags (set to NO to disable)
  1216.    * timed_flags (set to NO to disable)
  1217. `xhost' says "must be on local host", but I'm already there!
  1218. ============================================================
  1219. Try setting your `DISPLAY' to "`:0'". There seem to be some problems
  1220. when using "`localhost:0'" or "<nodename>`:0'".
  1221. `ifconfig' doesn't init my point-to-point-devices (SLIP/PPP) right
  1222. ==================================================================
  1223. Try setting the remote IP-address as the very last argument at the
  1224. ifconfig-command. If you want this to run from
  1225. `/etc/netstart'/`/etc/hostname.*', please note the options' order given
  1226. in `/etc/netstart' and fix your `/etc/netstart', if necessary (*note
  1227. `/etc/netstart': e_netstart.).
  1228. What's the Major and Minor device numbers for the le0 device?
  1229. =============================================================
  1230. There's no `/dev/le0', and so you can't figure out any major/minor
  1231. number. If you want to check whether you've got an ethernet-driver in
  1232. you kernel, do `netstat -i' and watch out for `le0' there.
  1233. Abbreviations
  1234. *************
  1235.      Computer Systems Research Group, core developers of BSD
  1236. DARPA
  1237.      Defense Advanced Research Projects Agency, sponsor for developing
  1238.      TCP/IP
  1239.      Data Defense Network
  1240.      Domain Name Service, method to map hostnames to IP-addresses and
  1241.      back
  1242.      File Transfer Protocol, program & TCP/IP-based protocol to transfer
  1243.      single files between machines.
  1244.      International Standard Organisation, defined networking-protocols
  1245.      such as X.25, X.400, X.500, ...
  1246.      Networking File System, gives transparent access to remote files
  1247.      Network Information Service, method to share one database (e. g.
  1248.      `passwd'-file) between several machines; former Yellow Pages  (YP)
  1249.      Point to Point Protocol, transports several protocols (TCP/IP,
  1250.      DECnet, ... over serial lines
  1251.      Request For Comment, open definition of internet standards
  1252.      Serial Line IP, transports IP-packets over serial line
  1253. TCP/IP
  1254.      Transmission Control Protocol/Internet Protocol, most widespread
  1255.      networking protocol today
  1256.      University of California at Berkeley; origin of the BSD-Unix and
  1257.      NetBSD
  1258.      Version 11 of the X-Window-System developped at MIT
  1259.      Yellow Pages, see NIS; renamed after conflicts with british
  1260.      telecom.
  1261. References
  1262. **********
  1263. [AeleenFrisch]
  1264.      Aeleen Frisch: "Essential System Administration", O'Reilly &
  1265.      Associates,  Sebastopol, 1991.
  1266. [CraigHunt]
  1267.      Craig Hunt: "TCP/IP Network Administration", O'Reilly & Associates,
  1268.      Sebastopol, 1993.
  1269. [Leffer]
  1270.      Samuel J. Leffer, Marshall Kirk McKusick, Michael J. Karels, John
  1271.      S. Quarterman: "The Design and Implementation of the 4.3BSD UNIX
  1272.      Operating System", Addison Wesley, Reading, 1989.
  1273. [RFC977]
  1274.      B. Kantor, P. Lapsley: "Network News Transfer Protocol", February
  1275.      1986, 27 pages.
  1276. [RFC1032]
  1277.      M. Stahl: "Domain administrators guide", November 1987, 14 pages.
  1278. [RFC1033]
  1279.      M. Lotter: "Domain administrators operations guide", November 1987,
  1280.      22 pages.
  1281. [RFC1034]
  1282.      P. Mockapetris: "Domain names - concepts and facilities", November
  1283.      1987, 55 pages.
  1284. [RFC1035]
  1285.      P. Mockapetris: "Domain names - implementation and specification",
  1286.      November 1987, 55 pages.
  1287. [RFC1055]
  1288.      J. Romkey: "Nonstandard for transmission of IP datagrams over
  1289.      serial  lines: SLIP", June 1988, 6 pages.
  1290. [RFC1094]
  1291.      Sun Microsystems, Inc.: "NFS: Network File System Protocol
  1292.      specification.", March 1989, 27 pages.
  1293. [RFC1331]
  1294.      W. Simpson: "The Point-to-Point Protocol (PPP) for the
  1295.      Transmission of  Multi-protocol Datagrams over Point-to-Point
  1296.      Links", May 1992, 66  pages.
  1297. [RFC1332]
  1298.      G. McGregor: "The PPP Internet Protocol Control Protocol (ICPC)",
  1299.      May  1992, 12 pages.
  1300.