系统centos6.5x86_64

1.DHCP服务配置.

yum安装dncp

[root@cnhzdhcp16593 ~]# yum -y install dhcp

配置dhcp服务,新建dhcpd.conf在/etc/dhcp下:

ddns-update-style interim;
ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gatewayt
       option routers                  192.168.1.1;  #我的eth1为192.168.1.1,两张网卡
        option subnet-mask              255.255.255.0;

range dynamic-bootp 192.168.1.2 192.168.1.254;
        default-lease-time 21600;
        max-lease-time 43200;

allow bootp;
allow booting;
next-server 192.168.1.1;  #tftpserver IP地址
filename "pxelinux.0";
}

配置完成重新启动.  service dhcpd restart

2.配置tftp服务.

yum安装tftp

[root@cnhzdhcp16593 ~]# yum -y install tftp-server tftp

配置xinetd.d下tftp文件.

service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -u nobody -s /tftpboot  #加入-u nobody 任何人可以访问.
        disable                 = no  #yes改为no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}
重新启动tftp服务,需要重启xinetd服务(xinetd是新一代的网络守护进程服务程序,又叫超级Internet服务器,常用来管理多种轻量级Internet服务。)

service xinetd restart

3.NFS服务配置.

yum安装NFS.

[root@cnhzdhcp16593 ~]# yum -y install nfs*

配置nfs文件.

[root@cnhzdhcp16593 ~]# vim /etc/exports

/netinstall/centos6.7 192.168.1.0/24(rw,sync)  #指定共享目录和IP网段
/netinstall/centos6.8 192.168.1.0/24(rw,sync)  #指定共享目录和IP网段

mkdir –p /netinstall/centos{6.7,6.8} #创建netinstall文件夹和需要的文件

4.pxe启动文件创建

[root@cnhzdhcp16593 tftpboot]# cp /usr/share/syslinux/pxelinux.0 /tftpboot/   #copy pxelinux.0文件到tftpboot下.

[root@cnhzdhcp16593 /]# mount -o loop CentOS-6.8-x86_64-bin-DVD1.iso /mnt #挂载iso系统至/mnt下.

[root@cnhzdhcp16593 ~]# mkdir /tftpboot/centos{6.7,6.8} –p   #创建pxe所需启动文件目录.
[root@cnhzdhcp16593 ~]# cp -r /mnt/images/pxeboot/* /tftpboot/centos6.8/  #copy centos6.8启动文件至/tftpboot/centos6.8下

[root@cnhzdhcp16593 ~]# cp -r /mnt/images/pxeboot/* /tftpboot/centos6.7/  #挂载centos6.7至mnt下进行copy

[root@cnhzdhcp16593 ~]# mkdir /tftpboot/pxelinux.cfg/{default,list}  #创建default和list文件,(也可以从/mnt/isolinux/isolinux.cfg修改为default)系统引导菜单和版本.

编辑default文件:

default 0
prompt 1
timeout 600
display pxelinux.cfg/list    #启动列表

label 0
        localboot 0xffff   #设置label 0为本地启动

label 1
kernel centos6.7/vmlinuz  #修改kernel路径
append ks=nfs:192.168.1.1:/netinstall/centos6.7/ks.cfg initrd=centos6.7/initrd.img #添加nfs路径

label 2
kernel centos6.8/vmlinuz
append ks=nfs:192.168.1.1:/netinstall/centos6.8/ks.cfg initrd=centos6.8/initrd.img #同上

编辑list文件:

Welcome to my linux pxe install:
########################################################################

Num     Name          Distribution              Arch.           Installation media
-----------------------------------------------------------------------------------------------------
0)     local boot
1)     Centos-6.7     Centos-6.7-x86_64         x86_64          nfs://192.168.1.1/netinstall/centos6.7
2)     Centos-6.8     Centos-6.8-x86_64         x86_64          nfs://192.168.1.1/netinstall/centos6.8

[root@cnhzdhcp16593 pxelinux.cfg]# cp -r /mnt/* /netinstall/centos6.8/    #copy系统文件

[root@cnhzdhcp16593 pxelinux.cfg]# cp -r /mnt/* /netinstall/centos6.7/    #copy系统文件

5.生成ks.cfg文件.

yum安装system-config-kickstart:

yum -y install system-config-kickstart

system-config-kickstart    #在图形化运行,配置应答文件.

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use NFS installation media
nfs --server=192.168.1.1 --dir=/netinstall/centos6.7
# Root password
rootpw --iscrypted $1$VYnTpm4f$7XYrGJwCS4EmMm26l1pmh.
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone  Asia/Shanghai
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all 
# Disk partitioning information
part swap --fstype="swap" --size=4000
part / --fstype="ext4" --grow --size=1

%packages
@basic-desktop
@desktop-debugging
@desktop-platform
@fonts
@general-desktop
@graphical-admin-tools
@guest-agents
@input-methods
@legacy-x
@perl-runtime
@remote-desktop-clients
@virtualization
@virtualization-client
@virtualization-platform
@x11

%end

把生成的ks.cfg文件copy至/netinstall/centos6.7和6.8下,修改nfs --server=192.168.1.1 --dir=/netinstall/centos6.7或者centos6.8

需要注意的是关闭防火墙和selinux或者修改以下:

vim /etc/sysconfig/selinux #修改SELinux状态

SELINUX=permissive    #默认的enforcing修改为permissive

setenforce 0    #或者重启系统

#防火墙开放服务和端口号

