DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd October 2014
denriktiga denriktiga is offline
New User
 
Join Date: Oct 2014
Posts: 4
Thanked 0 Times in 0 Posts
Exclamation Trouble pxe booting a .php file with dhcpd

Hi there! I just started migrating from ubuntu 14.04 to OBSD5.5 and I ran into a problem.

On ubuntu I use isc-dhcp-server to assign ip's and allow clients to pxe boot a .php file. And I want to do the same thing on OBSD.

On ubuntu 14.04 I use this config :

/etc/dhcp/dhcpd.conf

Code:
allow booting;
allow bootp;
ddns-update-style none;
log-facility local7;
default-lease-time -1;
max-lease-time 7200;
authoritative;
option space gpxe;
option gpxe-encap-opts code 175 = encapsulate gpxe;
option gpxe.bus-id code 177 = string;


subnet 192.168.1.0 netmask 255.255.255.0 {
  use-host-decl-names on;
  range 192.168.1.3 192.168.1.254;
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  option root-path "192.168.1.2:/tftp";
  next-server 192.168.1.2;
  option domain-name-servers 192.168.1.1;
  option domain-name "lab.local";

if not exists gpxe.bus-id {
      filename "undionly.kpxe";
} else {
      filename "http://192.168.1.2/boot.php";
#      filename "gpxe/menu.gpxe";
#      filename "gpxe/pxelinux.0";

}
  server-name "klonstation";
    server-identifier 192.168.1.2;
}
The clients boot to the .php file without any trouble.

On OpenBSD 5.5 I use this config:

/etc/dhcpd.conf

Code:
allow booting;
allow bootp;
#ddns-update-style none;
#log-facility local7;
default-lease-time -1;
max-lease-time 7200;
authoritative;
#option space gpxe;
#option gpxe-encap-opts code 175 = encapsulate gpxe;
#option gpxe.bus-id code 177 = string;


subnet 192.168.1.0 netmask 255.255.255.0 {
  use-host-decl-names on;
  range 192.168.1.3 192.168.1.254;
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  option root-path "192.168.1.2:/tftp";
  next-server 192.168.1.2;
  option domain-name-servers 83.223.5.2;
  option domain-name "lab.local";



  filename "http://192.168.1.2/boot.php";
# filename "menu.gpxe";
# filename "pxelinux.0"; #THIS WORKS!

  server-name "fw";
  server-identifier 192.168.1.1;
}
When a client pxe-boots to the OBSD server, TFTP generates this error:

Code:
Oct  1 22:30:51 ubuntu tftpd[2659]: tftpd: trying to get file: http://192.168.1.2/boot.php
Oct  1 22:30:51 ubuntu tftpd[2659]: tftpd: serving file from /tftp
Oct  1 22:30:51 ubuntu tftpd[2661]: tftpd: trying to get file: http://192.168.1.2/boot.php
Oct  1 22:30:51 ubuntu tftpd[2661]: tftpd: serving file from /tftp
I really have no idea how to fix this, but I depend on booting to a .php file.
Thanks!
Reply With Quote
  #2   (View Single Post)  
Old 2nd October 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,894
Thanked 214 Times in 189 Posts
Default

Hello and welcome!

The built-in dhcpd(8) was a 2004 fork of the ISC daemon.

As noted in dhcpd.conf(5), you may use the next-server parameter to define the address of a TFTP server to obtain the filename, but it is limited to an IP address or domain name.

Your require a URL, and a non-TFTP protocol.

I have never used them, but there are 3rd party packages that do DHCP, and you may find the isc-dhcp package helpful. This is the ISC DHCP reference set.
Reply With Quote
  #3   (View Single Post)  
Old 6th October 2014
denriktiga denriktiga is offline
New User
 
Join Date: Oct 2014
Posts: 4
Thanked 0 Times in 0 Posts
Smile

I finally made it work! The case was I needed to boot the undionly.kpxe FIRST to be able to boot from http.

Code:
allow booting;
allow bootp;
#ddns-update-style none;
#log-facility local7;
default-lease-time -1;
max-lease-time 7200;
authoritative;
#option space gpxe;
#option gpxe-encap-opts code 175 = encapsulate gpxe;
#option gpxe.bus-id code 177 = string;


subnet 192.168.1.0 netmask 255.255.255.0 {
  use-host-decl-names on;
  range 192.168.1.3 192.168.1.254;
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  option root-path "192.168.1.2:/tftp";
  next-server 192.168.1.2;
  option domain-name-servers 192.168.1.1;
  option domain-name "lab.local";

  option bootfile-name "undionly.kpxe"; #This line made it work
  #filename "undionly.kpxe";
  filename "http://192.168.1.2/boot.php";
  #filename "pxelinux.0";


  server-name "klonstation";
  server-identifier 192.168.1.1;
}
Reply With Quote
  #4   (View Single Post)  
Old 6th October 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,894
Thanked 214 Times in 189 Posts
Default

I'm glad you got it figured out. I've never used bootfile-name, my PXE clients have all been successful using filename.

From dhcp-options(5):
Code:
option bootfile-name string;
     This option is used to identify a bootstrap file. If supported by the client, it
     should have the same effect as the filename declaration. BOOTP clients are 
     unlikely to support this option. Some DHCP clients will support it, and others 
     actually require it.
Reply With Quote
Reply

Tags
pxe dhcpd boot

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCPd questions mikesg OpenBSD General 2 11th October 2013 12:34 PM
dhcpd, vista and wlan hamba FreeBSD Ports and Packages 5 8th September 2009 04:34 PM
dhcpd and dns sputnik OpenBSD General 8 8th May 2009 02:50 PM
dhcpd within ezjail? zelut FreeBSD General 7 10th February 2009 10:31 PM
Trouble booting if USB drive attached map7 FreeBSD General 1 22nd December 2008 04:51 PM


All times are GMT. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick