- yum install -y dhcp* tftp* 即可!nfs系统默认已经安装,稍后会配置;
- vi /etc/xinetd.d/tftp
- service tftp
- {
- disable = no
- socket_type = dgram
- protocol = udp
- wait = yes
- user = root
- server = /usr/sbin/in.tftpd
- server_args = -u nobody -s /tftpboot
- per_source = 11
- cps = 100 2
- flags = IPv4
- }
- 需要修改1个地方
- disable = yes 修改为no 即可!
配置tftp+pxe:
- 安装linux系统,首先需要挂载linux安装镜像,可以是iso,可以是linux光盘:【这样需要注意:分别挂载3个系统的光盘,也可以从其他地方拷贝iso文件。】
- 我开始挂载的是centos5.0光盘:
- mount /dev/cdrom /mnt 即可!然后执行如下步骤:
- mkdir -p /tftpboot/{centos5.0,centos5.3,centso5.4}
- cd /tftpboot &&cp /usr/lib/syslinux/pxelinux.0 ./
- mkdir -p pxelinux.cfg
- cp /mnt/isolinux/isolinux.cfg pxelinux.cfg/default
- 如上这些文件可以共用:但是下面这些文件只能拷贝对应ISO镜像的文件到如下目录
- cp /mnt/images/pxeboot/{vmlinuz,initrd.img} centos5.0/
- 完毕!此步操作还需要分别进入5.3、5.4光盘:拷贝
- vmlinuz,initrd.img 两个文件到对应的目录:
- tftpboot目录下文件截图如下
- ###+## Welcome To Linux Install Center ##########################
- Please select system version , You can select 5.0 or 5.3 or 5.4!
- This 5.0 is 32 bit ,and 5.3 is 64 bit ,5.4 is 32 bit ++++++++++++
- timeout 60
- display boot.msg
- F1 boot.msg
- F2 options.msg
- F3 general.msg
- F4 param.msg
- F5 rescue.msg
- label 5.0
- kernel centos5.0/vmlinuz
- append ks=nfs:192.168.2.79:/centosinstall/centos5.0/ks.cfg ksdevice=eth0 initrd=centos5.0/initrd.img
- label 5.3
- kernel centos5.3/vmlinuz
- append ks=nfs:192.168.2.79:/centosinstall/centos5.3/ks.cfg ksdevice=eth0 initrd=centos5.3/initrd.img
- label 5.4
- kernel centos5.4/vmlinuz
- append ks=nfs:192.168.2.79:/centosinstall/centos5.4/ks.cfg ksdevice=eth0 initrd=centos5.4/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 -
- vi /etc/exports
- /centosinstall/centos5.0 *(rw,sync)
- /centosinstall/centos5.3 *(rw,sync)
- /centosinstall/centos5.4 *(rw,sync)
- # Kickstart file automatically generated by anaconda.
- install
- text
- nfs --server=192.168.2.79 --dir=/centosinstall/centos5.0
- key --skip
- lang zh_CN.UTF-8
- keyboard us
- network --device eth0 --bootproto=dhcp --noipv6
- rootpw linux@passwd
- firewall --disabled
- authconfig --enableshadow --enablemd5
- selinux --disabled
- timezone Asia/Shanghai
- bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
- # The following is the partition information you requested
- # Note that any partitions you deleted are not expressed
- # here so unless you clear all partitions first, this is
- # not guaranteed to work
- clearpart --all --initlabel
- part /boot --fstype ext3 --size=200
- part swap --size=4000
- part /www/logs --fstype ext3 --size=20000
- part / --fstype ext3 --size=20000
- part /home --fstype ext3 --size=10000
- part /www --fstype ext3 --size=1 --grow
- %packages
- @admin-tools
- @base
- @core
- @development-libs
- @development-tools
- @editors
- @system-tools
- @base-x
- @chinese-support
- keyutils
- kexec-tools
- trousers
- fipscheck
- device-mapper-multipath
- imake
- audit
- xorg-x11-server-Xnest
- xorg-x11-server-Xvfb
- ddns-update-style interim;
- ignore client-updates;
- next-server 192.168.2.79;
- filename "pxelinux.0";
- allow booting;
- allow bootp;
- subnet 192.168.0.0 netmask 255.255.252.0 {
- # --- default gateway
- option routers 192.168.0.1;
- option subnet-mask 255.255.252.0;
- # option nis-domain "domain.org";
- # option domain-name "192.168.0.10";
- # option domain-name-servers 192.168.0.10;
- 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;
- host ns {
- hardware ethernet 00:1a:a0:2b:38:81;
- fixed-address 192.168.2.101;}
- host ns1 {
- hardware ethernet 00:0c:29:2b:90:67;
- fixed-address 192.168.2.102;}
- }