PXE+NFS+DHCP+TFTP+KICKSTART自动安装

 

1需要的软件

tftp-server  NFS   DHCP  三个文件均可yum  -y install  xxx*安装即可

                                      [以下红色字段均为修改的地方]

2配置

2.1 挂载CENTOS光盘 因为需要里面的文件

   mount /CENTOS.iso  /mnt/cdrom

2.2 新建mkdir /tftpboot

cp  /mnt/cdrom/isolinux/*  /tftpboot

2.3 进入/tftpboot新建目录 mkdir pxelinux.cfg

cp  /mnt/cdrom/isolinux/isolinux.cfg  /mnt/cdrom/isolinux/pxelinux.cfg/

mv  isolinux.cfg  default

2.4拷贝ISO镜像文件

mkdir /disk

cp   /mnt/cdrom/*      /disk

 

 

3配置文件

3.1配置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              修改1

        socket_type             = dgram

        protocol                = udp

        wait                    = yes

        user                    = root

        server                  = /usr/sbin/in.tftpd

        server_args             = -u nobody -s /tftpboot  修改2

        per_source              = 11

        cps                     = 100 2

        flags                   = IPv4

}

~

####################    需要修改的地方

修改将之前的yes改为no

修改将之前的-s /tftpboot 改为任何用户   -u nobody -s /tftpboot

 

启动服务  /etc/inid.d/xined start

 

3.2 配置DHCP

拷贝配置文件

vi  /etc/dhcpd.conf

 

option domain-name "systeng.net";

default-lease-time 6000;

max-lease-time 11400;

authourtative;

ddns-update-style ad-hoc;

log-facility local7;

subnet 192.168.1.0 netmask 255.255.255.0{                 ##自动获取的网段

range 192.168.1.11 192.168.1.155;                         ##获取的IP

option domain-name-servers 202.99.160.68;

option domain-name "systeng.net";

option netbios-name-servers 192.168.1.65;                  ##nfs服务器地址

option routers 192.168.1.1;                               ##网关

option broadcast-address 192.168.1.255;

default-lease-time 6000;

max-lease-time 11400;

filename "/pxelinux.0";

next-server 192.168.1.65;

}

 

启动DHCP  service dhcpd restart

 

3.3配置NFS

/etc/exports中添加

/disk  *(ro,sync)                 ###获取安装文件/disk和自动获取IP * 代替

 

最后使用exportfs –a 启动 

 


4 进行自动化安装

4.1 kickstart自动安装配置文件(ks.cfg:

     #yum install system-config-kickstart

     #system-config-kickstart   

     在界面中选择需要自动配置的人工干预选项目。    

     生成ks.cfg文件保存到/pxeks下面。

 

 

 

你可能感兴趣的:(linux,DHCP,系统安装,休闲,pxe)