Essentially you follow the article "Install PXE Server And Configure PXE Client On CentOS 7" of the link about to setup a PXE network.
A few thing to note.
1.
You may see below
curl: (22) The requested URL returned error: 403 Forbidden
Warning: Download 'http://192.16.1.150/centos7_x64/LiveOS/squashfs.img' failed!
So, using this will be working
[root@pxe centos7_x64]# vi /etc/httpd/conf.d/pxeboot.conf
Alias /centos7_x64 /var/lib/tftpboot/centos7_x64/
<Directory /var/lib/tftpboot/centos7_x64>
Options Indexes FollowSymLinks
AllowOverride none
Require all granted
</Directory>
<Directory />
Options Indexes FollowSymLinks
AllowOverride none
Require all granted
</Directory>
vi /etc/sysconfig/dhcpd
# WARNING: This file is NOT used anymore.
# If you are here to restrict what interfaces should dhcpd listen on,
# be aware that dhcpd listens *only* on interfaces for which it finds subnet
# declaration in dhcpd.conf. It means that explicitly enumerating interfaces
# also on command line should not be required in most cases.
# If you still insist on adding some command line options,
# copy dhcpd.service from /lib/systemd/system to /etc/systemd/system and modify
# it there.
# https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
DHCPDARGS=enp0s8
# example:
# $ cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/
# $ vi /etc/systemd/system/dhcpd.service
# $ ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid <your_interface_name(s)>
# $ systemctl --system daemon-reload
# $ systemctl restart dhcpd.service
3. When setting the dchp server, you may not be able to restarat the dhcpd service.
You need to add a subnet section accoridng to http://linux.vbird.org/linux_server/0340dhcp.php#theory
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.101 192.168.100.200; <==分配的 IP 範圍
# 3. 關於固定的 IP 啊!
host win7 {
hardware ethernet 08:00:27:11:EB:C2; <==用戶端網卡 MAC
fixed-address 192.168.100.30; <==給予固定的 IP
}
}
沒有留言:
張貼留言