Jump to content











Photo
* * * * * 2 votes

Tiny PXE Server

ipxe gpxe dhcp proxydhcp pxe boot sanboot http

  • This topic is locked This topic is locked
162 replies to this topic

#101 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 04:47 PM

proxydhcp=1 will indeed enable the feature by default.

 

The dhcp daemon (udp port 67) will always be on as I still need to catch the initial DHCP_DISCOVER(1) broadcasted (to udp port 67) by client.

Thanks to that I will then send a "null ip" DHCP_OFFER(2) indicating to the client that he now needs to send DHCP_REQUEST(3) to me (as proxydhcp) on port udp 4011.

The last DHCP_ACK (4) will be sent from udp port 4011

 

the following config file seems ok for me (currently testing further thus) :

(note that with proxydhcp enabled, DHCP_REQUEST is discarded on port 67 and only accepted on port 4011).

 

root=C:\pxe_root
filename=ipxe-undionly.kpxe
altfilename=menu.ipxe
optextra=175.6.1.1.1.8.1.1
httpd=1
proxydhcp=1
binl=0
start=1
 
Booting a computer on my LAN with the above config file result in the following log
 
18:49:54 root path=C:\pxeroot
18:49:54 tftpd started...
18:49:54 dhcpd:4011 started...
18:49:54 dhcpd:67 started...
18:49:54 httpd started...
18:50:14 DHCPd:incoming packet from : 00-1C-25-70-13-F5
18:50:14 DHCPd:DHCP_DISCOVER received, xid:F5137026
18:50:14 DHCPd:DHCP_OFFER sent, IP:192.168.1.101, xid:F5137026
18:50:16 DHCPd:incoming packet from : 00-1C-25-70-13-F5
18:50:16 DHCPd:DHCP_REQUEST discarded, xid:F5137026
18:50:16 DHCPd4011:incoming packet from : 00-1C-25-70-13-F5, 192.168.1.133
18:50:16 DHCPd4011:DHCP_REQUEST received, xid:F5137026
18:50:16 DHCPd4011:DHCP_ACK sent, IP:192.168.1.133, xid:F5137026
18:50:16 TFTPd:DoReadFile:ipxe-undionly.kpxe B:0 T:66711
18:50:16 TFTPd:DoReadFile:ipxe-undionly.kpxe B:1456 T:0
18:50:24 DHCPd:incoming packet from : 00-1C-25-70-13-F5
18:50:24 DHCPd:DHCP_DISCOVER received, xid:16E3E493
18:50:25 DHCPd:iPXE user-class detected
18:50:25 DHCPd:DHCP_OFFER sent, IP:192.168.1.101, xid:16E3E493
18:50:25 DHCPd:incoming packet from : 00-1C-25-70-13-F5
18:50:25 DHCPd:DHCP_REQUEST discarded, xid:16E3E493
18:50:25 TFTPd:DoReadFile:menu.ipxe B:1432 T:7348


#102 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 01 September 2013 - 05:18 PM

My config states

 

filename=undionly.0
optextra=175.6.1.1.1.8.1.1
;start HTTPd
httpd=0
binl=0
proxydhcp=1
start=1
 

 

and the option filename= does NOT stick in a started Tiny GUI

 

On booting client I get error:

 

Bad file descriptor

 

If I then select undionly.0 in GUI Boot File filename then same client boots fine

 

So something is not correct

 

sebus



#103 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 05:30 PM

1/

Is your root set correctly? i.e pointing to the folder containing the filename undionly.0 ?

The only reason why the file would not be set in the GUI is a wrong path/filename.

Is this an issue introduced with version 1.0.0.14?

 

Edit : root is a mandatory field if you decide to use the filename field.

 

2/

When your launch TinyPXE Server with start=1, do you actually read this in the log windows :

...
19:27:21 dhcpd:67 started...
19:27:21 dhcpd:4011 started...
...
 
Edit : and to avoid confusion, do not tick/enable BINL.
 
3/
And is the proxydhcp checkbox ticked?
 
Regards,
Erwan


#104 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 01 September 2013 - 05:37 PM

Correct, the root was undefined!

 

It works OK now, but on GUI startup gives error

 

Could not bind to socket. Address and port already in use

 

They are not!



#105 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 05:40 PM

Ok so at least we take away the issue with the filename not being kept in the GUI :)

 

About the "could not bind socket", computer does not lie :)

Either you have a program/service using these ports, or you already have an instance of TinyPXE Server.

 

Check a netstat -ab from the command line to see who does what.

 

/Erwan



#106 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 01 September 2013 - 06:13 PM

I keep forgetting that Tiny is also integrated TFTP server (without option to turn it off)

I use anothet TFTP boot (hence I do not care about path) and that what generates the error.

 

Could you "divorce" TFTP as well?

 

Making the whole solution modular? Just a suggestion. Otherwise brilliant!

 

Thanks

 

sebus



#107 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15104 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 September 2013 - 06:17 PM

 

About the "could not bind socket", computer does not lie :)

 

Computers don't, but a MS OS may well do that ;).

 

OT, and JFYI, we just found out that if you try to run a smaller than 252 bytes file on Windows 7 it won't and the error message is 

"Program too big to fit in memory"

 

http://reboot.pro/to...lenge/?p=176423

 

:lol:

 

:cheers:

Wonko



#108 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 06:23 PM

Hi Wonko !

 

MS OS may lie indeed and I even dare to say that actually softwares do lie sometimes on purpose :)

 

I work for a company where the production software will systematically pop up a "network failure. contact your admins" for any error.

Being the admin guy for that company I can tell you that this upsets me a lot  :chair:

I even contacted the dev guys and their response was "oh well... this is more convenient like that"  :hammer:

 

At least, that gives us stories to tell !

 

/Erwan



#109 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 06:25 PM

I keep forgetting that Tiny is also integrated TFTP server (without option to turn it off)

I use anothet TFTP boot (hence I do not care about path) and that what generates the error.

 

Could you "divorce" TFTP as well?

 

Making the whole solution modular? Just a suggestion. Otherwise brilliant!

 

Thanks

 

sebus

 

Hi Sebus,

 

Good point : next version (should be quick), will offer to enable/disable TFTP.

 

Only issue : I have no more room left on my windows form !

 

Apart from that, does the proxydhcp new option work out for you?

 

Regards,

Erwan



#110 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 01 September 2013 - 06:31 PM

Yes, perfectly. In fact I did disable other TFTP & use Tiny for it as well.

 

You could always make config.ini only option to disable TFTP (honestly how many people would be bothered by it? - just a git like me)

 

sebus



#111 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 01 September 2013 - 06:53 PM

Yes, perfectly. In fact I did disable other TFTP & use Tiny for it as well.

 

You could always make config.ini only option to disable TFTP (honestly how many people would be bothered by it? - just a git like me)

 

sebus

 

Done.

 

TFTPD is enabled by default unless you put tftpd=0 in the config file.

Note that all other daemons (httpd, dnsd, binld, proxydhcpd) are disabled by default.

 

Download again (I did not bother to increase the version).


  • sebus and Jeff18MS like this

#112 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 01 September 2013 - 07:07 PM

WOW, what a service! Thanks

 

The ONLY FREE Windows based proxyDHCP implementation!


  • Jeff18MS and avindra like this

#113 Jeff18MS

Jeff18MS

    Newbie

  • Members
  • 11 posts
  •  
    Philippines

Posted 02 September 2013 - 03:39 AM

Hi Erwan,

 

Thank you so much for fixing our problem, however I still encounter DHCP request time out on the machines that encounter this before.

can you check my settings and logs?

 

log - http://www.mediafire...41164q6/log.txt

 

settings - http://www.mediafire...1k03afq68b2facp

 

config.ini :

[dhcp]
 
root=C:\pxesrv\files
filename=undionly.kpxe
altfilename=menu.ipxe
optextra=175.6.1.1.1.8.1.1
httpd=0
proxydhcp=1
start=1
binl=0
;poolstart=142.176.120.100
;poolsize=30
[frmDHCPServer]
top=135
left=1095
 
Thank you so much!


#114 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 02 September 2013 - 08:34 AM

 

Hi Erwan,

 

Thank you so much for fixing our problem, however I still encounter DHCP request time out on the machines that encounter this before.

can you check my settings and logs?

 

log - http://www.mediafire...41164q6/log.txt

 

settings - http://www.mediafire...1k03afq68b2facp

 

config.ini :

[dhcp]
 
root=C:\pxesrv\files
filename=undionly.kpxe
altfilename=menu.ipxe
optextra=175.6.1.1.1.8.1.1
httpd=0
proxydhcp=1
start=1
binl=0
;poolstart=142.176.120.100
;poolsize=30
[frmDHCPServer]
top=135
left=1095
 
Thank you so much!

 

 

Hi Jeff,

 

Config is ok.

 

Can you tell me which device (mac address) is giving you trouble?

 

Here below a successful pxe boot which happened at first attempt within 40 secs (i filtered out the log).

Mac address 00-21-9B-6D-5B-38 and transation ID 1CF210A0 : pxe -> ipxe -> menu.ipxe.

 

I see other successful pxe boot from other devices so it looks good at first sight.

 

However, I see lots of DHCPINFORM / DHCPDECLINE requests which TinyPXE Server does not handle (not sure it should).

Do you know where these requests come from? Do you have a standlone dhcp server on your LAN?

9:53:06 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:06 AM DHCPd:DHCP_DISCOVER received, xid:385B6DA0
9:53:07 AM DHCPd:DHCP_OFFER sent, IP:142.176.120.103, xid:385B6DA0
9:53:08 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:08 AM DHCPd:DHCP_REQUEST discarded, xid:385B6DA0
9:53:08 AM DHCPd4011:incoming packet from : 00-21-9B-6D-5B-38, 142.176.120.221
9:53:08 AM DHCPd4011:DHCP_REQUEST received, xid:385B6DA0
9:53:09 AM DHCPd4011:DHCP_ACK sent, IP:142.176.120.221, xid:385B6DA0
9:53:09 AM TFTPd:DoReadFile:undionly.kpxe B:0 T:66848
9:53:09 AM TFTPd:DoReadFile:undionly.kpxe B:1456 T:0
9:53:43 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:43 AM DHCPd:DHCP_DISCOVER received, xid:1CF210A0
9:53:43 AM DHCPd:iPXE user-class detected
9:53:43 AM DHCPd:DHCP_OFFER sent, IP:142.176.120.103, xid:1CF210A0
9:53:43 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:43 AM DHCPd:DHCP_REQUEST discarded, xid:1CF210A0
9:53:43 AM TFTPd:DoReadFile:menu.ipxe B:1432 T:9127

Regards,

Erwan



#115 Jeff18MS

Jeff18MS

    Newbie

  • Members
  • 11 posts
  •  
    Philippines

Posted 02 September 2013 - 11:12 AM

Hi Jeff,

 

Config is ok.

 

Can you tell me which device (mac address) is giving you trouble?

 

Here below a successful pxe boot which happened at first attempt within 40 secs (i filtered out the log).

Mac address 00-21-9B-6D-5B-38 and transation ID 1CF210A0 : pxe -> ipxe -> menu.ipxe.

 

I see other successful pxe boot from other devices so it looks good at first sight.

 

However, I see lots of DHCPINFORM / DHCPDECLINE requests which TinyPXE Server does not handle (not sure it should).

Do you know where these requests come from? Do you have a standlone dhcp server on your LAN?

