yum install -y dhcp tftp-server xinetd syslinux httpd httpd-devel 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; option domain-name "kting.cn"; option domain-name-servers 192.168.1.99; default-lease-time 43200; max-lease-time 86400; log-facility local7; subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.150 192.168.1.200; option routers 192.168.1.99; } next-server 192.168.1.99; filename="pxelinux.0"; /etc/init.d/dhcpd conftest /etc/init.d/dhcpd configtest /etc/init.d/dhcpd restart rpm -ql tftp-server vim /etc/xinetd.d/tftp service tftp { socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot #指定tftp目录 disable = no #yes改为no per_source = 11 cps = 100 2 flags = IPv4 } /etc/init.d/xinetd restart mkdir /var/www/html/centos-6.4-x86_64 mount /dev/cdrom /var/www/html/centos-6.4-x86_64/ ll /var/www/html/centos-6.4-x86_64/ vim /var/www/html/ks.cfg #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use network installation url --url="http://192.168.1.99/centos-6.4-x86_64" # Root password rootpw www.kting.cn # 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 --append="crashkernel=auto crashkernel=auto rhgb rhgb quiet quiet" --location=mbr --driveorder="sda" # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel #part /boot --fstype=ext4 --size=200 #part pv.008002 --size=81440 #volgroup vg0 --pesize=8192 pv.008002 #logvol / --fstype=ext4 --name=root --vgname=vg0 --size=60480 #logvol swap --name=swap --vgname=vg0 --size=1024 part /boot --fstype=ext4 --size=500 part / --fstype=ext4 --grow --asprimary --size=200 part swap --size=4096 %post sed -i '1,$s@id:[0-9]:initdefault:@id:3:initdefault:@g' /etc/inittab # Set the hostname sed -i '/BOOTPROTO/ s/dhcp/static/' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i '$ a\IPADDR=223.203.194.130\nNETMASK=255.255.255.240\nGATEWAY=223.203.194.129' /etc/sysconfig/network-scripts/ifcfg-eth0 sed -i '$ a\nameserver 202.106.0.20' /etc/resolv.conf IP=`ifconfig eth0 | awk '/inet addr:/{print $2}' | awk -F. '{print $NF}'` sed -i "s@HOSTNAME=.*@HOSTNAME=web$IP.kting.cn@g" /etc/sysconfig/network %end #install package %packages @additional-devel @base @compat-libraries @console-internet @core @debugging @development @ftp-server @large-systems @legacy-unix @nfs-file-server @network-file-system-client @network-tools @performance @perl-runtime @server-platform @server-platform-devel @server-policy @system-admin-tools libXinerama-devel xorg-x11-proto-devel startup-notification-devel libgnomeui-devel libbonobo-devel libXau-devel libgcrypt-devel popt-devel libXrandr-devel libxslt-devel libglade2-devel gnutls-devel mtools pax sgpio #device-mapper-persistent-data systemtap-client jpackage-utils tcp_wrappers perl-DBD-SQLite %post #sync time echo '0 */2 * * * /usr/sbin/ntpdate 61.153.197.226 pool.ntp.org && /sbin/hwclock -w' >> /var/spool/cron/root echo '/usr/sbin/ntpdate 61.153.197.226 pool.ntp.org && /sbin/hwclock -w' >> /etc/rc.local %end /etc/init.d/httpd start cp /var/www/html/centos-6.4-x86_64/isolinux/{boot.msg,splash.jpg,vesamenu.c32} /var/lib/tftpboot/ cp /var/www/html/centos-6.4-x86_64/p_w_picpaths/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/ mkdir /var/lib/tftpboot/pxelinux.cfg/ cp /var/www/html/centos-6.4-x86_64/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default chmod +w /var/lib/tftpboot/pxelinux.cfg/default vim /var/lib/tftpboot/pxelinux.cfg/default label linux menu label ^Install an existing system menu default kernel vmlinuz append initrd=initrd.img ks=http://192.168.1.99/ks.cfg cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ chkconfig xinetd on chkconfig dhcpd on chkconfig httpd on
dhcp+tftp+kickstart自动安装linux服务器系统
原创
©著作权归作者所有:来自51CTO博客作者390892467的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:ssh实现双机互信
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
PXE+NFS+DHCP+TFTP+KICKSTART自动安装
1需要的软件tftp-server NFS DHCP 三个文件均可yum -y install xxx*安装即可
linux 系统安装 dhcp 休闲 pxe -
PXE自动化系统安装服务器(DHCP + TFTP + syslinux +vsftpd)
pxe自动化运维系统安装部署流程
linux dhcp tftp vaftpd pxe -
Kickstart+NFS+DHCP+PXE+TFTP全自动化安装linux
Kickstart+NFS+DHCP+PXE+TFTP全自动化安装linux
linux DHCP kickstart 自动化安装 -
PEX(DHCP+TFTP+NFS+kickstart)网络安装系统
PEX(DHCP+TFTP+NFS+kickstart)网络安装系统
PEX(DHCP+TFTP+NFS+ki