iPXE discussion forum

Full Version: Set fixed ip address to different servers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I`m using ipxe to deploy kickstart files on my infrastructure. But, I would like to improve it.
I have dozens of servers in different datacenters, and these datacenters do not offer a dhcp service, then I need to set a fixed ip for each server. I would like to know if is possible to create only one iso image and only one menu.ipxe in this case.
Currently, I need to create various menu.ipxe for each server with a fixed address.

I feel your pain.

I use a generic menu script for the Menu UI, then I wrote a script to write an ${uuid)-network.ipxe script on the server from a MasterUUID.csv file.

The Output is something like this (this is for booting into the installer with the intention of installing in an NFS Roots environment via Serial TUI):

echo ${cls}

#GENERATED BY Build_UUID_network_iPXE.sh or Build_UUID_network_iPXE.cmd

#Filename output is ${uuid}-network.ipxe

set hostname yourserver
set nfs_nic_one 1
set nfs_nic_two 6
set nfs_nic_order 1-2
set nfs_ip
set nfs_netmask
set nfs_server
set def_gateway
set def_menu_opt 2_OpenSuSE-nfs-bond
set dist_opt "OpenSuSE"

chain ${17}/NetBoot/iPXE/ipxelinux.cfg/OEM/SuSE/OpenSuSE_menu.ipxe || echo

chain ${17}/NetBoot/iPXE/ipxelinux.cfg/default/default-efi.ipxe || echo


This could also be put into a PHP script which parses a read-only CSV file or queries a MySQL Database.

The OpenSuSE_menu.ipxe puts the variables set in the above script into parameters for booting the installer... e.g.:

echo Booting OpenSuse Installer (AutoYast,ttyS0)...

initrd ${17}/Media-Depot/linux/OpenSuSE/x86_64/loader/initrd || echo
chain ${17}/Media-Depot/linux/OpenSuSE/x86_64/loader/linux initrd=initrd splash=verbose vga=0x314 showopts  install=${17}/Media-Depot/linux/OpenSuSE/x86_64/ autoyast=${17}/NetBoot/iPXE/ipxelinux.cfg/OEM/OpenSuSE/AutoYAST/${uuid}.xml insecure=1 console=ttyS0,115200 static_ips=${nfs_ip}:${nfs_server}:${def_gateway}:${nfs_netmask}:${hostname}:${n​et{nfs_nic_one}}:none:9000 earlycon=uart8250,io,0x3f8,115200n8 || echo

Reference URL's