[root@localhost ~]# mkdir /mnt/
[root@localhost ~]# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# vi /etc/yum.repos.d/server.repo
[base]
Name=base
Baseurl=file:///mnt/ #(部分系统可能需要使用file:///mnt/server 的路径)
Enabled=1
Gpgcheck=0
[root@localhost ~]# mkdir /home/repo_backup
[root@localhost yum.repos.d]# cp CentOS-* /home/repo_backup //备份并且复制
[root@localhost yum.repos.d]# rm -rf CentOS-*
[root@localhost yum.repos.d]# yum install -y vsftpd
[root@localhost yum.repos.d]# service vsftpd start
[root@localhost yum.repos.d]# chkconfig vsftpd on
[root@localhost yum.repos.d]# yum install tftp -y
[root@localhost yum.repos.d]# yum install tftp-server -y
[root@localhost yum.repos.d]# vim /etc/xinetd.d/tftp
[root@localhost yum.repos.d]# service xinetd restart
[root@localhost yum.repos.d]# yum install dhcp -y
ddns-update-style interim;
ignore client-updates;
# 注意网段需要相同。否则无法使用
subnet 192.168.153.0 netmask 255.255.255.0 {
# 与服务器IP地址相同
option routers 192.168.153.111;
# IP默认租约时间
default-lease-time 21600;
#IP最大租约时间
max-lease-time 43200;
#IP租约地址池,这里要注意网段一定相同,否则起不来DHCP服务
range 192.168.153.3 192.168.153.120;
option subnet-mask 255.255.255.0;
#与服务器IP地址相同
next-server 192.168.153.111;
filename "pxelinux.0";
}
[root@localhost yum.repos.d]# service dhcpd start
[root@localhost yum.repos.d]# chkconfig dhcpd on
[root@localhost yum.repos.d]# yum install system-config-kickstart.noarch -y
[root@localhost yum.repos.d]# mkdir /tftpboot
[root@localhost yum.repos.d]# mkdir /tftpboot/pxelinux.cfg
[root@localhost yum.repos.d]# cp /usr/share/syslinux/pxelinux.0 /tftpboot/
[root@localhost yum.repos.d]# cp /mnt/isolinux/isolinux.cfg /tftpboot/pxelinux.cfg/default
[root@localhost yum.repos.d]# cp /mnt/images/pxeboot/initrd.img /tftpboot/
[root@localhost yum.repos.d]# cp /mnt/images/pxeboot/vmlinuz /tftpboot/
[root@localhost yum.repos.d]# chmod 644 /tftpboot/pxelinux.cfg/default
分区名称 | 文件系统类型 | 硬盘空间大小 |
---|---|---|
/boot | ext4 | 200MB |
/swap | 2048MB | |
/ 根分区 | ext4 | 剩下所有硬盘空间 |
[root@localhost yum.repos.d]# cp /root/ks.cfg /var/ftp/
[root@localhost yum.repos.d]# umount /mnt/
[root@localhost yum.repos.d]# mount /dev/cdrom /var/ftp/pub/
[root@localhost yum.repos.d]# chkconfig iptables off
[root@localhost yum.repos.d]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]