配置仅主机,配置172
打开终端vim /etc/sysconfig/network-scripts/ifcfg-ens33
systemctl restart network
连接虚拟机,要去本机配置
XSHELL可以连接
10.51
去server2
打开终端vim /etc/sysconfig/network-scripts/ifcfg-ens33
改为dhcp
[root@localhost ~]# systemctl restart network
去win
26.36
[root@localhost dhcp]# yum install -y tftp-server xinetd
[root@localhost dhcp]# vim /etc/xinetd.d/tftp
[root@localhost dhcp]# systemctl start tftp xinetd
[root@localhost dhcp]# systemctl enable tftp xinetd
[root@localhost dhcp]# systemctl restart dhcpd
[root@localhost dhcp]# cd /mnt
[root@localhost mnt]# ls
[root@localhost mnt]# cd images/
[root@localhost images]# ls
[root@localhost images]# cd pxeboot/
[root@localhost pxeboot]# ls
[root@localhost pxeboot]# cp vmlinuz initrd.img /var/lib/tftpboot/
[root@localhost pxeboot]# yum install -y syslinux
[root@localhost pxeboot]# cd /usr/share/syslinux/
[root@localhost syslinux]# ls
[root@localhost syslinux]# cp pxelinux.0 /var/lib/tftpboot/
[root@localhost syslinux]# yum install -y vsftpd
[root@localhost syslinux]# cd /var/ftp
[root@localhost ftp]# ls
pub
[root@localhost ftp]# mkdir centos7
[root@localhost ftp]# mount /dev/sr0 centos7/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ftp]# systemctl start vsftpd
[root@localhost ftp]# systemctl enable vsftpd
[root@localhost ftp]# cd /var/lib/tftpboot/
[root@localhost tftpboot]# ls
initrd.img pxelinux.0 vmlinuz
[root@localhost tftpboot]# mkdir pxelinux.cfg
[root@localhost tftpboot]# cd pxelinux.cfg/
[root@localhost pxelinux.cfg]# vim default
default auto
prompt 0
label auto
kernel vmlinuz
append initrd=initrd.img method=ftp://172.16.100.100/centos7
[root@localhost pxelinux.cfg]# ls
default
[root@localhost pxelinux.cfg]# cd ..
[root@localhost tftpboot]# ls
initrd.img pxelinux.0 pxelinux.cfg vmlinuz
[root@localhost tftpboot]#