SUMMARY : Suninstall across a gateway

From: Mathew BM LIM (mbl900@lunch.anu.edu.au)
Date: Wed Mar 18 1992 - 01:13:33 CST


Thanks to all those who responded to my query regarding booting /
suninstalling across a router.

My original query :
>
>I am posting this for a third party, this is probably a FAQ but here it is :
>
>How does one run suninstall (SunOs 4.1) if the tape host is on another subnet ?
>For that matter, how does one boot a diskless Sun across subnets ?
>
>Thanks in advance.
>

Some of the more useful answers were :

----------------------
From: jimh@nsd.fmc.com (Jim Hendrickson x7348 M233)

Hi,

I can't comment on Suninstall across a gateway because I haven't tried it.

The general case of booting across a gateway seems to be not do-able for
the low-level parts: tftp and bootp. In our case, the network folks
had claimed that putting in an "IP Helper" address in the cisco gateways
would allow the RARP, TFTP and BootP to propagate through the gateways; this
never worked in practice. The problem is that broadcasts won't propagate
through a gateway.

I do have some diskless units on a subnet different from their OS server,
but there are a couple machines with disks on that subnet that I use to provide
RARP, TFTP, BootP, and YP. That doesn't take much space, and you always
need a YP server in each subnet (if you use YP). The root and swap space
is on another subnet.