9:53:06 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:06 AM DHCPd:DHCP_DISCOVER received, xid:385B6DA0
9:53:07 AM DHCPd:DHCP_OFFER sent, IP:142.176.120.103, xid:385B6DA0
9:53:08 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:08 AM DHCPd:DHCP_REQUEST discarded, xid:385B6DA0
9:53:08 AM DHCPd4011:incoming packet from : 00-21-9B-6D-5B-38, 142.176.120.221
9:53:08 AM DHCPd4011:DHCP_REQUEST received, xid:385B6DA0
9:53:09 AM DHCPd4011:DHCP_ACK sent, IP:142.176.120.221, xid:385B6DA0
9:53:09 AM TFTPd:DoReadFile:undionly.kpxe B:0 T:66848
9:53:09 AM TFTPd:DoReadFile:undionly.kpxe B:1456 T:0
9:53:43 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:43 AM DHCPd:DHCP_DISCOVER received, xid:1CF210A0
9:53:43 AM DHCPd:iPXE user-class detected
9:53:43 AM DHCPd:DHCP_OFFER sent, IP:142.176.120.103, xid:1CF210A0
9:53:43 AM DHCPd:incoming packet from : 00-21-9B-6D-5B-38
9:53:43 AM DHCPd:DHCP_REQUEST discarded, xid:1CF210A0
9:53:43 AM TFTPd:DoReadFile:menu.ipxe B:1432 T:9127

Regards,

Erwan

Hi Erwan,

 

I think this is not a problem of Tiny PXE Server, but with iPXE, does it really need to do the "dhcp" command? just to get the menu.ipxe?

 

Yes we have MS DHCP Server on our Network

 

Thanks again,

Jeff



#116 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 02 September 2013 - 12:10 PM

Hi Jeff,

 

I believe you can skip the dhcp command in your ipxe script.

See if this improves things

 

On my side, I will see how / if I can handle DHCPINFORM and DHCPDECLINE packets.

I will also work on the log to make it (a bit) more accurate and readable.

 

Regards,

Erwan



#117 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 02 September 2013 - 05:26 PM

Latest version (still 1.0.0.14) is a bit easier to read on the log side of it (less lines) while providing a bit more informations.

 

Exemple below : a complete pxe->ipxe->script sequence in proxydhcp mode should be displayed in 12 lines (versus 17 before).

 

Action, MAC, IP, Transaction ID are easier to identify and to associate.

19:23:32 DHCPd:DISCOVER received, MAC:00-1C-25-70-13-F5, XID:F5137026
19:23:32 DHCPd:OFFER sent, IP:192.168.1.101, XID:F5137026
19:23:34 DHCPd:REQUEST discarded, MAC:00-1C-25-70-13-F5, XID:F5137026
19:23:34 DHCPd4011:REQUEST received, MAC:00-1C-25-70-13-F5, IP:192.168.1.133, XID:F5137026
19:23:34 DHCPd4011:DHCP_ACK sent, IP:192.168.1.133, xid:F5137026
19:23:34 TFTPd:DoReadFile:ipxe-undionly.kpxe B:0 T:66711
19:23:34 TFTPd:DoReadFile:ipxe-undionly.kpxe B:1456 T:0
19:23:43 DHCPd:DISCOVER received, MAC:00-1C-25-70-13-F5, XID:FEB2856
19:23:43 DHCPd:iPXE user-class detected
19:23:43 DHCPd:OFFER sent, IP:192.168.1.101, XID:FEB2856
19:23:43 DHCPd:REQUEST discarded, MAC:00-1C-25-70-13-F5, XID:FEB2856
19:23:43 TFTPd:DoReadFile:menu.ipxe B:1432 T:7346

  • sebus likes this

#118 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 02 September 2013 - 07:24 PM

Done.

 

TFTPD is enabled by default unless you put tftpd=0 in the config file.

Just to be picky, you could build a bit of logic, if tftpd=0 then we do not care about path to the boot file (as we obviously do not do tftp), so the name only is enough

 

sebus



#119 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 02 September 2013 - 07:43 PM

Just to be picky, you could build a bit of logic, if tftpd=0 then we do not care about path to the boot file (as we obviously do not do tftp), so the name only is enough

 

sebus

 

Possible indeed :)

 

Thus I purposedly forced the path+filename in order to actually retrieve information from the file (the size).

