标签:vsftp search wro stage tftpd 博客 img mat you
PXE(Preboot Excute Environment)预启动执行环境,可以让计算机通过网络启动系统,主要用于无人值守安装系统中引导客户端主机安装Linux操作系统。
由于之前有过使用cobbler+kickstart PXE安装系统的博客,这里RHEL7下使用第二种方法。
[root@localhost ~]# yum install -y dhcp
[root@localhost ~]# vim /etc/dhcp/dhcpd.conf
allow booting; allow bootp; ddns-update-style interim; ignore client-updates; subnet 192.168.10.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option domain-name-servers 192.168.10.10; range dynamic-bootp 192.168.10.50 192.168.10.100; default-lease-time 21600; max-lease-time 43200; next-server 192.168.10.10; filename "pxelinux.0"; }
配置完成重启DHCP服务,由于DHCP服务未成功启动也不会报错,所以查看一下DHCPD服务状态
[root@localhost ~]# systemctl restart dhcpd [root@localhost ~]# systemctl status dhcpd dhcpd.service - DHCPv4 Server Daemon Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled) Active: failed (Result: exit-code) since Tue 2019-03-19 10:16:36 EDT; 6s ago Docs: man:dhcpd(8) man:dhcpd.conf(5)
果然启动失败了,配置文件一定有哪里出现错误。
我们执行journal -xe命令查看一下
[root@localhost ~]# journalctl -xe -- -- The start-up result is done. Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Internet Systems Consortium Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Copyright 2004-2013 Internet Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: All rights reserved. Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: For info, please visit https Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Not searching LDAP since lda Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Wrote 0 leases to leases fil Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Mar 19 10:16:36 localhost.lo Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: ** Ignoring requests on eno1 Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: you want, please write a sub Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: in your dhcpd.conf file for Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: to which interface eno167777 Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Mar 19 10:16:36 localhost.lo Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Mar 19 10:16:36 localhost.lo Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: on ftp.isc.org. Features ha Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: have been made to the base s Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: it work better with this dis Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: Mar 19 10:16:36 localhost.lo Mar 19 10:16:36 localhost.localdomain dhcpd[42926]: http://bugzilla.redhat.com
似乎是eno167777网卡问题,原来我们还原虚拟机后没有将IP修改为DHCP配置文件中对应的192.168.10.10。修改一下。
修改完成后,再次重启DHCPD服务
[root@localhost ~]# systemctl restart dhcpd [root@localhost ~]# systemctl status dhcpd dhcpd.service - DHCPv4 Server Daemon Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled) Active: active (running) since Tue 2019-03-19 10:23:13 EDT; 6s ago Docs: man:dhcpd(8) man:dhcpd.conf(5) Main PID: 43382 (dhcpd)
[root@localhost ~]# yum install -y tftp-server [root@localhost ~]# 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 disable = no per_source = 11 cps = 100 2 flags = IPv4 }
[root@localhost ~]# firewall-cmd --permanent --add-port=69/udp success [root@localhost ~]# firewall-cmd --reload success
[root@localhost ~]# yum install -y syslinux
[root@localhost ~]# cd /var/lib/tftpboot/ [root@localhost tftpboot]# cp /usr/share/syslinux/pxelinux.0 . [root@localhost tftpboot]# cp /mnt/images/pxeboot/{vmlinuz,initrd.img} . [root@localhost tftpboot]# cp /mnt/isolinux/{vesamenu.c32,boot.msg} .
[root@localhost tftpboot]# mkdir pxelinux.cfg [root@localhost tftpboot]# cp /mnt/isolinux/isolinux.cfg pxelinux.cfg/default
[root@localhost tftpboot]# vim !$ 1 default linux .. 64 append initrd=initrd.img inst.stage2=ftp://192.168.10.10 ks=ftp://192.168.10.10/pub/ks.cfg quiet
[root@localhost tftpboot]# yum install -y vsftpd [root@localhost tftpboot]# systemctl start vsftpd [root@localhost tftpboot]# systemctl enable vsftpd ln -s ‘/usr/lib/systemd/system/vsftpd.service‘ ‘/etc/systemd/system/multi-user.target.wants/vsftpd.service‘
[root@localhost linuxprobe]# firewall-cmd --permanent --add-service=ftp success [root@localhost linuxprobe]# firewall-cmd --reload success [root@localhost linuxprobe]# getsebool -a | grep ftpd ftpd_anon_write --> off ftpd_connect_all_unreserved --> off ftpd_connect_db --> off ftpd_full_access --> off ftpd_use_cifs --> off ftpd_use_fusefs --> off ftpd_use_nfs --> off ftpd_use_passive_mode --> off sftpd_anon_write --> off sftpd_enable_homedirs --> off sftpd_full_access --> off sftpd_write_ssh_home --> off [root@localhost linuxprobe]# setsebool -P ftpd_connect_all_unreserved=on
t@localhost ~]# cp /root/anaconda-ks.cfg /var/ftp/pub/ks.cfg [root@localhost ~]# chmod -r !$ chmod -r /var/ftp/pub/ks.cfg
#version=RHEL7 # System authorization information auth --enableshadow --passalgo=sha512 # Use CDROM installation media url --url=ftp://192.168.10.10 设置FTP安装模式 # Run the Setup Agent on first boot firstboot --enable ignoredisk --only-use=sda # Keyboard layouts keyboard --vckeymap=us --xlayouts=‘us‘ # System language lang en_US.UTF-8 # Network information network --bootproto=dhcp --device=eno16777736 --onboot=off --ipv6=auto network --hostname=localhost.localdomain # Root password rootpw --iscrypted $6$0XQWDt7L9e0SdNCH$LyxVJ8ZoncLu2tTPn/4nUjOT.DFmLgejZOWWg/U9aF7qPJGnLs6JuDZ1/RHrr17HKs1zA10ifsUk.axakInCG. # System timezone timezone Asia/Shanghai --isUtc 设置时区为上海 # X Window System configuration information xconfig --startxonboot # System bootloader configuration bootloader --location=mbr --boot-drive=sda autopart --type=lvm # Partition clearing information clearpart --all --initlabel 清空并初始化磁盘 %packages @base @core @desktop-debugging @dial-up
自动部署客户端
标签:vsftp search wro stage tftpd 博客 img mat you
原文地址:https://www.cnblogs.com/volac/p/10562245.html