Per client boot config

Post Reply
commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Per client boot config

Post by commguy » 17 Jun 2015, 09:25

Hey guys, I'm sure I'm missing something incredibly simple but I haven't been able to figure this out. I am running an ERPXE server on Ubuntu and I have a few clients on my network I would like to make diskless. On my thin client server (no longer in use) I was able to tell the PXE server to boot a specific client with an image I chose with no other interaction. I tried to set something like that up with ERPXE but it either gets ignored or breaks the server.

Any tips?

RaveMaker
Posts: 204
Joined: 21 Mar 2013, 20:11

Re: Per client boot config

Post by RaveMaker » 17 Jun 2015, 16:12

You can create a unique coot menu per client, all you need is to calculate the IP Address of the client in hex format and create a separate boot file.
this script will help you calculate the necessary file name, for example:

Code: Select all

echo "Please input SUBNET or IP, for example 10.0.0"
read IP_ADDR

# Convert values to Hex
filename=$(printf '%02X' ${IP_ADDR//./ })
echo $filename
10.0.0.34 = 0A000022

now you need to create a new menu named:

Code: Select all

tftpboot/pxelinux.cfg/0A000022
This file will be the default boot file for client with IP address 10.0.0.34.

RaveMaker
Posts: 204
Joined: 21 Mar 2013, 20:11

Re: Per client boot config

Post by RaveMaker » 17 Jun 2015, 16:30

You can also use mac address as file name, for example:

Code: Select all

tftpboot/pxelinux.cfg/01-a1-b2-c3-d4-e5-f6
you can always verify using:

Code: Select all

cat /var/log/messages | grep -i a1-b2-c3-d4-e5-f6
Output:

Code: Select all

erpxe in.tftpd[10381]: RRQ from 10.0.0.34 filename pxelinux.cfg/01-a1-b2-c3-d4-e5-f6
for more info visit:
http://www.syslinux.org/wiki/index.php/ ... n_filename

commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Per client boot config

Post by commguy » 18 Jun 2015, 02:00

Spambots are very anoying. I put recaptcha on my site from google and that pretty much solved the problem for me. Not sure what your backend is but it might work for you guys too.

Thank you so much, that was the piece I was missing. Now I should be able to put my boot file info into this and have my client boot the image I want directly.

commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Per client boot config

Post by commguy » 18 Jun 2015, 03:07

ok, that didn't take long.

How do I direct boot the image for the client without having to wait for the time out.

It's set to 1 so it's really not that big of a deal, more of an anal retentive thing.

RaveMaker
Posts: 204
Joined: 21 Mar 2013, 20:11

Re: Per client boot config

Post by RaveMaker » 18 Jun 2015, 11:26

The first file requested is the UUID of the client,
to speed things up you can use it instead of mac address and you wont have to wait for the first timeout.

Code: Select all

mybootdir/pxelinux.cfg/b8945908-d6a6-41a9-611d-74a6ab80b83d
mybootdir/pxelinux.cfg/01-88-99-aa-bb-cc-dd
mybootdir/pxelinux.cfg/C0A8025B
mybootdir/pxelinux.cfg/C0A8025
mybootdir/pxelinux.cfg/C0A802
mybootdir/pxelinux.cfg/C0A80
mybootdir/pxelinux.cfg/C0A8
mybootdir/pxelinux.cfg/C0A
mybootdir/pxelinux.cfg/C0
mybootdir/pxelinux.cfg/C
mybootdir/pxelinux.cfg/default

commguy
Posts: 57
Joined: 20 Aug 2013, 06:38
Contact:

Re: Per client boot config

Post by commguy » 21 Jun 2015, 22:14

I got that, since I set static IP's it's not much of an issue in my case but good to know. It looks like I need to use syslinux syntax, which I'm not terribly good at, and set it in a menu. I can set a timeout so I don't have to have a keyboard connected but I'd like to customize this one a little for a specific set of clients. I'm just going to have to play with it for a bit.

I think I'm on the right track now. Just didn't expect the behavior I got because of a lack of understanding of the underlying mechenisms. Now that I have a better grasp (thanks to you guys) I should be able to get where I want to be.

Post Reply