[En-Nut-Discussion] Problem with DHCP
Thiago A. Corrêa
thiago.correa at gmail.com
Thu Dec 8 18:44:20 CET 2005
Hi,
Thanks for your reply :)
Yes, it seams like my code was correct, even if a bit more
complicated hehe. I did some tests just now with the Windows DHCPd
instead of tftpd, and it worked. Looks like ethernut isn´t compatible
with tftpd in someway, but that´s fine for me.
On 12/8/05, Hugo Simon <hugo.simon at gmx.de> wrote:
> > Since my network has no DHCP server, I´m running the DHCP server
> >from Tftpd by Ph. Jounin. I can see in the log window that the board
> >does requests an address ( Rcvd DHCP Rqst Msg for IP 0.0.0.0, MAC
> >00:50:C2:4B:50:03 (07/12 16:16:44.093) ), but the device doesn´t get
> >any address from the pool, instead, it uses the last configured
> >address.
>
> I don't exactly see why your routine isn't working correctly, but I think
> you think too complicated. I did it this way:
>
> /* first try it completely from EEPROM/DHCP */
> if (NutDhcpIfConfig("eth0", 0, 20000))
> {
> /* oops, maybe we didn't have a configured MAC, so try a default one */
> if (NutDhcpIfConfig("eth0", mac, 20000))
> {
> /* again oops, looks like there is something wrong with the
> configuration
> so use default settings */
> DEBUG_PRINTF_P(PSTR(" DHCP failed, using default settings\n"));
> NutNetIfConfig2("eth0", mac, ip_addr, ip_mask, ip_gate);
> }
> }
>
> NutDhcpIfConfig already loads the settings from EEPROM if there is any. If
> there is a configured IP in confnet.cdn_cip_addr other than 0.0.0.0 it uses
> this one, otherwise it tries DHCP. If that fails too, it returns an error.
> In that case a default config is used.
>
> If you like I have some web based configuration routines where the user can
> configure the network settings via browser. If you are interested contact me
> personally.
>
> Hope it helps.
> Bye
> Thorsten
>
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
More information about the En-Nut-Discussion
mailing list