There is a theoretical reason why it won't work at all:
Even after RARP, TFTP, and BootP are done, the machine won't know how
to route the mount request (for it's root and swap files). That works
for us because the machine doesn't know about the subnet mask either,
and puts out a broadcast appropriate to its class (Class B in our case).
This makes it through the gateway. Once the kernel is running, the
default route is gotten from an entry in rc.local, so as the correct
mask is applied, a route is defined. As a result, it works fine.

Hope this helps.

Jim Hendrickson
FMC-Minneapolis
----------------------
From: mdl@cypress.com (J. Matt Landrum)

I believe that if you start in.routed before you get into
suninstall that you can use a tapehost on another subnet.

----------------------
From: todd@flex.Eng.McMaster.CA (Todd Pfaff)

This was posted to sun-managers a while back.

----- Begin Included Message -----

>From sun-managers-relay@delta.eecs.nwu.edu Wed Nov 27 22:27:07 1991
Sender: sun-managers-relay@eecs.nwu.edu
X400-Received: by mta chx400.switch.ch in /PRMD=switch/ADMD=arcom/C=CH/;
               Relayed; Wed, 27 Nov 1991 18:26:08 +0100
X400-Received: by /PRMD=SWITCH/ADMD=ARCOM/C=CH/; Relayed;
               Wed, 27 Nov 1991 18:23:08 +0100
Date: Wed, 27 Nov 1991 18:23:08 +0100
X400-Originator: brossard@sasun1.epfl.ch
X400-Mts-Identifier: [/PRMD=SWITCH/ADMD=ARCOM/C=CH/;9111271723.AA01536]
X400-Content-Type: P2-1984 (2)
From: "(Alain Brossard EPFL-SIC/SII)" <brossard@sasun1.epfl.ch>
To: sun-managers@eecs.nwu.e
Subject: Info: network boot across subnets for sparcstations

----- Begin Included Message -----

>From brossard Sat Nov 23 15:40:29 1991
Date: Sat, 23 Nov 91 15:40:25 +0100
From: brossard (Alain Brossard EPFL-SIC/SII)
To: timsit@stisun9.epfl.ch
Subject: Info: network boot across subnets for sparcstations
Cc: brossard
Content-Length: 9341
X-Lines: 251

        We solved the problem of booting an isolated sparc station
across subnets and I thought that it might be useful for other
people to find out how we did it. We use this technique to
easily install the OS from a centrally located boot server and
from a single CD-rom. The OS is then patched automatically to
include all the security fixes, etc.

        The problem is that all three stages (boot prom, boot
program and vmunix) do broadcasts. Since broadcasts don't cross
subnets, we've always needed a second Sun machine on the same
subnet to answer the broadcasts. In the case of the open boot
prom, the problem is made worse in that we can't tell the
machine where the boot program is located. In the old boot
prom, we used to be able to type 'b le(,3940,)' which told it
where the boot program was located. (This limitation is now
removed in the revision 2.4 of the open boot prom).

        The open boot prom used to do a revarp requests followed
by a request to whomever answered it for a boot program. If
the request failed, I believe it then does a broadcast. The
solution we used is to have the user tell it the IP address of
itself and of the boot server. The solution below will not
work for revisions older than 1.6 of the boot proms, will work
for all revisions 2.0 and above and probably works for 1.6 to
2.0, but we haven't tested the last series of open boot proms
recently.

    So after a shutdown:

> n
ok see clear-his-address # Note the two numbers NN and KK
    : clear-his-address
        (ffea9b90) (ffea9b84) 6 move (NN) (KK) 4 move
    ;
ok nvedit # Don't forget to replace NN and KK
 0 : setenv use-nvramrc? false # failsafe...
 1 : : addr-sic clear-his-address # define our forth routine
 2 : $ip_HEX my-ip-addr ! # replace $ip_HEX
 3 : $server_HEX dup NN execute ! # replace $server_HEX and NN
 4 : KK execute ! # replace KK
 5 : do-arp ;
 6 : ramforth
 7 : patch addr-sic clear-net-addresses net-load # use our routine
 8 : setenv use-nvramrc? true
 9 :^C
ok nvstore
ok setenv use-nvramrc? true
ok reset
    # The modifications above are now recorded
L1-A
> n
ok boot net

   In nvedit, the first line is to prevent the manager from rendering
the machine unusable if he screws up. It happened once here, my guess
is the manager managed to write an infinite loop which prevented the
machine from ever being able to give control back to the manager. We
had to replace the nvram! Now, a power off/power on cycle will make
the open boot ignore the nvramrc (use-nvramrc? false). While a
successfull parse of nvramrc will guarantee that next time around it
is used again.
   $ip_HEX is the ip address of the station, ex: 80b2034f, while
$server_HEX is the ip address of the boot server, ex: 80b23940.

   The next step would be to modify the boot program and that is
what we did, but it turned out that it can be replaced with vmunix
directly when booting over the net. So I'm only including the
patch to vmunix. I had to prevent vmunix from using a broadcast
to find its IP address (revarp request) and from using another
broadcast to get its bootparams. This patch is short: 3 lines
of codes and the rest are comments and output. The patch
to the makefile is a bit longuer :-(.

   We probably could have done a nicer patch where the relevant
ip addresses and install program would be passed as parameters
to vmunix at boot time. This would remove the necessity of patching
the binary for each machine which needs to boot but:
        1- we already need to setup things each time a machine
           wants to install a new os, patching vmunix only represented
           around 8 lines of perl to add to the script
        2- It would have taken a lot more time to get it right with
           parameters. Time won over niceness.

   And now, we have a working OS installation system across subnets.
Of course for older sparc stations and the other machines, we still
need a responder machine to answer the rarp (/etc/ethers) and
bootparams broadcast requests.

Alain Brossard, Ecole Polytechnique Federale de Lausanne,
        SIC/SII, EL-Ecublens, CH-1015 Lausanne, Suisse, +41 21 693-2211
brossard@sic.epfl.ch

cd /usr/src/sys
diff -c -r1.1 netinet/if_ether.c
*** /tmp/,RCSt1a27600 Sat Nov 23 15:30:07 1991
--- netinet/if_ether.c Wed Nov 13 19:32:26 1991
***************
*** 1,4 ****
--- 1,10 ----
  /*
+ * $Log: if_ether.c,v $
+ * Revision 1.2 91/11/13 19:33:44 staff
+ * Added NOBROADCAST so that it wouldn't do any broadcast at boot time,
+ * the magic string zzzz has to be patched in to be the IP address
+ * (Probably could have used a flag instead). A.B.
+ *
   * Copyright (c) 1982, 1986 Regents of the University of California.
   * All rights reserved.
   *
***************
*** 516,526 ****
--- 522,541 ----
          (void) splx(s);
  
          myaddr.s_addr = 0;
+ #ifdef NOBROADCAST
+ /*
+ * "zzzz" should be patched with the IP address of the boot client.
+ * Alain Brossard, brossard@sic.epfl.ch
+ */
+ bcopy( "zzzz", (caddr_t)&myaddr, sizeof(myaddr));
+ printf("Using Hardwired IP Address 0x%x\n", myaddr.s_addr);
+ #else
          revarp_start(ifp);
          s = splimp();
          while (myaddr.s_addr == 0)
                  (void) sleep((caddr_t)&myaddr, PZERO-1);
          (void) splx(s);
+ #endif
          sin->sin_addr = myaddr;
          if (in_control((struct socket*)0, SIOCSIFADDR, (caddr_t)&ifr, ifp))
                  printf("revarp: can't set perm inet addr\n");
diff -c -r1.1 nfs/nfs_vfsops.c
*** /tmp/,RCSt1a27615 Sat Nov 23 15:30:35 1991
--- nfs/nfs_vfsops.c Wed Nov 13 19:33:46 1991
***************
*** 1,4 ****
--- 1,13 ----
  /* @(#)nfs_vfsops.c 1.1 90/10/29 SMI */
+ /*
+ * $Log: nfs_vfsops.c,v $
+ * Revision 1.2 91/11/13 19:35:38 staff
+ * Added NOBROADCAST so that it wouldn't do any broadcast at boot time,
+ * the magic string yyyy has to be patched in to be the IP address of
+ * the boot param server.
+ * (Probably could have used a flag instead). A.B.
+ *
+ */
  
  /*
   * Copyright (c) 1988 by Sun Microsystems, Inc.
***************
*** 322,327 ****
--- 331,349 ----
          }
          bcopy((caddr_t)&req.ifr_dstaddr, (caddr_t)&sa,
              sizeof (struct sockaddr_in));
+ #ifdef NOBROADCAST
+ /*
+ * destetheraddr is the ethernet address of our sole contact (boot server)
+ * yyyy will be patched to be the IP address of the boot server
+ * Alain Brossard, brossard@sic.epfl.ch
+ */
+ { struct in_addr tmp_ip; /* Hardwired address of boot server! */
+ bcopy( "yyyy", (caddr_t)&tmp_ip, sizeof(tmp_ip));
+ sa.sin_addr = tmp_ip;
+ printf("Using Hardwired IP Address 0x%x", tmp_ip.s_addr );
+ printf(" for the boot param server.\n");
+ }
+ #endif
  
          arg.client_address.address_type = IP_ADDR_TYPE;
  
diff -c -r1.1 Makefile
*** /tmp/,RCSt1a27645 Sat Nov 23 15:31:13 1991
--- Makefile Wed Nov 13 11:15:38 1991
***************
*** 103,109 ****
          cd $@ && $(MAKE) ${MFLAGS}
  
  pixrect: FRC
! cd ../usr.lib/libpixrect && $(MAKE) $(MFLAGS) kernel
  
  sunwindow: FRC
          cd $@/rect && $(MAKE) $(MFLAGS) src
--- 103,109 ----
          cd $@ && $(MAKE) ${MFLAGS}
  
  pixrect: FRC
! # cd ../usr.lib/libpixrect && $(MAKE) $(MFLAGS) kernel
  
  sunwindow: FRC
          cd $@/rect && $(MAKE) $(MFLAGS) src
diff -c -r1.1 sun4c/GENERIC/Makefile
*** /tmp/,RCSt1a27682 Sat Nov 23 15:35:02 1991
--- sun4c/GENERIC/Makefile Wed Nov 13 18:31:54 1991
***************
*** 1,5 ****
--- 1,6 ----
  IDENT=-Dsun4c -DGENERIC -DSUN4C_60 -DWINSVJ -DVDDRV -DASYNCHIO -DLWP -DVFSSTATS -DRFS -DCRYPT -DTCPDEBUG -DIPCSHMEM -DIPCSEMAPHORE -DIPCMESSAGE -DSYSAUDIT -DSYSACCT -DPCFS -DHSFS -DTMPFS -DTFS -DLOFS -DNFSSERVER -DNFSCLIENT -DUFS -DQUOTA -DINET
  PARAM=-DMAXUSERS=8
+ NOBROAD=-DNOBROADCAST
  #
  # @(#)Makefile.src 1.1 90/10/29 SMI
  #
***************
*** 683,689 ****
            ${LINT1} ${LOPTS} > route.L ) 2>&1 | ${LTAIL}
  
  if_ether.o: ${SYSDIR}/netinet/if_ether.c
! ${CC} -c ${CFLAGS} ${SYSDIR}/netinet/if_ether.c
  
  if_ether.L: ${SYSDIR}/netinet/if_ether.c
          @echo if_ether.c:
--- 684,690 ----
            ${LINT1} ${LOPTS} > route.L ) 2>&1 | ${LTAIL}
  
  if_ether.o: ${SYSDIR}/netinet/if_ether.c
