Device Naming and DHCP

Discussion to talk about software related topics only.
Post Reply
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Device Naming and DHCP

Post 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?
User avatar
Chris Ruff
Posts: 222
Joined: Thu Apr 24, 2008 4:09 pm
Location: topsail island, nc
Contact:

Re: Device Naming and DHCP

Post 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
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Re: Device Naming and DHCP

Post 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.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Device Naming and DHCP

Post by rnixon »

I think you might be confusing DNS with NETBIOS naming, which windows uses.
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Re: Device Naming and DHCP

Post by talexander »

Does that mean that it's not possible to identify an NB device by name on a local network?
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Device Naming and DHCP

Post by rnixon »

Do you have a DNS server?
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Re: Device Naming and DHCP

Post 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.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: Device Naming and DHCP

Post 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).
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Re: Device Naming and DHCP

Post 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.
talexander
Posts: 21
Joined: Fri Apr 25, 2008 10:17 am

Re: Device Naming and DHCP

Post 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 );
}
}
Post Reply