Skip to content

Instantly share code, notes, and snippets.

@AJNOURI
Created December 2, 2016 16:47
Show Gist options
  • Save AJNOURI/f678917b53e556380c6981bfeb22f997 to your computer and use it in GitHub Desktop.
Save AJNOURI/f678917b53e556380c6981bfeb22f997 to your computer and use it in GitHub Desktop.
ipxe script to request dhcp otherwise static config (https://www.youtube.com/watch?v=RYbv8ZYAIl4)
#!ipxe
prompt --key 0x02 --timeout 10000 Press Ctrl-8 for iPXE command line... && shell || dhcp && goto netboot ||
ifclose
echo -n Choose net0 or net1 or ...: ${} && read nic
set ${nic}/dns 8.8.8.8
set ${nic}/netmask 255.255.255.0
config ${nic}
ifopen ${nic}
goto netboot
:netboot
chain http://my.com/boot/main.ipxe || echo Error in iPXE chaining, try again 1
chain http://my.com/boot/main.ipxe || echo Error in iPXE chaining, giving up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment