CentOS Stream 8
Sponsored Link

PXE Boot : Set static IP address2021/06/24

 
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 00:0c:29:3f:ae:61;
    # 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/centos-st8/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 centos-st8

label centos-st8
    kernel centos-st8/vmlinuz
    append initrd=centos-st8/initrd.img root=nfs:10.0.0.30:/var/lib/tftpboot/centos-st8/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