Jump to content











Photo
* * * * * 1 votes

Tftp Multiple Instances


  • Please log in to reply
12 replies to this topic

#1 kopo

kopo
  • Members
  • 7 posts
  •  
    United States

Posted 31 January 2009 - 04:40 AM

Is there a way to run multiple instances of Tftpd32? I'd like to run one for each NIC.

#2 kopo

kopo
  • Members
  • 7 posts
  •  
    United States

Posted 31 January 2009 - 04:56 AM

Or maybe you can tell me how to build from the source (which compiler is used) as I've found the "offending" lines of code:

// Detect an already running Tftpd32

myMutEx = CreateMutex (NULL, TRUE, TFTPD32_MUTEX);

if (	 strstr (lpszCmdLine, "-kill") != NULL

	 || (myMutEx!=NULL  &&  GetLastError()==ERROR_ALREADY_EXISTS)  )

{

	 ReturnToPreviousInstance (myMutEx, lpszCmdLine);

	 return 0;

}

I'm however not sure the ramifications of removing this.


Update: A quick look through the .sln file revels

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008

#3 kopo

kopo
  • Members
  • 7 posts
  •  
    United States

Posted 31 January 2009 - 05:52 AM

Finally got it built, why would you hard code in the directory path to your include and lib files?

For those of you in the future that want to compile this, you need to check those because they're all set to d:\tftpd32\....

And I did try commenting out the code and got:
Error 10048

Only one usage of each socket address (protocol/network address/port) is normally permitted.



Tftpd32 can not bind the DHCP port an application is already listening on this port.

Any ideas on a work around?

#4 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 31 January 2009 - 01:39 PM

Well.. one quick solution would be running each instance inside it's own virtual machine box to which you'd assign each NIC you want.

To actually change the code, perhaps it wouldn't be bad idea to contact the author for his opinion about this matter.

:cheers:

#5 kopo

kopo
  • Members
  • 7 posts
  •  
    United States

Posted 01 February 2009 - 10:42 PM

While being a good idea, I can't use virtual machines. Maybe explaining my project will help.

I'd like to make a distributable ghosting application which can use multiple/single NIC(s) and alias multiple IPs out for each NIC (so that multiple ghosting sessions can occur concurrently with the same session name).

I'll be using the following applications:
- Symantec Ghost Server
- Tftpd32's DHCP and TFTP services

I need (would like) the unique DHCP server(s) so that I can know the range of IPs given the boxes so that I can perform post ghost operations on them remotely. I also do not have the option of installing software on the machines (ie Ghost Explorer which would be awesome).

If anyone has any other ideas outside of mine, I would also love to hear them.

Contacting the author may also not be a bad idea, but from reading other posts on this forum it seems like he does not have much to do with this project any more. Is this true?

#6 Helper

Helper

    Newbie

  • Members
  • 21 posts
  •  
    France

Posted 03 February 2009 - 10:05 AM

If this is to use TFTPd32 for it DHCP feature, the best way is to have a windows server 2003/2008 and use it's own DHCP server. And only use TFTPd32 for TFTP protocol.

TFTPd32 do not support, for the moment, DHCP relay-agent :
- DHCP multiple range configuration with DHCP Agent Relay
http://www.tech-faq....lay-agent.shtml

See this post for feature request http://www.boot-land...?...&hl=feature

#7 andriusst

andriusst

    Member

  • Members
  • 62 posts
  •  
    Lithuania

Posted 08 April 2009 - 11:33 PM

Hi kopo,

You have to specify interface IP address for each TFTPD32 instance you run. There's an option in a settings window. If it is not ticked TFTPD32 will listen and respond to all interfaces.

Can you please clarify what is "the same session name"? I do a lot of imaging with DOS ghost over the LAN (through regular Windows file share). Haven't used ghost server though.

Regards,
Andrius

#8 justin1883

justin1883
  • Members
  • 9 posts
  • Location:indianapolis IN
  •  
    United States

Posted 15 April 2009 - 01:42 AM

i also see what your saying andriusst. but the program will not allow two different windows or instances of the app. if you could go into greater detail that would help. but i guess if i have too i can run a virtual box . the app sees both nics and ips. but it doesn't look like there both running at the same time and i cant test them at home. i have two different segments so that the network is not slowed . so i need it to run on two different nics. i'll mess with it a little more i hope to here back from anyone for help.

