Linux认证考试之关于DHCP+PXE配置文件
1 n' U: Y) E( j0 S6 ~. O+ _DHCP+PXE配置文件
( h. Y' G' P' r/ E2 \, [, e# ?0 ~; N#一个简单的默认dhcp服务器配置文件/etc/dhcpd.conf ddns-update-style interim;
2 x- Q( W5 H: ~: V) @ X, Z( q' Nsubnet 172.16.0.0 netmask 255.255.255.0 { range 172.16.0.10 172.16.0.253;option routers 172.16.0.1;option subnet-mask 255.255.255.0;}
2 B x) K7 e& k1 z! n#配置dhcp服务器# l$ d4 J6 q( W8 W8 Q) J5 j9 ^5 L
###################################
0 E+ ?6 H- e. D1 y4 T C#放在/etc/dhcpd.conf末尾就可以了option space PXE;option PXE.mtftp-ip code 1 = ip-address;class “pxeclients” { match if substring (option vendor-class-identifier, 0, 9) = “PXEClient”;option vendor-class-identifier “PXEClient”;vendor-option-space PXE;# At least one of the vendor-specific PXE options must be set in # order for the client boot ROMs to realize that we are a PXE-compliant # server. We set the MCAST IP address to 0.0.0.0 to tell the boot ROM # that we can‘t provide multicast TFTP (address 0.0.0.0 means no # address)。
3 P, @7 q3 S; _option PXE.mtftp-ip 0.0.0.0;# This is the name of the file the boot ROMs should download. filename “pxelinux.0”;# This is the name of the server they should get it from. next-server 192.168.1.246; //tftp服务器,可以和dhcp服务器不在同一个机器上}
6 `' }$ A, ]5 t$ d$ ]###################################
) `5 V( E ~0 z8 i9 O( i#打开tftp chkconfig tftp ——level 345 on vi /etc/xinetd.d/tftp #看看内容,不用改
! H9 j+ ~6 e# h0 ccd /tftpboot/ mkdir pxelinux.cfg vi default
0 X8 |4 I9 A/ q4 `- J+ d##################################, f3 R% P9 X( L: H) \, x
#default的内容如下DEFAULT install PROMPT 1 LABEL install FC5-x86 KERNEL vmlinuz APPEND initrd=initrd.img devfs=nomount ramdisk_size=16384
7 k5 j- i( L3 L/ k#################################+ p" a W0 i0 I8 [3 D
拷贝光盘的/images/pxeboot/或者FC5/isolinux下面的initrd.img和vmlinuz到/tftpboot下,注意,必须用光盘上的,不能用硬盘的。* H ]' Q- Z8 L
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/. Q% ~# G2 V% G6 |- Y/ F- M
#启动tftp服务/etc/init.d/xinetd restart |