快捷搜索: 王者荣耀 脱发

网络安装-PXE无人值守

PXE无人值守安装**

实验一:网络安装pxe

一.安装httpd、tftp、dhcp、syslinux

1.挂载光盘

2.搭建仓库 3.修改http服务的主配置文件 4.重启http服务 [root@xss yum.repos.d]# service httpd restart

5.清空&更新yum缓存 [root@xss yum.repos.d]# yum clean all //清空原有的yum缓存 [root@xss yum.repos.d]# yum makecache //更新yum缓存

6.安装tftp、dhcp、syslinux服务 [root@xss yum.repos.d]# yum -y install tftp-server dhcp syslinux

二.启用tftp服务,提供内核,初始化镜像文件,引导程序 内核 vmlinuz,初始化镜像initrd.img,引导程序文件pxelinux.0

1.修改tftp默认配置文件 2.启动xinetd服务 [root@xss Packages]# service xinetd start

3.准备初始化镜像文件和内核

访问/cdrom/images/pxeboot/文件夹,并将用来安装系统的镜像中的内核文件、初始化镜像拷贝到tftp服务器的共享目录/var/lib/tftpboot/下 [root@xss pxeboot]# cp vmlinuz initrd.img /var/lib/tftpboot/ 4.准备引导程序文件 [root@xss syslinux]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ 三.配置dhcp,并指出引导程序位置

1.修改dhcp配置文件

subnet 192.168.43.0 netmask 255.255.255.0 { range 192.168.43.10 192.168.43.200; option subnet-mask 255.255.255.0; ddns-update-style none; default-lease-time 259200; max-lease-time 518400; option routers 192.168.43.1; option broadcast-address 192.168.43.255; option domain-name-servers 114.114.114.114; next-server 192.168.43.227; filename “pxelinux.0”; }

Next-server用来指定TFTP服务器的IP,即本机IP filename指出TFTP共享目录(/var/lib/tftpboot)中的引导程序文件(pxelinux.0)

2.检查dhcp配置文件是否正确并启动dhcp服务 [root@xss tftpboot]# service dhcpd configtest [root@xss tftpboot]# service dhcpd start 四.创建启动菜单文件并配置启动菜单

1.创建启动菜单文件 2.配置启动菜单 [root@xss pxelinux.cfg]# vim /var/lib/tftpboot/pxelinux.cfg/default default auto prompt 1 label auto kernel vmlinuz append initrd=initrd.img devfs=nomount ramdisk_size=8192 label linux text kernel vmlinuz append text initrd=initrd.img devfs=nomount ramdisk_size=8192 label linux rescue kernel vmlinuz append rescue initrd=initrd.img devfs=nomount ramdisk_size=8192 五.重启各种服务

[root@xss html]# service httpd restart [root@xss html]# service xinetd restart [root@xss html]# service dhcpd restart

六.新建一台虚拟机测试

注意:新建的虚拟机网络连接模式必须和服务器保持一致

经验分享 程序员 微信小程序 职场和发展