Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
set net0.dhcp/hostname not working as expected
2016-05-10, 10:07
Post: #2
RE: set net0.dhcp/hostname not working as expected
(2016-05-08 15:53)mysterysmith Wrote:  Perhaps my expectations are off but, if I have the following script:

iPXE> dhcp
iPXE> show net0.dhcp/hostname
iPXE> net0.dhcp/hostname:string = host-192-168-100-3
iPXE> set net0/next-server 192.168.100.39
iPXE> set net0.dhcp/hostname abc.123
iPXE> show net0.dhcp/hostname:string = abc.123
iPXE> chain tftp://192.168.100.39/pxelinux.0

This works, however my Linux kickstart installation still sees host-192-168-100-3

Any ideas on what I'm doing wrong?

You are not doing anything that will pass iPXE's concept of the hostname through to your Linux OS.

You are currently going via pxelinux, so you would need to find a way to get pxelinux to pass a hostname through to your OS. If you avoid using pxelinux and instead use iPXE to load your kernel+initrd directly, then you can pass iPXE's hostname as a kernel command-line parameter. For example:

Code:
kernel vmlinuz hostname=${hostname}
initrd initrd.img
boot

If you then examine /proc/cmdline from within the running OS, you will see "hostname=abc.123" as expected.

Unfortunately, each Linux distro handles networking command-line parameters in a different way. You will need to find out what syntax your distro requires in order to set the hostname via a kernel command-line parameter.

Michael
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: set net0.dhcp/hostname not working as expected - mcb30 - 2016-05-10 10:07



User(s) browsing this thread: 1 Guest(s)