PXE Server

| | Comments (2)

只要使用 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

2 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:*

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

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on November 25, 2004 11:31 AM.

Replace files in msi package was the previous entry in this blog.

man page to ps or pdf file is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.