2.TFTP 由于必须支持TSIZE 协议,所以不能安装最原始的TFTP包。我选择使用 tftp-hpa
: q3 X6 M# Y" G- a2 }- |5 i( k.. r. z& d, z- B w5 N' |- d5 @
编辑文件 /etc/xinetd.d/tftp (若没有,则添加tftp文件)(若不存在xinetd.d,请安装 xinetd 包)
+ D, {+ ]+ S; f: _# F # default : off
/ {) j2 c5 X7 {0 a9 ]- { # description : The tftp server serves files using the trivial filetransfer \; ?/ n6 T3 l, n" g/ U; M8 s
# protocol. The tftp protocol is often used to boot diskless \
9 y, R5 D" }" a, O1 H # workstations, download configuration files to network-aware printers,\3 h0 q- ~1 A; B
# and to start the installation process for some operating systems./ |- K) A7 u% {9 ], x% f
service tftp. R; F% k7 u* Y* t1 N) ?% u
{( ?$ i5 C! K; {0 u
disable = no
) v! P5 a; [, \; x8 Y6 ?2 | socket_type = dgram
4 }: \: Q/ j: j+ [) f& D protocol = udp
& k! M- |9 Y' V% }5 _0 I wait = yes
6 E/ s0 D5 {* C user = root6 D( @& i# N- U/ B/ T; w k
server = /usr/sbin/in.tftpd
0 `0 |1 Y' I0 l) Z2 A4 G server_args = -s /tftpboot
9 N L7 n0 A) ^( \$ X8 K; p: _ per_source = 11) w7 m8 {, N) Y C
cps = 100 2
3 x/ u) R d9 \3 b flags = IPv4
' A, _3 Q1 v0 D7 @3 [: [ }
- m1 e9 ]0 s( t& K1 g 这里将 /tftpboot定义为 tftp 服务的默认目录,您可以自行修改。
# y' T: v; q4 P$ ^ 保存之后重启 /etc/init.d/xinetd 服务,即可开启 tftp 服务。
, b5 N2 Z5 X% G7 } 如何测试 tftp 是否成功开启?2 p' Z, j7 T, v4 g7 w- |
在 tftp 目录下创建一个文件,比如 1.txt .
4 O( Z; y3 e; n( t( _6 X. {+ s. V 在 Shell中连接 tftp 服务:! A$ V2 D" i6 W! t) F) e/ E, _
tftp 127.0.0.1
6 N7 ^( g& H9 R$ x tftp>get 1.txt: w+ H- \- M; I7 W
若服务成功开启,则能看到成功下载文件的提示。并在当前目录下找到1.txt文件。& m3 v; V( y. K P* \/ ^
接着复制光盘中 isolinux 目录下的 vmlinuz、initrd.img文件到 /tftpboot目录下。/ T0 T$ y0 M' ?. s% n& ^8 Q0 B
在 /tftpboot中创建文件夹 syslinux.cfg .syslinux.cfg 中保存了 pxelinux的两个配置文件:default 、list.
( j4 z# ^; ^: W default :
- Z/ E) u7 a/ |( m default linux& {- l: `$ Y2 a. ^* V f$ S
label linux6 T, f5 [6 t/ J( _0 |: L; }# x
kernel vmlinuz9 K- r8 s1 E' G/ P6 A
append initrd=initrd.img devfs=nomount nofb ramdisk_size=9216
) O* P0 u1 A, l: n4 l# y0 H( P 你可以写很多个label ,这取决于你同时想在这台服务器上提供多少种版本的 Linux给客户机安装。一个版本一个label ,当然kernel、与initrd文件名不可以重复。
+ @& K( Y* l% {/ s/ M list:
! v9 K& v) g# o6 U' q2 B# z Choose one of the following Linux distributions for your installation:/ L8 U, T8 W7 P7 e
Name Distribution Arch. Installation media
: b) Y# t# R3 Q ^( P -----------------------& S/ U" M) g9 I- Z
CentOS CentOS 4.4 i386 192.168.99.90:/: ]! x$ Q! n' {" v! K% W1 ~+ c
你也可以添加多行,用来选择不同的发行版本。在选择的时候填写Name下的内容即可。
/ l. l* c/ i1 H0 o: ~8 i' j 三、复制光盘文件
' M0 J5 g& h; c; C8 ~, O 将光盘文件复制到对应目录(ftp 、http、nfs ),如果是使用 http 使用以下命令将多张光盘复制到一个目录里面:4 u% V. I3 D: G# l5 G# n& d
[root@bootserver] # cp -arv /media/cdrom/* /install
, C1 G, ?7 c( F- Y5 d4 p( U 如果使用 ftp,请确保可以访问(可以有用户名、密码)。 |