! ${CC} -c ${CFLAGS} ${NOBROAD} ${SYSDIR}/netinet/if_ether.c
  
  if_ether.L: ${SYSDIR}/netinet/if_ether.c
          @echo if_ether.c:
***************
*** 899,909 ****
            ${LINT1} ${LOPTS} > nfs_subr.L ) 2>&1 | ${LTAIL}
  
  nfs_vfsops.o: ${SYSDIR}/nfs/nfs_vfsops.c
! ${CC} -c ${CFLAGS} ${SYSDIR}/nfs/nfs_vfsops.c
  
  nfs_vfsops.L: ${SYSDIR}/nfs/nfs_vfsops.c
          @echo nfs_vfsops.c:
! @-(${CPP} ${LCOPTS} ${SYSDIR}/nfs/nfs_vfsops.c | \
            ${LINT1} ${LOPTS} > nfs_vfsops.L ) 2>&1 | ${LTAIL}
  
  nfs_vnodeops.o: ${SYSDIR}/nfs/nfs_vnodeops.c
--- 900,910 ----
            ${LINT1} ${LOPTS} > nfs_subr.L ) 2>&1 | ${LTAIL}
  
  nfs_vfsops.o: ${SYSDIR}/nfs/nfs_vfsops.c
! ${CC} -c ${CFLAGS} ${NOBROAD} ${SYSDIR}/nfs/nfs_vfsops.c
  
  nfs_vfsops.L: ${SYSDIR}/nfs/nfs_vfsops.c
          @echo nfs_vfsops.c:
