CentOS_6.3_PXE_server_落英缤纷

CentOS_6.3_PXE_server_落英缤纷

    1  history -c

    2  echo >./.bash_history

    3  hostname

    4  vi /etc/sysconfig/network

    5  chkconfig iptables off

    6  service iptables stop

    7  sed -i -e ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/sysconfig/selinux

    8  vi /etc/sysconfig/network-scripts/ifcfg-eth0 

    9  service network restart 

或者#ifdown eth0 

#ifup eth0

   10  reboot

   11  ifconfig -a

   12  ping -c2 www.163.com

   13  yum -y install dhcp

   14  yum install make wget vim man

   15  yum install tftp-server xinetd vsftpd

   16  mkdir /var/ftp/pub/CentOS6.3_64

   17  cd /usr/local/src

   18  wget http://mirror.symnds.com/distributions/CentOS-vault/6.4/isos/x86_64/CentOS-6.3-x86_64-minimal.iso

   19  mount -o loop CentOS-6.3-x86_64-minimal.iso /var/ftp/pub/CentOS6.3_64

   20  chkconfig dhcpd on

   21  chkconfig xinetd on

   22  chkconfig vsftpd on

   23  chkconfig –list

   24  vim /etc/dhcp/dhcpd.conf 

   25  man 5 dhcpd.conf

   26  vim /etc/dhcp/dhcpd.conf 

#

# DHCP Server Configuration file.

#   see /usr/share/doc/dhcp*/dhcpd.conf.sample

#   see ‘man 5 dhcpd.conf’

#

ddns-update-style interim; 

ignore client-updates; 

authoritative; 

allow booting; 

allow bootp; 

subnet 192.168.100.0 netmask 255.255.255.0 

{   option routers        192.168.100.1; 

option subnet-mask    255.255.255.0; 

next-server           192.168.100.250; 

range dynamic-bootp 192.168.100.80 192.168.100.99; 

filename “pxelinux.0”; 

default-lease-time      21000; 

max-lease-time        43200; 

option time-offset      -18000;  

   27  service dhcpd restart

   28  mkdir /tftpboot/

   29  vim /etc/xinetd.d/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

   30  rpm -qa syslinux 

   31  yum install syslinux

   32  rpm -ql syslinux 

   33  cp /usr/share/syslinux/pxelinux.0 /tftpboot/ 

   34  ls /tftpboot/

   35  yum install system-config-kickstart.noarch //可视化程序,可以不安装,直接创建ks.cfg,可查考/root/anaconda-ks.cfg文件。

   36  ls /root/anaconda-ks.cfg 

   37  cp /root/anaconda-ks.cfg /var/ftp/

   38  cd /var/ftp

   39  mv anaconda-ks.cfg ks6.3.cfg

   40  vim ks6.3.cfg

# Kickstart file automatically generated by anaconda.

#ltform=x86, AMD64, or Intel EM64T 

#version=DEVEL 

# Firewall configuration 

firewall –service=ssh

# Install OS instead of upgrade 

install 

# Use network installation 

url –url=”ftp://192.168.100.250/pub/CentOS6.3_64” 

# Root password 

rootpw qq55754206

# 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 –isUtc Asia/Shanghai 

# Network information 

network  –bootproto=dhcp –device=eth0 –onboot=on 

# System bootloader configuration 

bootloader –location=mbr 

# Clear the Master Boot Record 

zerombr 

# Partition clearing information 

clearpart –all –initlabel  

# Disk partitioning information 

part /boot –fstype=”ext4″ –size=300 

part swap –fstype=”swap” –size=4096 

part / –fstype=”ext4″ –grow –size=1 

%packages –nobase

@core

%end

   41  chmod a+r /var/ftp/pub/ks6.3.cfg  //或者#chmod 644 /var/ftp/ks6.3.cfg

   42  mkdir /var/ftp/pub/CentOS6.3_64/

   43  cd /tftpboot/

   44  ls

   45  mkdir /tftpboot/pxelinux.cfg/

   46  mkdir /tftpboot/CentOS6.3_64/

   47  cd /var/ftp/pub/CentOS6.3_64/

   48  cp isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default

   49  cd /tftpboot/pxelinux.cfg

   50  vim default 

default CentOS6.3_64 

prompt 1 

timeout 100 

label CentOS6.3_64
menu label ^Install or upgrade an existing system

  kernel CentOS6.3_64/vmlinuz 

  append ksdevice=eth0 initrd=CentOS6.3_64/initrd.img ks=ftp://192.168.100.250/ks6.3.cfg ;

label rescue

  menu label ^Rescue installed system

  kernel vmlinuz

  append initrd=initrd.img rescue

   51  service vsftpd restart

   52  service xinetd restart

   53  service dhcpd restart

 落英缤纷 20140115

Print Friendly

发表评论

电子邮件地址不会被公开。 必填项已用*标注