Whole document tree
    

Whole document tree

GRUB Manual: Network
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Downloading OS images from a network

Although GRUB is a disk-based boot loader, it does provide network support. To use the network support, you need to enable at least one network driver in the GRUB build process. For more information please see `netboot/README.netboot' in the source distribution.

6.1 How to set up your network  
6.2 Booting from a network  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 How to set up your network

GRUB requires a file server and optionally a server that will assign an IP address to the machine on which GRUB is running. For the former, only TFTP is supported at the moment. The latter is either BOOTP, DHCP or a RARP server(6). It is not necessary to run both the servers on one computer. How to configure these servers is beyond the scope of this document, so please refer to the manuals specific to those protocols/servers.

If you decided to use a server to assign an IP address, set up the server and run bootp (see section 13.2.1 bootp), dhcp (see section 13.2.4 dhcp) or rarp (see section 13.2.10 rarp) for BOOTP, DHCP or RARP, respectively. Each command will show an assigned IP address, a netmask, an IP address for your TFTP server and a gateway. If any of the addresses is wrong or it causes an error, probably the configuration of your servers isn't set up properly.

Otherwise, run ifconfig, like this:

 
grub> ifconfig --address=192.168.110.23 --server=192.168.110.14

You can also use ifconfig in conjugation with bootp, dhcp or rarp (e.g. to reassign the server address manually). See section 13.2.6 ifconfig, for more details.

Finally, download your OS images from your network. The network can be accessed using the network drive `(nd)'. Everything else is very similar to the normal instructions (see section 4. Booting).

Here is an example:

 
grub> bootp
Probing... [NE*000]
NE2000 base ...
Address: 192.168.110.23    Netmask: 255.255.255.0
Server: 192.168.110.14     Gateway: 192.168.110.1

grub> root (nd)
grub> kernel /tftproot/gnumach.gz root=sd0s1
grub> module /tftproot/serverboot.gz
grub> boot


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 Booting from a network

It is sometimes very useful to boot from a network, especially, when you use a machine which has no local disk. In this case, you need to obtain a kind of Net Boot ROM, such as a PXE ROM or a free software package like Etherboot. Such a Boot ROM first boots the machine, sets up the network card installed into the machine, and downloads a second stage boot image from the network. Then, the second image will try to boot an operating system from the network actually.

GRUB provides two second stage images, `nbgrub' and `pxegrub' (see section 10. GRUB image files). Those images are the same as the normal Stage 2, except that they set up a network automatically, and try to load a configuration file from the network, if specified. The usage is very simple: If the machine has a PXE ROM, use `pxegrub'. If the machine has a NBI loader such as Etherboot, use `nbgrub'. There is no difference between them but their formats. As how to load a second stage image you want to use should be described in the manual on your Net Boot ROM, please refer to the manual, for more information.

However, there is one thing specific to GRUB. Namely, how to specify a configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag `150', to get the name of a configuration file. This below is an example about a BOOTP configuration:

 
.allhost:hd=/tmp:bf=null:\
        :ds=145.71.35.1 145.71.32.1:\
        :sm=255.255.254.0:\
        :gw=145.71.35.1:\
        :sa=145.71.35.5:

foo:ht=1:ha=63655d0334a7:ip=145.71.35.127:\
        :bf=/nbgrub:\
        :tc=.allhost:\
        :T150="(nd)/tftpboot/menu.lst.foo":

Note that you should specify the drive name (nd) in the name of the configuration file. That is because you can change the root drive before downloading the configuration from the TFTP server, when the preset menu feature is used (see section 8. Embedding a configuration file into GRUB).

See the manual about your BOOTP/DHCP server, for more information. The exact syntax should differ from the example, more or less.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Jason Thomas on February, 4 2002 using texi2html