This in order to send back option dhcp 13 (boot file size in blocks of 512 bytes).

If I have only the (short) filename then i cannot calculate option 13.

 

Although I tend to believe that this option is useless or at least that pxe clients do no care whether it is there or not...

More than once did I see pxe server skip that option and this without any impact on the whole process.

 

See here : http://tools.ietf.org/html/rfc2132 item "boot file size option"


  • sebus likes this

#120 sebus

sebus

    Frequent Member

  • Advanced user
  • 355 posts

Posted 02 September 2013 - 10:10 PM

I am sure that option does not matter (none of my DHCP servers / proxyDHCP has it configured and all work well)

 

sebus



#121 Lewis

Lewis

    Newbie

  • Members
  • 18 posts
  •  
    Australia

Posted 06 September 2013 - 05:50 AM

Hey guys,

 

Hitting this weird snafu when I'm trying to proxy DHCP boot a computer on our network. Now, it used to work, but now this is what happens:

 

 

3:37:28 PM root path=Y:\PXEEnvironment\tinypxe\files\
3:37:28 PM dhcpd:67 started...
3:37:28 PM dhcpd:4011 started...
3:37:28 PM tftpd started...
3:37:32 PM DHCPd:DISCOVER received, MAC:00-24-81-B4-BA-A4, XID:A4BAB486
3:37:33 PM dhcpd:67 stopped...
 
Before, when it was working, I wouldn't get the line of "dhcpd:67 stopped" and everything would boot okay.
 
Thoughts? This is my config:
 
[frmDHCPServer]
top=196
left=910
[frmAbout]
top=483
left=704
[dhcp]
root=Y:\PXEEnvironment\tinypxe\files
filename=ipxe.pxe
optextra=bootscript.txt
httpd=1
proxydhcp=1
start=1
binl=0
subnet=255.255.255.0
 

 



#122 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 06 September 2013 - 06:09 AM

Hi Lewis,

 

Did you update binary before/after this bug or did this bug appearead while you stayed on the same binary?

This just to check whether I could have introduced a bug between 2 versions.

 

Can you also put a screenshot of the main screen?

 

Looks like my UDP thread silenty crashed.

I'll see if I can put more details when this happens.

 

Regards,

Erwan



#123 Lewis

Lewis

    Newbie

  • Members
  • 18 posts
  •  
    Australia

Posted 06 September 2013 - 06:11 AM

Can do!

 

http://imgur.com/uw2MdUP

 

Thanks for your help, the way you support this tool is absolutely awesome.

 

It worked a few times today but I can't get it to work again. I should reboot it and try it again.

 

Is there a manual way to restart the UDP thread? Or any of the threads?



#124 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 06 September 2013 - 07:35 AM

Possible workaround when you encounter this issue :

-Clicking offline (button) will shutdown the udp thread.

-Clicking online will restart the udp thread.

 

Will post a new version this evening which should help debug this issue : it is either the udp socket itself crashing on incoming packet (i doubt it) or the parsing of the packet (most probably).

Either a packet is malformed or my parser has a flaw.

 

Edit : do you get this bug "only" in proxydhcp mode?

 

Edit : option17 and extra options are wrong.

In your case, it should be empty.

If your bootscript.txt is an ipxe script then you should put it in the "filename if user-class=ipxe/gpxe".

option 17/root path is a dhcp option, not linked to the root path of your executable.

 

 

Regards,

Erwan



#125 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 2794 posts
  • Location:Nantes - France
  •  
    France

Posted 06 September 2013 - 03:48 PM

Lewis,

 

I can confirm that the issue comes from the fact that you put "bootscript.txt" in the extra options fields.

The field should contain something like 175.6.1.1.1.8.1.1 .

 

I have uploaded a new version which will no longer crash on this issue.

Plus, it will display something like :

...
17:47:22 DHCPd:DISCOVER received, MAC:00-1C-25-70-13-F5, XID:F5137026
17:47:23 analysedata67:'bootscript' is not a valid integer value
...

Hope this answers your issue !

 

Regards,

Erwan






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users