firewall-cmd --permanent --add-port=111/tcp

firewall-cmd --permanent --add-port=111/udp

firewall-cmd --permanent --add-port=20048/tcp

firewall-cmd --permanent --add-port=20048/udp

firewall-cmd --permanent --add-port=69/udp

firewall-cmd --permanent --add-service=nfs

firewall-cmd --permanent --add-service=dhcp

firewall-cmd --reload

在客户端进行测试从nic网卡启动.

pxe kickstart 配置+TFTP+NFS多版本系统部署的更多相关文章

  1. PXE+Kickstart+DHCP+TFTP实现无人值守安装操作系统

    PXE+Kickstart+DHCP+TFTP实现无人值守安装操作系统 PXE + Kickstart PXE的工作流程及配置文件 Kickstart的配置文件 Linux安装大致可以分为2个阶段 第 ...

  2. PXE+kickstart无人值守安装CentOS 7

    kickstart+cobbler系列文章:http://www.cnblogs.com/f-ck-need-u/p/7048359.html 本文是PXE+kickstart无人值守安装CentOS ...

  3. (转)PXE+kickstart无人值守安装CentOS 7

    kickstart+cobbler系列文章:http://www.cnblogs.com/f-ck-need-u/p/7048359.html 本文是PXE+kickstart无人值守安装CentOS ...

  4. PXE+Kickstart 批量安装CentOS 7

    安装之前 将需要安装 CentOS 的服务器与 PXE 服务器通过网络设备连接:PXE 服务器安装 CentOS,并且关闭firewalld.selinux,设置静态IP地址,本例设为10.0.0.1 ...

  5. kickstart自动化安装--tftp+nfs+dhcp

    使用kickstart实现Centos 自动化安装 Kickstart自动化安装简介: 规模化:同时装配多台 服务器 自动化 :安装系统,配置各种服务 远程实现:不需要光盘,U盘等安装介质 优势: ( ...

  6. 使用 PXE+Kickstart 实现无人值守批量部署系统

    一.废话两句 在云数据中心,一次几十台甚至几百台服务器上线,系统安装将变得非常繁琐,系统安装好了后还会涉及很多配置,如果一台台来安装的话工作量非常大.(虽然有加班费,开个玩笑)为了解决这个问题,我们需 ...

  7. pxe+kickstart部署多个版本的Linux操作系统(下)---实践篇

        我们在企业运维环境中,难免会遇到使用多个Linux操作系统的情况,如果每天都需要安装不同版本的Linux系统的话,那么使用Kickstart只能安装一种版本的Linux系统的方法则显得有些捉襟 ...

  8. linux系统PXE+Kickstart自动安装系统

    一.PXEPXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服 ...

  9. pxe+kickstart自动化批量安装系统详解-技术流ken

    前言 pxe+kickstart是一款可以实现自动化批量安装系统的服务,比较经典,下面将详细介绍此服务的安装和使用. 系统环境准备 系统版本:CentOS release 6.7 (Final) 内网 ...

随机推荐

  1. [Android]通过js方法回调部分native报错 Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'

    在android4.2以前,注入步骤如下: webview.getSetting().setJavaScriptEnable(true); class JsObject { public String ...

  2. X32,X64,X86 代表什意义

    X32,X64,X86是什么意思 各代表什么:X86指32位,X64指64位,现在用户最多的是XP,但win7是趋势,发展很快,建议你装个win7 32位的系统,下载的话地方很多,官方安装原版和gho ...

  3. Thinkphp源码分析系列–开篇

    目前国内比较流行的php框架由thinkphp,yii,Zend Framework,CodeIgniter等.一直觉得自己在php方面还是一个小学生,只会用别人的框架,自己也没有写过,当然不是自己不 ...

  4. NHibernate系列文章十二:Load/Get方法

    摘要 NHibernate提供两个方法按主键值查找对象:Load/Get. 1. Load/Get方法的区别 Load: Load方法可以对查询进行优化. Load方法实际得到一proxy对象,并不立 ...

  5. frame中隐藏横向滚动条

    设置frame的scrolling="yes",在右侧页面的body里加入: style="overflow-x:hidden;"  如:<body st ...

  6. 更改form字段内容颜色

    1.fnd_global.Newline ---换行2.设置栏位值颜色:POST-QUERY SET_ITEM_INSTANCE_PROPERTY('FIND_RESULT.STATUS',CURRE ...

  7. docker网络配置之自定义网桥

    使用特定范围的 IP (仅适用于v1.x)不适用于新版的v1.1x Docker 会尝试寻找没有被主机使用的 ip 段,尽管它适用于大多数情况下,但是它不是万能的,有时候我们还是需要对 ip 进一步规 ...

  8. mysql问题小结

    1.数据表存在,但查询时提示不存在 原因:默认情况下,mysql在windows对表名大小不敏感(lower_case_table_names=1),在linux上大小敏感(lower_case_ta ...

  9. Web API - window - 获取滑动位置

    这两个属性都可以获取当前页面的滑动高度 虽然取到了同样的数据,但是我相信底层还是有区别的 不然不会用浪费api吧!

  10. java基础八 [序列化和文件的输入/输出](阅读Head First Java记录)

    对象具有状态和行为两种属性.行为存在类中的方法中,想要保存状态有多种方法,这里介绍两种: 一是保存整个当前对象本身(通过序列化):一是将对象中各个状态值保存到文件中(这种方式可以给其他非JAVA程序用 ...