[root@localhost ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only [root@localhost ~]# yum install dhcpd-* -y[root@localhost ~]# cp /usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample /etc/dhcpd.conf
cp: overwrite `/etc/dhcpd.conf'? y [root@localhost ~]# [root@localhost ~]# vim /etc/dhcpd.confsubnet 192.168.10.0 netmask 255.255.255.0 {
# --- default gateway
option routers 192.168.10.8; option subnet-mask 255.255.255.0; filename "pxelinux.0"; next-server 192.168.10.8; option nis-domain "domain.org"; option domain-name "domain.org"; option domain-name-servers 192.168.1.1;option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1; # option netbios-name-servers 192.168.1.1; # --- Selects point-to-point node (default is hybrid). Don't change this unless # -- you understand Netbios very well # option netbios-node-type 2;range dynamic-bootp 192.168.10.128 192.168.10.254;
重启dhcp服务:
[root@localhost ~]# service dhcpd restart Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ] [root@localhost ~]#安装tftp [root@localhost ~]# yum install tftp* -y
[root@localhost ~]# cd /etc/xinetd.d/
[root@localhost xinetd.d]# pwd /etc/xinetd.d [root@localhost xinetd.d]# ls chargen-dgram discard-dgram eklogin krb5-telnet tcpmux-server chargen-stream discard-stream ekrb5-telnet kshell tftp daytime-dgram echo-dgram gssftp rmcp time-dgram daytime-stream echo-stream klogin rsync time-stream修改tftp的配置文件:
[root@localhost xinetd.d]# vim tftpservice tftp
{ socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 }重启xinetd:
[root@localhost xinetd.d]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@localhost xinetd.d]#查看根下是否存在tftpboot
[root@localhost ~]# cd / [root@localhost /]# ls bin dev home lost+found misc net proc sbin srv tftpboot usr boot etc lib media mnt opt root selinux sys tmp var [root@localhost /]#查看pxelinux.0存在哪里?
[root@localhost /]# cd tftpboot/ [root@localhost tftpboot]# [root@localhost tftpboot]# find / -name pxelinux.0 /tftpboot/linux-install/pxelinux.0 /usr/lib/syslinux/pxelinux.0 [root@localhost tftpboot]#将pxelinux.0复制到/tftpboot下:
[root@localhost tftpboot]# cd /usr/lib/syslinux/ [root@localhost syslinux]# ls chain.c32 isolinux.bin mbr.bin pxelinux.0 syslinux.exe com32 isolinux-debug.bin memdisk sys2ansi.pl syslinux-nomtools copybs.com keytab-lilo.pl menu.c32 syslinux ethersel.c32 mboot.c32 mkdiskp_w_picpath syslinux.com [root@localhost syslinux]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ [root@localhost syslinux]# ls /tftpboot/ linux-install pxelinux.0 [root@localhost syslinux]#[root@localhost tftpboot]# mkdir pxelinux.cfg
[root@localhost tftpboot]# cd pxelinux.cfg/ [root@localhost pxelinux.cfg]# ls [root@localhost pxelinux.cfg]#[root@localhost ~]# cd /mnt/isolinux/
[root@localhost isolinux]# ls boot.cat initrd.img memtest rescue.msg vmlinuz boot.msg isolinux.bin options.msg splash.lss general.msg isolinux.cfg param.msg TRANS.TBL [root@localhost isolinux]# 查看isolinux.cfg中的内容: [root@localhost isolinux]# cat isolinux.cfg default linux prompt 1 timeout 600 display boot.msg F1 boot.msg F2 options.msg F3 general.msg F4 param.msg F5 rescue.msg label linux kernel vmlinuz append initrd=initrd.img label text kernel vmlinuz append initrd=initrd.img text label ks kernel vmlinuz append ks initrd=initrd.img label local localboot 1 label memtest86 kernel memtest append -[root@localhost isolinux]#
将isolinux.cfg复制到/tftpboot/pxelinux.cfg/default中,并编辑:
[root@localhost isolinux]# cp isolinux.cfg /tftpboot/pxelinux.cfg/default [root@localhost isolinux]# vim /tftpboot/pxelinux.cfg/defaultdefault menu.c32
prompt 1 timeout 600 display boot.msg MENU TITLE welcome to linuxlabel linux
menu lable ^Install or upgrade an existing system for ks menu default kernel vmlinuz append initrd=initrd.img ks=ftp://192.168.10.8/ks.cfg label local menu lable1 Boot from ^local drive localboot 1 [root@localhost ~]# cp /mnt/isolinux/initrd.img /tftpboot/ #镜像 [root@localhost ~]# cp /mnt/isolinux/vmlinuz /tftpboot/ #内核 [root@localhost ~]# cp /usr/lib/syslinux/menu.c32 /tftpboot/ #图片 [root@localhost ~]# [root@localhost ~]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@localhost ~]#
[root@localhost ~]# yum install vsftpd pykickstart-* -y
[root@localhost ~]# yum install system-config-kickstart -y [root@localhost ~]# system-config-kickstart
[root@localhost ~]# cd /var/ftp
[root@localhost ftp]# ls ks.cfg pub [root@localhost ftp]# ll total 8 -rw-r--r-- 1 root root 1542 Jan 17 08:25 ks.cfg drwxr-xr-x 2 root root 4096 Dec 4 2009 pub[root@localhost ftp]# mount /dev/cdrom /var/ftp/pub
mount: block device /dev/cdrom is write-protected, mounting read-only [root@localhost ftp]# pstree -p | grep vsftpd [root@localhost ftp]# service vsftpd restart Shutting down vsftpd: [FAILED] Starting vsftpd for vsftpd: [ OK ] [root@localhost ftp]# service vsftpd restart Shutting down vsftpd: [ OK ] Starting vsftpd for vsftpd: [ OK ] [root@localhost ftp]# lsof -i :21 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME vsftpd 27198 root 3u IPv4 97261 TCP *:ftp (LISTEN)重启新机器自动安装: