pxe network installation system centos

Installation of the system a number of methods, from hard, usb, CD-ROM, network, are many ways, today is mentioned network installation, network installation a lot of ways, there are KickStart, pxe and so on, as is the use pxe install the system, from the article transfer operation and maintenance of the group Friends of the survival blog over time. Divided into the following steps, it is relatively simple, but the installation more complicated. 1. Installation Configuration dhcp 1.1 Installation dhcp
# yum install dhcp
1.2 configuration dhcp
#  vi /etc/dhcp/dhcpd.conf
# default-lease-time 600;
#  max-lease-time 7200;
ddns-update-style none;
log-facility local7;
next-server 192.168.1.1; //指定tftp服务器ip,该ip地址这里指定本机地址
filename "pxelinux.0"; //指定引导文件
subnet 192.168.1.0 netmask 255.255.255.0 {
range dynamic-bootp 192.168.1.10 192.168.1.100; //设置dhcp作用域范围
# option domain-name-servers 8.8.8.8;
# option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}
  2. Installation Configuration TFTP 2.1 Installation tfpt
# yum install tftp-server
2.2 Configuring tftp
# 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
}
 
cd /var/lib/tftp
mkdir pxelinux.cfg
System OFF to mount the disk / mnt / cdrom directory
# mount /dev/cdrom /mnt/cdrom
# cp /mnt/cdrom/images/*.img /var/lib/tftpboot
# cp /mnt/cdrom/isolinux/boot.msg /var/lib/tftpboot
# cp /mnt/cdrom/isolinux/initrd.img /var/lib/tftpboot
# cp /mnt/cdrom/isolinux/vesamenu.c32 /var/lib/tftpboot
# cp /mnt/cdrom/isolinux/vmlinuz /var/lib/tftpboot
# cp /mnt/cdrom/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
# chmod -R 755 /var/lib/tftpboot //让tftp目录下的所有文件有执行权限
#chmod 777 /var/lib/tftpboot/pxelinux.cfg/default
Pxelinux.0 get the boot file
# yum install syslinux
# rpm -qa | grep syslinux
# rpm -ql syslinux-4.02-7.el6.x86_64 | grep pxelinux.0 //查找 pxelinux.0所在位置
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
3. Configure apache in any virtual host or add the default host in a virtual directory points off the disc mount directory, or you configure nfs, ftp can be, here or use HTTP to do presentations
# vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
Alias /iso "/mnt/cdrom/"
<Directory "/mnt/cdrom">
AllowOverride None
Options Indexes FollowSymLinks
Require all granted
Order Deny,Allow
Deny From all
Allow From 192.168.1.0/24
</Directory>
  4. Start shut down service 4.1 start dhcp and tftp
# service dhcpd start
# service xinetd start
4.2 selinux closed and iptables
# set enforce0
# service iptables stop
5. Install the operating system from a network can be installed, each different server network startup mode, described here no longer Ao, fill http://192.168.1.1/iso switched in the step of selecting the installation source: http: //www.zhengdazhi .com / index.php / centos6-3-pxe% E5% AE% 89% E8% A3% 85% E7% B3% BB% E7% BB% 9F / finishing: operation and maintenance of survival time

Reproduced in: https: //my.oschina.net/766/blog/211341

Guess you like

Origin blog.csdn.net/weixin_34346099/article/details/91547979