Diff for /wikisrc/tutorials/how_to_set_up_nfs_and_nis.mdwn between versions 1.4 and 1.5

version 1.4, 2020/05/26 07:24:36 version 1.5, 2020/05/30 06:15:02
Line 15  NIS (Network Information Service) is a d Line 15  NIS (Network Information Service) is a d
   
 We will need NIS (or another directory service) to make sure the NFS user ids/group ids are the same on the server as on all clients. Otherwise, bad things will happen, as you can probably imagine (especially in our example of mounting /home over NFS). Note that using NIS with NFS is not mandatory, you can also keep the server and client's passwd in synch.   We will need NIS (or another directory service) to make sure the NFS user ids/group ids are the same on the server as on all clients. Otherwise, bad things will happen, as you can probably imagine (especially in our example of mounting /home over NFS). Note that using NIS with NFS is not mandatory, you can also keep the server and client's passwd in synch. 
   
 NIS used to be called the `Yellow Pages', or YP for short. Because of trademarks it had to be renamed, but the programs are all still prefixed with `yp'.   NIS used to be called the "Yellow Pages", or YP for short. Because of trademarks it had to be renamed, but the programs are all still prefixed with `yp`. 
   
       
   
Line 42  If you want to get funky and boot from N Line 42  If you want to get funky and boot from N
 The first thing we should do is decide on a NIS domain name. This has nothing to do with your machine's Internet domain name. It is just a unique name that is used to identify machines in the same NIS block.   The first thing we should do is decide on a NIS domain name. This has nothing to do with your machine's Internet domain name. It is just a unique name that is used to identify machines in the same NIS block. 
   
 The domainname is set (as root) using the [domainname(1)](http://netbsd.gw.com/cgi-bin/man-cgi?domainname+1+NetBSD-current) program, or can be set in the /etc/mydomain file.     The domainname is set (as root) using the [domainname(1)](http://netbsd.gw.com/cgi-bin/man-cgi?domainname+1+NetBSD-current) program, or can be set in the /etc/mydomain file.   
 Alternatively, in most BSD systems, it can be set in /etc/rc.conf under the variable `domainname'.   Alternatively, in most BSD systems, it can be set in /etc/rc.conf under the variable `domainname`. 
           
   
  root@earth# domainname planets   root@earth# domainname planets
Line 57  After this, we must initialise all files Line 57  After this, we must initialise all files
 The -m means we are creating a master server. On more complex networks, you can even want slave servers. The tool will ask you for a list of YP servers to bind to.     The -m means we are creating a master server. On more complex networks, you can even want slave servers. The tool will ask you for a list of YP servers to bind to.   
 Since we're only using one server, just press RETURN (make sure your own server's internal address is in the list).   Since we're only using one server, just press RETURN (make sure your own server's internal address is in the list). 
   
 Before we run `make' in /var/yp, as the tool says, we must enable the NIS daemons: rpcbind, ypserv and ypbind (in that order). After that, we can run `make' in /var/yp.   Before we run `make` in /var/yp, as the tool says, we must enable the NIS daemons: rpcbind, ypserv and ypbind (in that order). After that, we can run `make` in /var/yp. 
   
 To test if your setup is working, try yptest. It should spew out the passwd file among others, so don't panic ;)   To test if your setup is working, try yptest. It should spew out the passwd file among others, so don't panic ;) 
   
Line 80  Then just run  Line 80  Then just run 
   
 [rpc.yppasswdd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?rpc.yppasswdd+8+NetBSD-current) must be running on the NIS master server to allow users to change information in the password file.     [rpc.yppasswdd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?rpc.yppasswdd+8+NetBSD-current) must be running on the NIS master server to allow users to change information in the password file.   
 [ypserv(8)](http://netbsd.gw.com/cgi-bin/man-cgi?ypserv+8+NetBSD-current) provides information from NIS maps to the NIS clients on the network.     [ypserv(8)](http://netbsd.gw.com/cgi-bin/man-cgi?ypserv+8+NetBSD-current) provides information from NIS maps to the NIS clients on the network.   
 [ypbind(8)](http://netbsd.gw.com/cgi-bin/man-cgi?ypbind+8+NetBSD-current) finds the server for a particular NIS domain and stores information about it in a ``binding file_._  [ypbind(8)](http://netbsd.gw.com/cgi-bin/man-cgi?ypbind+8+NetBSD-current) finds the server for a particular NIS domain and stores information about it in a "binding file".
   
 After that, you can use ypinit:   After that, you can use ypinit: 
           
Line 89  After that, you can use ypinit:  Line 89  After that, you can use ypinit: 
   
 Then, add your NIS server's address to the list. To test if everything is working, use yptest on the client as well. **Note that ypbind will HANG if it can't find the server!**  Then, add your NIS server's address to the list. To test if everything is working, use yptest on the client as well. **Note that ypbind will HANG if it can't find the server!**
   
 If everything is working, you are ready to go! Just edit /etc/nsswitch.conf and put in some `nis' keywords. For example:   If everything is working, you are ready to go! Just edit /etc/nsswitch.conf and put in some `nis` keywords. For example: 
           
      passwd:            files nis       passwd:            files nis
           
Line 143  Voila, you're done. Just add all NFS vol Line 143  Voila, you're done. Just add all NFS vol
   
 and have them mounted at system startup.   and have them mounted at system startup. 
   
 NOTE: I had much trouble with NFS which was caused by UDP packet fragmentation. This made all writes extremely slow (and other outgoing network traffic as well!) while reads were at an acceptable speed. To solve this, I added the (undocumented?) `tcp' option to fstab to mount NFS over TCP. You'll probably also need to add   NOTE: I had much trouble with NFS which was caused by UDP packet fragmentation. This made all writes extremely slow (and other outgoing network traffic as well!) while reads were at an acceptable speed. To solve this, I added the (undocumented?) `tcp` option to fstab to mount NFS over TCP. You'll probably also need to add 
           
     nfsd_flags='-t'      nfsd_flags='-t'
           

Removed from v.1.4  
changed lines
  Added in v.1.5


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb