CentOS 8
Sponsored Link

PXE Boot : Set static IP address2020/02/12

 
Set static IP address and System root for each client computer.
[1] First, note a MAC address of the computer you'd like to set static settings.
Next, Change DHCP settings on PXE server.
[root@dlp ~]#
vi /etc/dhcp/dhcpd.conf
.....
.....
    class "pxeclients" {
        match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
        next-server dlp.srv.world;

        if option architecture-type = 00:07 {
            filename "BOOTX64.EFI";
        }
        else {
            filename "pxelinux.0";
        }
    }
}

# add to the end
# any hostname you like
host dlp001 {
    # MAC address of client computer
    hardware ethernet 52:54:00:ec:ac:1c;
    # static IP address
    fixed-address 10.0.0.201;
    option host-name "dlp001";
    filename "pxelinux.0";
}

[root@dlp ~]#
systemctl restart dhcpd

[2] Set System root for the client set on [1].
It is [nfs:10.0.0.30:/var/lib/tftpboot/centos8/root] on this example.
# convert static IP address you set on [1] to Hexadecimal

# it's [10.0.0.201] on this example

[root@dlp ~]#
printf "%02X" 10; printf "%02X" 0; printf "%02X" 0; printf "%02X\n" 201;

0A0000C9
# set the hexadecimal value to a filename to create new setting

[root@dlp ~]#
vi /var/lib/tftpboot/pxelinux.cfg/0A0000C9
default centos8

label centos8
    kernel centos8/vmlinuz
    append initrd=centos8/initrd.img root=nfs:10.0.0.30:/var/lib/tftpboot/centos8/root rw selinux=0 
[3] That's OK.
The computer with MAC address you set starts with specific IP address and System root.
Matched Content