thanks

Justin

#9 andriusst

andriusst

    Member

  • Members
  • 62 posts
  •  
    Lithuania

Posted 15 April 2009 - 01:37 PM

Hi justin1883,

You can actually cheat instances detection code. As long as you run tftpd32.exe in a different user context (must be user without administrative rights) it will not be able to find another running instance.

There are at least two ways of launching tftpd32.exe under a different credentials - Task Sheduler or RunAs.

I've just tried RunAs way and it seems to work very well. Here's what you have to do:
1. create two new windows user accounts ie. tftpduser1 and tftpduser2. Make sure they are not in Administrators group.
2. Make 2 copies of tftpd32 folder tftpd32_1 and tftpd32_2 and make sure file system permissions are set to Full Access to Everyone on both folders (for sake of simplicity).
3. Run each copy of tftpd32 and configure for different subnets. Make sure to tick boxes to bind to correct IP address.
4. Close tftpd32 if you haven't done that yet.
5. Now's the fun part. Run tftpd32.exe from the first folder by right clicking exe file and chosing RunAs and type in logon details for the first user. This should start your first tftpd32 instance.
6. In the same maner start the second copy of tftpd32 just make sure to use second user login details.

If you've done everything correctly you should be able to see pretty much the same picture as my screen shot.

Running even more than two instances shouldn't be a problem as long as they all run under different credentials and can not see each other. If you want unattended way of starting tftpd32 you can try using task scheduler or use runas command in a bat file.

This trick works not just for tftpd32 but for any other program prohibiting multiple instances.

Hope this helps and good luck.

regards,
Andrius

Attached Thumbnails

  • 2xtftp32.PNG


#10 justin1883

justin1883
  • Members
  • 9 posts
  • Location:indianapolis IN
  •  
    United States

Posted 15 April 2009 - 06:02 PM

thanks homie that did it. :)

#11 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 15 April 2009 - 09:57 PM

This trick works not just for tftpd32 but for any other program prohibiting multiple instances.

Very cool solution!! :)

#12 Ph. Jounin

Ph. Jounin

    Member

  • Developer
  • 54 posts
  • Location:Lyon (France)

Posted 17 April 2009 - 07:58 PM

Hi all,

This detection is necessary since Tftpd32 uses unique resources (mainly udp ports) and to keep the "all in one" spirit.

If you need this feature (and if you know what's you're doing), you can edit the exe file (i use notepad++) and search for
- <Tftpd32> by Ph. Jounin MutEx
- Tftpd32.ini
Change both Tftpd32 occurrences with, for instance, Tftpd33 save the file as tftpd33.exe. Now create an empty Tftpd33.ini file and you are at home (but don't complain if Tftpd32/Tftpd33 can't bind ports ;-)

I proceeded this way to test Tftpd32 and separate the TFTP client and the TFTP server (Remember that Tftpd32 is 11 years old and virtualization was not that common).

#13 kopo

kopo
  • Members
  • 7 posts
  •  
    United States

Posted 08 June 2009 - 07:04 PM

I didn't realize this thread was still active (I stopped receiving emails) This post pretty much answered my question.

If this is to use TFTPd32 for it DHCP feature, the best way is to have a windows server 2003/2008 and use it's own DHCP server. And only use TFTPd32 for TFTP protocol.

TFTPd32 do not support, for the moment, DHCP relay-agent :
- DHCP multiple range configuration with DHCP Agent Relay
http://www.tech-faq....lay-agent.shtml

See this post for feature request http://www.boot-land...?...&hl=feature


However now that I see the developer responded. I did edit the .exe and as you stated and was seeing binding errors (i'm not complaining ;) ) Is it possible to bind to random ports within in a range so that these errors are not seen? Or are these ports required to be a certain number for a DHCP server?

Finally got it built, why would you hard code in the directory path to your include and lib files?

For those of you in the future that want to compile this, you need to check those because they're all set to d:\tftpd32\....

And I did try commenting out the code and got:

Error 10048

Only one usage of each socket address &#40;protocol/network address/port&#41; is normally permitted.



Tftpd32 can not bind the DHCP port an application is already listening on this port.

Any ideas on a work around?


The above quote states that I was able to get multiple instances but was receiving those errors when starting them up.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users