2007年4月10日 星期二

Example for Tuition - How to add PXE Server

Example for Tuition - How to add PXE Server

Install and Configure the ATFTPD Server and Dhcpd server


(1) For Linux System

1. Add ATFTPd Packages

[kamikaze]$ ./scripts/feeds install atftpd


2. make menuconfig


Disable following:

a.Base system ---> busybox -->Configuration --->Networking Utilities -->udhcp server (Disable or unmask this item)

select following

a.Base system --->dnsmasq

b.Network --->FTP --->atftpd


3. make kernel and root file system

[kamikaze]$ make V=99


4. Get the new Linux and load it to ZNAS board

get the new linux from ~/kamikaze/bin/openwrt-rdc-jffs2-64k-znas.img


(2) For pxelinux Tools

1.Download nasm-2.08.tar.gz
2.Download syslinux-3.85.tar.gz

3. Compile nasm and install it , ./configure ; make ; make install
4. Compile syslinux and get 3 files --> pxelinux.0 , menu.c32 and memdisk
5. Copy these files to /mnt/sda1/tftboot

# cp core/pxelinux.0 /tftpboot
# cp com32/memu/menu.c32 /tftpboot
# cp memdisk/memdisk /tftpboot


(3) Configure folliwing 1./etc/config/dhcp 2./etc/xinetd.d/tftp 3. tftboot/pxelinux.cfg/default
4. set the /etc/config/network as static ip

1. /etc/config/dhcp ( you can Modify /etc/init.d/dnsmasq instead of this method)

config 'dnsmasq'
option 'domainneeded' '1'
option 'boguspriv' '1'
option 'filterwin2k' '0'
option 'localise_queries' '1'
option 'local' '/lan/'
option 'domain' 'lan'
option 'expandhosts' '1'
option 'nonegcache' '0'
option 'authoritative' '1'
option 'readethers' '1'
option 'leasefile' '/tmp/dhcp.leases'
option 'resolvfile' '/tmp/resolv.conf.auto'
option 'enable_tftp' '1'
option 'tftp_root' '/mnt/sda1/tftboot'
option 'dhcp_boot' '/mnt/sda1/tftboot/pxelinux.0'

config 'dhcp' 'lan'
option 'interface' 'lan'
option 'start' '200'
option 'limit' '50'
option 'leasetime' '12h'

config 'dhcp' 'wan'
option 'interface' 'wan'
option 'ignore' '1'

2. Modify the /etc/xinetd.d/tftp as following

ervice tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/atftpd
server_args = -s /mnt/sda1/tftboot
per_source = 11
cps = 100 2
flags = IPv4
}

3. the file of tftboot/pxelinux.cfg/default as following


DEFAULT menu.c32
PROMPT 0
ALLOWOPTIONS 0
TIMEOUT 50

MENU TITLE PXE Menu


LABEL dos
MENU LABEL DOS
kernel memdisk
append initrd=dos.img


LABEL win98
MENU LABEL WIN98
kernel memdisk
append initrd=win98.img


LABEL winme
MENU LABEL WINME
kernel memdisk
append initrd=winme.img