首页 > 系统相关 >在centos7实现PXE安装centos6,7

在centos7实现PXE安装centos6,7

时间:2023-07-14 19:36:18浏览次数:43  
标签:www lib cfg centos7 centos6 tftpboot html var PXE


0 selinux ,firewall 关闭
1 安装包
yum install dhcp tftp-server httpd syslinux
systemctl enable dhcpd httpd tftp.socket
systemctl start httpd

2 准备YUM源

mkdir /var/www/html/centos/{6,7}/ -pv

vim /etc/fstab 加下面行
/dev/sr0 /var/www/html/centos/7 iso9660 defaults 0 0
/dev/sr1 /var/www/html/centos/6 iso9660 defaults 0 0
mount -a
df

3 准备ks文件
mkdir /var/www/html/ksdir/{6,7} -pv
cp /root/anaconda-ks.cfg /var/www/html/ksdir/7/ks7_desktop.cfg
chmod +r /var/www/html/ksdir/7/ks7_desktop.cfg

[root@centos7 tftpboot]#tree /var/www/html/ksdir/
/var/www/html/ksdir/
├── ks6_mini.cfg
└── ks7_desktop.cfg


4 配置dhcp服务
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf
[root@centos7 tftpboot]#cat /etc/dhcp/dhcpd.conf
option domain-name "magedu.org";
option domain-name-servers 114.114.114.114,1.1.1.1;
option routers 192.168.30.200;
default-lease-time 86400;
max-lease-time 100000;
subnet 192.168.30.0 netmask 255.255.255.0 {
range 192.168.30.10 192.168.30.100;
option routers 192.168.30.254;
option domain-name-servers 8.8.8.8;
next-server 192.168.30.17;
filename "pxelinux.0";
}
systemctl start dhcpd

5 准备PXE相关文件
rpm -ql syslinux
mkdir /var/lib/tftpboot/pxelinux.cfg/
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
mkdir /var/lib/tftpboot/centos{6,7}

cp /var/www/html/centos/7/isolinux/{vmlinuz,initrd.img} /var/lib/tftpboot/centos7/
cp /var/www/html/centos/6/isolinux/{vmlinuz,initrd.img} /var/lib/tftpboot/centos6/


cp /var/www/html/centos/7/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
vim /var/lib/tftpboot/pxelinux.cfg/default

cat /var/lib/tftpboot/pxelinux.cfg/default

cat /var/lib/tftpboot/pxelinux.cfg/default
default menu.c32
timeout 600

menu title www.magedu.com

label centos7
menu label ^Install Desktop CentOS 7
kernel centos7/vmlinuz
append initrd=centos7/initrd.img ks=http://192.168.30.17/ksdir/ks7_desktop.cfg

label centos6
menu label install ^Mini CentOS 6
menu default
kernel centos6/vmlinuz
append initrd=centos6/initrd.img ks=http://192.168.30.17/ksdir/ks6_mini.cfg
label local
menu label Boot from ^local drive
localboot 0xffff
menu end

tree /var/lib/tftpboot/
/var/lib/tftpboot/
├── centos6
│?? ├── initrd.img
│?? └── vmlinuz
├── centos7
│?? ├── initrd.img
│?? └── vmlinuz
├── menu.c32
├── pxelinux.0
└── pxelinux.cfg
└── default

3 directories, 7 files

6 客户端测试安装

标签:www,lib,cfg,centos7,centos6,tftpboot,html,var,PXE
From: https://www.cnblogs.com/xuxuxu-2022/p/17554802.html

相关文章

  • centos7.4二进制安装mariadb-10.2.15-linux-x86_64.tar.gz
    1检查环境iptablesselinuxmariadb-server2下载二进制包3useradd-r-d/data/mysqldb-s/sbin/nologinmysql4tarxvfmariadb-10.2.15-linux-x86_64.tar.gz-C/usr/local/cd/usr/localln-smariadb-10.2.15-linux-x86_64/mysqlchown-Rroot:rootmysql/5e......
  • centos7.4 yum 安装包的实现多实例
    1yuminstallmariadb-server2mkdir/mysqldb/{3306,3307,3308}/{etc,socket,pid,log,data}-pvchown-Rmysql.mysql/mysqldb/3mysql_install_db--datadir=/mysqldb/3306/data--user=mysqlmysql_install_db--datadir=/mysqldb/3307/data--user=mysqlmysql_inst......
  • 实现CENTOS7 PXE安装
    0selinux,firewall关闭1安装包yuminstalldhcptftp-serverhttpdsyslinuxsystemctlenabledhcpdhttpdtftp.socketsystemctlstarthttpd2准备YUM源mkdir/var/www/html/centos/{6,7}/-pvvim/etc/fstab加下面行/dev/sr0/var/www/html/centos/7iso96......
  • CentOS7安装Puppet
    环境说明:192.168.154.137master.localdomain#PuppetServer192.168.154.138agent1.localdomain#PuppetAgent这里的机器名称不要有下划线等特殊符合,否则后面会报“theschemepuppetdoesnotacceptregistrypart”这样的错误信息。centos的官方软件库里面不包含puppet......
  • QEMIU-基于CentOS7系统编译安装部署qemu 2.7.0 版本的环境
    【原文链接】QEMIU-基于CentOS系统编译安装部署QEMU环境备份原有的yum源配置cp/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.bak设置阿里云的yum源wget-O/etc/yum.repos.d/CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo......
  • centos7.8安装Python-3.10
    centos7.8安装Python-3.10一.安装opensslpython3.10需要openssl至少1.1.1,而centos7.8默认版本为1.0.2*参考:https://www.cnblogs.com/linagcheng/p/15870060.html 二.安装依赖yuminstall-ybzip2-devellibffi-develzlibzlib-devel 三.安装Python-3.10tar-zx......
  • graylog5.1安装(Centos7)
    官网安装地址:https://go2docs.graylog.org/5-1/downloading_and_installing_graylog/red_hat_installation.htm?tocpath=Downloading%20and%20Installing%20Graylog%7CInstalling%20Graylog%7C_____6一、需要安装的组件OpenJDK17(5.0以上版本的graylog已内置,无需安装)OpenSe......
  • centos7部署Vsftpd服务
    安装并开启自启yuminstall-yvsftpdsystemctlenablevsftpd修改配置文件配置文件位置:/etc/vsftpd/vsftpd.conf常用的需要修改以下////默认是允许匿名,需要关闭anonymous_enable=No//启用本地用户,默认是开启,这里不需要修改local_enable=YES//设置本地用户登陆......
  • CentOS7修改网卡名
    CentOS7,或RHEL7[1]https://www.redhat.com/sysadmin/network-interfaces-linux,Thenamegame:NamingnetworkinterfacesinLinux可以使用nameif,ifrename,ip;centos7上没找到ifrename;nameif根据mac命令;试过ip,提示ResourceBusy.[2]http://www.mit.edu/afs.n......
  • 记一次CentOS7.7文件系统只读Read-only file system 并且/dev/只有一个设备文件 null
    环境VMwareWorkstationPro15.5操作系统CentOS7.7现象:处理方法1.单用户修复文件系统失败2.救援模式备份数据失败3.把不能正常启动的磁盘,挂载到正常启动虚拟机,扫描逻辑卷,激活,挂载(1)把有问题的磁盘挂载到正常启动的机器上选择需要修复的盘......