! @-(${CPP} ${LCOPTS} ${NOBROAD} ${SYSDIR}/nfs/nfs_vfsops.c | \
            ${LINT1} ${LOPTS} > nfs_vfsops.L ) 2>&1 | ${LTAIL}
  
  nfs_vnodeops.o: ${SYSDIR}/nfs/nfs_vnodeops.c
***************
*** 3830,3836 ****
  nfs_subr.o nfs_subr.L: ../../rpc/auth.h ../../rpc/clnt.h ../../nfs/nfs.h
  nfs_subr.o nfs_subr.L: ../../nfs/nfs_clnt.h ../../nfs/rnode.h
  nfs_subr.o nfs_subr.L: ../../sun/consdev.h ../../vm/pvn.h ../../vm/swap.h
! nfs_vfsops.o nfs_vfsops.L: ../../nfs/nfs_vfsops.c ../../sys/param.h
  nfs_vfsops.o nfs_vfsops.L: ../machine/param.h ../../sys/signal.h
  nfs_vfsops.o nfs_vfsops.L: ../../vm/faultcode.h ../../sys/types.h
  nfs_vfsops.o nfs_vfsops.L: ../../sys/stdtypes.h ../../sys/sysmacros.h
--- 3831,3837 ----
  nfs_subr.o nfs_subr.L: ../../rpc/auth.h ../../rpc/clnt.h ../../nfs/nfs.h
  nfs_subr.o nfs_subr.L: ../../nfs/nfs_clnt.h ../../nfs/rnode.h
  nfs_subr.o nfs_subr.L: ../../sun/consdev.h ../../vm/pvn.h ../../vm/swap.h
! nfs_vfsops.o nfs_vfsops.L: ../../nfs/nfs_vfsops.c ../../sys/param.h Makefile
  nfs_vfsops.o nfs_vfsops.L: ../machine/param.h ../../sys/signal.h
  nfs_vfsops.o nfs_vfsops.L: ../../vm/faultcode.h ../../sys/types.h
  nfs_vfsops.o nfs_vfsops.L: ../../sys/stdtypes.h ../../sys/sysmacros.h

----- End Included Message -----

--
Todd Pfaff                      \ Internet: todd@flex.eng.mcmaster.ca
Dept. of Mechanical Engineering  \   Voice: (416) 525-9140 x2902
McMaster University               \    FAX: (416) 572-7944
Hamilton, Ontario, CANADA  L8S 4L7 \

------------------ From: Mark Prior <mrp@itd.adelaide.edu.au>

You use a class B style subnet mask rather than a Class C and hope that your router will do the right thing.

Mark.

------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:38 CDT