option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.170; # option netbios-name-servers 192.168.1.170; # --- 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.1.128 192.168.1.254; default-lease-time 21600; max-lease-time 43200; filename "/pxelinux.0";
# we want the nameserver to appear at a fixed address host ns { next-server marvin.redhat.com; hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254; 保存并且退出,其中NTP服务器、NIS服务器、以及NETBIOS服务器并不是必须,但是一定要注意后面手动添加的一行:filename "/pxelinux.0"; 完成之后启动服务: # service dhcpd restart 在客户端启动之后通过查看文件/var/lib/dhcp/dhcpd.leases可以得知客户端是否正常获得IP地址
2.配置DNS服务: 按照刚才DHCP配置文件中的内容去配置DNS即可,这个步骤不是必须;
3.配置TFTP服务: 这种安装的原理是客户端启动之后通过TFTP服务器获得配置文件信息和安装信息,因此需要开启TFTP服务。 # vi /etc/xi net.d/tftp TFTP服务为非独立服务,更改其中的内容如下: # default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. 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 } 之后重启TFTP服务:/etc/rc.d/init.d/xinetd restart或者干脆chkconfig tftp on即可
4.配置NFS服务: # vi /etc/exports 添加安装树的路径: /installing/var/ftp/pub 192.1681.0/24(ro,async) 保存退出 # service portmap restart # service nfs restart # exportfs –rv # showmount –e # chkconfig nfs on 出现下面内容即可: /installing/var/ftp/pub 192.168.1.0/24
5.配置支持PXE启动: # mkdir /tftp ————>若该文件夹已经存在则不用建立 # cp /usr/lib/syslinux/pxelinux.0 /tftpboot 把Linux第一张安装光盘上/image/pxeboot/initrd.img和vmlinux 以及isolinux/*.msg拷贝到/tftpboot目录下 # cd /tftpboot # mkdir pxelinux.cfg # cd pxelinux.cfg # vi default 配置文件default文件的内容如下:
option time-offset -18000; # Eastern Standard Time # option ntp-servers 192.168.1.120; # option netbios-name-servers 192.168.1.120; # --- 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.1.128 192.168.1.130; default-lease-time 21600; max-lease-time 43200; filename "/pxelinux.0";
# we want the nameserver to appear at a fixed address host ns { next-server marvin.redhat.com; hardware ethernet 12:34:56:78:AB:CD; fixed-address 207.175.42.254; } } # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.sample
这样用户可以通过输入某种版本的LABEL(例如,rhel4u2-i386)来选择具体的安装版本。为了能在安装时知道有哪些备选,可以让 pxelinux.0提示要户选择之前显示一个列表。这通过在default里指定DISPLAY选项来实现。在上面的样例中,我们将所有备选Red Hat Linux版本列在文件pxelinux.cfg/list中,它的内容会被pxelinux.0显示出来。
如果需要的话这是一个/tftpboot/pxelinux.cfg/list文件的例子,/tftpboot/pxelinux.cfg/list文件内容如下: Choose one of the following Linux distributions for your installation: Name Distribution Arch. Installation media ------------------------------------------------------------------------- rhel3u6-i386 RHEL 3 AS U6 i386 192.168.138.1:/instsvr/i386/rhel3u6 rhel3u6-x86_64 RHEL 3 AS U6 x86_64 192.168.138.1:/instsvr/x86_64/rhel3u6 rhel4u2-i386 RHEL 4 AS U2 i386 192.168.138.1:/instsvr/i386/rhel4u2
# Kickstart file automatically generated by anaconda.
install cdrom text key --skip lang en_US.UTF-8 keyboard us network --bootproto=static --ip=10.66.0.101 --netmask=255.255.254.0 --gateway=10.66.1.254 --nameserver=10.66.63.10 rootpw --iscrypted $1$bjcQdYD5$.tXMsXOkWJlIDRPSyUGGa1 firewall --disabled authconfig --enableshadow --enablemd5 selinux --disabled timezone Asia/Shanghai bootloader --location=mbr --driveorder=hda # 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 part /boot --fstype ext3 --size=100 part swap --size=512 part /bill --fstype ext3 --size=2048 part / --fstype ext3 --size=0 --grow