Documentation:Tutorials Infastructure for NetBoot NGW100

From AVRFreaks Wiki

Jump to: navigation, search

This will be a tutorial about how to set up your local network so that you can netboot your ngw100.


Contents

[edit] Something to start with

A normal Ethernet based home network, with a NAT-router between your desktop and the internet.

Image:Netboot network pic1.png

The NAT-router could be something like the Linksys Linksys WRT54GL, or maybe a DIR-100 from dlink. This really don't matter but I will assume something similar to those products. This router is configured to

  • be the gateway of this network with ip 192.168.0.1
  • DNS Relay is turned on, so that the workstation can ask is for dns information.
  • DHCP Server is turned on gives ip numbers from 192.168.0.100 to 192.168.0.199

The workstation is a normal PC with something like Ubuntu 8.04. This computer is used for normal development work, surfing the web etc etc.

And then of course we also have the NGW100 connected to the network, but what is not shown in the picture above is that normally we also have a rs232 cable between the workstation and the NGW100.


But since this setup is missing some key functions we need to add a basement server, or closet server if you don't have a basement to put it in.

Image:Netboot network pic2.png

This is also a normal PC, but we need to run something rock solid on it like Debian stable (Debian 4).

This server is normally used as

  • a samba or nfs server to do some file sharing
  • a SubVersion server for your projects
  • backup storage
  • ssh server, so we can access it.

This basement server will have a static ip adress, and in this tutorial it will be 192.168.0.4.


[edit] dhcp

The first step towards netboot is to make sure you have full control over your dhcp. This is why the first step is to move the dpcp server from the nat-router to that basement server.

First we turn off the dhcpd server in the NAT-router, since we don't want 2 dhcpd servers on out network.

Then we will start to configure the basement server, a good introduction can be found here:

But this is the short version

  1. ssh user@192.168.0.4
  2. sudo su
  3. apt-get install dhcpd
  4. /etc/init.d/dhcp stop
  5. vi /etc/dhcpd.conf
    • more on this step later.
  6. dhcpd -f
    • verify that everything is working and then kill it with ctrl+c
  7. /etc/init.d/dhcp start


This is what /etc/dhcpd.conf could look like.

subnet 192.168.0.0 netmask 255.255.255.0 {
        range 192.168.0.100 192.168.0.199;

        # The way to the internet is throu the NAT-router
        # and he has ip 192.168.0.1 (ha also has the dns)
        option routers 192.168.0.1;
        option domain-name-servers 192.168.0.1;

        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.0.255;

        default-lease-time 600;
        max-lease-time 7200;
}

# We do not want new ip adresses to out workstation all the time
# so let's fix so that we get the same all the time.
host workstation {
        hardware ethernet 00:04:61:53:9b:80;
        fixed-address 192.168.0.33;
}

# also make sure that the ngw100 also gets the same ip, 
# it just annoying to have them jumping around.
host ngw100 {
        hardware ethernet 00:40:63:f4:bb:2e;
        fixed-address 192.168.0.34;

        next-server 192.168.0.4;
        filename "test.img"; 
}


And at this stage we really have the same functionality as before.

[edit] tftp

  1. ssh user@192.168.0.4
  2. sudo su
  3. apt-get install tftpd
  4. more /etc/inetd.conf | grep tftp
  5. mkdir /srv/tftp
  6. netstat -lu | grep tftp


[edit] Boot image

Create a boot image and place it in the tftp server, and point to that image in the dhcp config.


[edit] NGW100 and U-Boot

  1. rs232, press space and go into uboot
  2. remove the default tftp server settings
    • printenv
    • setenv serverip
    • setenv tftpip
    • saveenv
  3. then boot with bootp


[edit] TODO in this tut.

  1. How to prepare the boot image for the NGW
  2. Where to put it
  3. etc etc


Use some information from this page.

Personal tools