Home/Support/Support Forum/Enabling/Disabling DHCP
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Enabling/Disabling DHCP

0 votes
I am attempting to use NetOS 7.4's naIamEnable() and naIamDisable() to switch between DHCP and Static IPs after I write the changes with customizeIamSetInterfaceConfig(). It disables, but does not start a new connection. Do I need to call naIamAquire or naIamStart? Anyone have any idea how to use these functions?

Thanks,
-Erik
asked Aug 26, 2009 in NET+OS by egawtry Veteran of the Digi Community (349 points)
recategorized Dec 18, 2013 by tuxembb

Please log in or register to answer this question.

6 Answers

0 votes
I have not tested this, but reading thru the API, it mentions that if you are using your own IP address acquisition protocol, you must enable the method using naIamEnable. However, the document did not discuss switching methods midstream.

During startup, customizeIamStart is called to handle the initialization. The function naIamStart will then start any methods that have been enabled.

One item to note: naIamStart() should always be called with configuration parameters returned by naIfConfigGetInterfaceParams() as they are platform specific and should not be modified by the application.

For your review of how customizeIamStart handles things, I have attached a file "iamCallbacks.c".


Message was edited by: sbrown
answered Aug 27, 2009 by sbrown New to the Community (48 points)
0 votes
Sorry, I forgot to attach the previously mentioned file.
answered Aug 27, 2009 by sbrown New to the Community (48 points)
0 votes
So what you are saying is that if the method is switched, I should reboot and only use the inline method for reloading DHCP if already loaded or for switching static IP addresses.

-Erik
answered Aug 27, 2009 by egawtry Veteran of the Digi Community (349 points)
0 votes
Egawtry - you actually just need to throw in a 2 or 3 sec delau between your disable and enable calls
answered Aug 28, 2009 by charliek Veteran of the Digi Community (408 points)
0 votes
I got it to work with the reboot. I have several listen sockets which were getting confused, so that was the easiest solution.

Thanks,
-Erik
answered Aug 28, 2009 by egawtry Veteran of the Digi Community (349 points)
0 votes
Digi also recently fixed it with the most recent TCP/IP patch so you don't have to put a delay between stopping and starting the IAM interface.
answered Sep 5, 2009 by charliek Veteran of the Digi Community (408 points)
...