From: senetza@sigma.uleth.ca (Len Senetza)
Newsgroups: comp.unix.ultrix
Subject: Re: How to change diskless client IP address?
Date: 4 Sep 92 21:21:46 GMT
Organization: University of Lethbridge

>pranjoto@ece.wisc.edu (Hokkie Pranjoto) writes:


>>We have a Decstation 5000/200 server with 3 diskless clients.  We need
>>to change the IP addresses of all 4 machines.  We got the server changed
>>with no problem.  We changed one client by deleting the client and
>>adding it back with dms.  After doing this we had to reconfigure all
>>the installed sets.  Is there an easier way to do this?  In particular,
>>is the IP address of the client stored some place where we can edit
>>it?  (We tried editing the IP addresses in both the server and client
>>/etc/hosts, but that did not do the job.)

we had to do that here.  over 20 machines.  not a lot of fun, but can be
done.  here's the document i used.  i've added comments for you, cuz a
lot of the scripts and whatnot aren't self explanatory by the titles.
also, if you plan to use this, please read it carefully first.  then
redo it for your system.  also, make sure that you can back-out
(revert).



Internet Number Change 
------------------------------

! get all the clients shut-down; except for fileservers and the main
!   DMS server

 1. Shutdown the lab, except honte (fileserver) and jeltz (main DMS
      server).  (halting is OK <yeah, i know it really isn't>)
 2. umount all NFS file systems from jeltz
 3. Shutdown honte

! now all the clients will be down.

 4. Change jeltz's internet number

! this next updates the files which refer to the IP address.  it also
!   changes the fstab so that it doesn't try to mount the NFS stuff

    a. cd /etc; cp networks.new networks; cp hosts.new hosts;
	cp rc.local.new rc.local; cp fstab.ufs fstab
    b. Reboot jeltz
    c. jeltz should now be running new number.  check with 'ping jeltz'

! if you have YP, do the following, if not, ignore.  if you're running
!   under Bind/Hesiod, i'm not sure, but it should be analagous

    d. Redo YP
       i. cd /etc/yp/src; cp networks.new networks; 
	   cp hosts.new hosts; touch *; cd ..; make all
    e. Reboot jeltz (just to be sure)

! and the fun starts here...

 5. Change the lab's internet numbers
    a. First, try one client (alpha)
       i.   cd /dlclient0

! modify the files with IP stuff

		mv-hosts.new alpha.uleth.ca.root
		mv-networks.new alpha.uleth.ca.root
		rc.local.modify alpha.uleth.ca.root

! modify DMS specific stuff.  make sure that you've compiled up the
!   netblk file _prior_ to this
		mv-netblk.new alpha.uleth.ca.root
		mv-dlparam.new alpha.uleth.ca.root

! no NFS

		cp /dlclient0/alpha.uleth.ca.root/etc/fstab.ufs \
			/dlclient0/alpha.uleth.ca.root/etc/fstab
       ii.  Reboot alpha

! check the machine

       iii. alpha should be ok.  Try pinging from jeltz.  Try rlogin 
	     from jeltz.
       iv.  If any of the above fails (ii, iii) we're in trouble.  
	     See later on for reversion.

! do the rest of the machines...

    b. Now redo step a.i. replacing '[b-z]*.root' for 'alpha.uleth.ca.root'
	 and omitting the fstab stuff.

! reboot the NFS server first, then the rest.  the DMS server should be
!   running already

    c. Reboot honte, then the lab.

! a bit of clean up...

 6. Modify jeltz's and alpha's fstab
    a. cp /etc/fstab.nfs /etc/fstab; mount -a
    b. cp /dlclient0/alpha.uleth.ca.root/etc/fstab.nfs \
		/dlclient0/alpha.uleth.ca.root/etc/fstab


Reversion
---------

 1. Shutdown alpha. (halting is OK)
 2. Change jeltz's internet number

! have these files (.old) ready prior to doing the switch

    a. cd /etc; cp networks.old networks; cp hosts.old hosts;
	cp rc.local.old rc.local; cp fstab.ufs fstab
    b. Reboot jeltz
    c. jeltz should now be running old number.  check with 'ping jeltz'
    d. Redo YP
       i. cd /etc/yp/src; cp networks.old networks; 
	   cp hosts.old hosts; touch *; cd ..; make all
    e. Reboot jeltz (just to be sure)
 3. Change the lab's internet numbers
    a. First, try one client (alpha)
       i.   cd /dlclient0
		mv-hosts.revert alpha.uleth.ca.root
		mv-networks.revert alpha.uleth.ca.root
		netblk.revert alpha.uleth.ca.root
		rc.local.revert alpha.uleth.ca.root
		dlparam.revert alpha.uleth.ca.root
       ii.  Reboot alpha
       iii. alpha should be ok.  Try pinging from jeltz.  Try rlogin 
	     from jeltz.  Try dlogin from jeltz (just to be sure).
       iv.  If any of the above fails (ii, iii) we're in trouble.  
    b. Now redo step a.i. replacing '[b-z]*.root' for 'alpha.uleth.ca.root'.
    c. Reboot honte, then the lab.
 4. Modify jeltz's and alpha's fstab
    a. cp /etc/fstab.nfs /etc/fstab; mount -a
    b. cp /dlclient0/alpha.uleth.ca.root/etc/fstab.nfs \
		/dlclient0/alpha.uleth.ca.root/etc/fstab


>>Thanks.
>>Hokkie Pranjoto

hope this helps.  

--
  +-----------------------------------------------------------------------+
  |  Leonard Senetza            |  E-Mail: senetza@alpha.uleth.ca         |
  |  Academic Consultant        |          senetza@hg.uleth.ca            |
  |  University of Lethbridge   |   Phone: 403-329-5162 FAX: 403-382-7108 |
  |  Lethbridge, Alberta        |-----------------------------------------|
  |  Canada, eh?                |  Disclaimer: Why should I tell _them_?  |
  |  T1K 3M4                    |    What they don't know, can't fire me. |
  +-----------------------------------------------------------------------+