Page 1 of 1

Device Naming and DHCP

Posted: Mon Nov 03, 2008 12:01 pm
by talexander
I was wondering if anyone has had any success being able to refer to a netbuner device by name when using DHCP? I have tried to set the pDHCPOfferName value but it doesn't seem to work. However, I have no problem aquiring a DHCP address. Here is what I am doing:

if ( EthernetIP == 0 )
{
pDHCPOfferName = "TAECU21";
iprintf( "Trying DHCP\r\n" );
GetDHCPAddress();
iprintf( "DHCP assigned the IP address of :" );
ShowIP( EthernetIP );
iprintf( "\r\n" );
}

Is there any other initialization I need to be doing?

Re: Device Naming and DHCP

Posted: Mon Nov 03, 2008 1:38 pm
by Chris Ruff
If you check your DHCP server, you will see your offer name.

-However-

Unless your DHCP server converses regularly with your DNS server you will not be able to connect using a name alone.

You can, of course, tell your DNS server about the NB toy by host name.

Chris

Re: Device Naming and DHCP

Posted: Mon Nov 03, 2008 1:57 pm
by talexander
I haven't been able to get that far. I have the NB board connected to a Linksys router, which is handing out the addresses. I use the router with other devices (WinCE for example) and can connect by host name no problem. Using the example above my NB board gets an IP address, but no client host name shows up in the IP table.

Re: Device Naming and DHCP

Posted: Mon Nov 03, 2008 3:01 pm
by rnixon
I think you might be confusing DNS with NETBIOS naming, which windows uses.

Re: Device Naming and DHCP

Posted: Tue Nov 04, 2008 10:24 am
by talexander
Does that mean that it's not possible to identify an NB device by name on a local network?

Re: Device Naming and DHCP

Posted: Tue Nov 04, 2008 7:24 pm
by rnixon
Do you have a DNS server?

Re: Device Naming and DHCP

Posted: Wed Nov 05, 2008 6:29 am
by talexander
I'll need to set one up and test it out. For our application all devices are tied to an access point and a server which is isolated from other networks. The server isn't running DNS.

Re: Device Naming and DHCP

Posted: Wed Nov 05, 2008 8:19 pm
by rnixon
There may be netbios support may be in an upcoming release. I would check with netburner support to determine when (similar to the way your windows machines are working).

Re: Device Naming and DHCP

Posted: Fri Nov 14, 2008 6:24 am
by talexander
I got device naming to work. I used a tool called Dual DHCP DNS server and set it up on a windows system. I turned on both servers and with some minor configuration it works great! Thanks for the help.

Re: Device Naming and DHCP

Posted: Fri Nov 14, 2008 6:42 am
by talexander
Also, forgot to mention that I discovered a minor issue in dhcpc.cpp where the device name is not re-sent when the IP lease expires. This is fixed by copying the following code from DHCPDiscover and placing into CreateDHCPRenewMsg, below the InterfaceMAC configuration:


if ( pDHCPOfferName != NULL )
{
int nlen = strlen( pDHCPOfferName );
NewMsg.SetOptions( opt++, 12 );
NewMsg.SetOptions( opt++, nlen );
for ( i = 0; i < nlen; i++ )
{
NewMsg.SetOptions( opt++, pDHCPOfferName );
}
}