November 25, 2004

PXE Server

只要使用 dhcp server 及 tftp server, 就可以架 PXE Server
環境: pxelinux.0(from the SYSLINUX distribution), kernel, initrd file, image 等檔案放在 /tftpboot, tftp server 目錄指向這裡

使用 dhcp 3.0, dhcp.conf 範例

ddns-update-style none;
default-lease-time 86400;
max-lease-time 86400;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.11 192.168.1.50;
filename "pxelinux.0";
next-server 192.168.1.233;
option time-offset 3600;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.253,168.95.1.1;
option domain-name "i";
}


若沒有指定 next-server, 會以 option routers 當作 tftp server

使用 udhcp 0.98, udhcpd.conf 範例

start 10.1.1.10
end 10.1.10.254
interface eth0
lease_file /var/dhcpd/udhcpd.leases
option dns 168.95.1.1 139.175.55.244
option subnet 255.255.0.0
option router 10.1.1.1
option lease 600
siaddr 10.1.1.1
boot_file pxelinux.0

使用 inetd, /etc/ined.conf 範例

tftp dgram tcp wait root /usr/sbin/tftpd tftpd -s /tftpboot

使用 xinetd, /etc/xinetd.d/tftp 範例

service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}

/tftpboot/pxelinux.cfg/default 範例

default dos
timeout 50
prompt 2

label linux
kernel systemk
append initrd=systemz ramdisk_size=65535 root=/dev/ram0

label dos
kernel memdisk
append initrd=psetup.img

ref.
PXE Spec
PXE daemon
http://phorum.study-area.org/viewtopic.php?t=19192

Posted by pank at November 25, 2004 11:31 AM
Comments

check lease file path
mkdir -p /var/dhcpd
touch /var/dhcpd/udhcpd.leases

check if UDP port 67 is listening
netstat -nlu
should be a line
udp 0 0 0.0.0.0:67 0.0.0.0:*

Posted by: pank at November 23, 2006 03:36 PM

I used the same udhcpd.conf and the start the udhcp servr as follows:

udhcpd /etc/udhcpd.conf

but the PC connected to the udhcp server could not get the IP from the server.

Please advse.

Thanks,

John

Posted by: John at November 20, 2006 01:50 PM
Post a comment













Remember personal info?