Device Naming and DHCP
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Device Naming and DHCP
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?
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?
- Chris Ruff
- Posts: 222
- Joined: Thu Apr 24, 2008 4:09 pm
- Location: topsail island, nc
- Contact:
Re: Device Naming and DHCP
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
-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
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Re: Device Naming and DHCP
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
I think you might be confusing DNS with NETBIOS naming, which windows uses.
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Re: Device Naming and DHCP
Does that mean that it's not possible to identify an NB device by name on a local network?
Re: Device Naming and DHCP
Do you have a DNS server?
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Re: Device Naming and DHCP
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
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).
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Re: Device Naming and DHCP
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.
-
- Posts: 21
- Joined: Fri Apr 25, 2008 10:17 am
Re: Device Naming and DHCP
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 );
}
}
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 );
}
}