WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TinyCore not registering in DNS using DHCP over Wireless  (Read 7173 times)

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
TinyCore not registering in DNS using DHCP over Wireless
« on: September 17, 2012, 12:04:08 PM »
I'm unsure to what the issue is or where to begin troubleshooting this.
Currently I have around 100 TC machines running.  They are identical hardware, and they are all built the same (except for the hostname).  What I have found is that when using the wired connection on TC it updates DNS with it's name.  Although if I use the Wireless connection it does not update DNS.  It still gets an IP and everything else works, it just doesn't update DNS with it's name.
I have tested this on separate VLAN's and still only the wired connection registers in DNS the wireless never registers itself.

Now I was having an issue with the TC machines losing wireless connection and never coming back online.  I solved this by having a small script that runs in the background, that checks for a wireless connection, if the wireless connection does not exist then it runs an iwconfig to reconnect.  I doubt this is the problem though, but it could be.

It's not a huge deal, but it would be nice to find all of my TC stations by name in DNS rather than having to compare MAC addresses in DHCP to locate them.

Any suggestions of where I may start troubleshooting?

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14791
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #1 on: September 17, 2012, 12:12:06 PM »
Does "ps aux | grep udhcpc" show that the host name is passed in the case of a wireless connection?

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #2 on: September 17, 2012, 12:37:43 PM »
Nope it doesn't, at least not for wlan0
Code: [Select]
ps aux | grep udhcpc
3493 root udhcpc -i wlan0
3511 root /sbin/udhcpc -b -i eth0 -x hostname KBox0018 -p /var/run/udhcpc.eth0.pid
32013 tc grep udhcpc

Do I specifically have to bind the hostname to wlan0?  If so how would I go about doing that?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #3 on: September 17, 2012, 12:39:06 PM »
Depends, how do you start it? Wifi.sh, own scripts, something else?
The only barriers that can stop you are the ones you create yourself.

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #4 on: September 17, 2012, 12:53:13 PM »
I do an ifconfig wlan0 up, then I configure it using iwconfig wlan0 to connect it to the wifi.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #5 on: September 17, 2012, 01:05:47 PM »
I meant udhcpc, do you start it from your script too? If so, then you'll need to add the argument there.

See /etc/init.d/dhcp.sh for how the ethernet automagic does it.
The only barriers that can stop you are the ones you create yourself.

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #6 on: September 17, 2012, 01:19:20 PM »
Yeah, sorry, I should have been more specific.

I just checked all of the scripts that I run, along with my bootlocal and I do not call udhcpc anywhere.
But I will try adding the proper udhcpc command to my wireless connection script at the end.

Reading through the /etc/init.d/dhcp.sh it appears that my wlan0 does not come up until after the script completes, and that is probably why it is not working properly.  I bring my wlan0 up inside bootlocal.sh
Maybe I should bring my wlan0 up inside bootsync.sh instead?

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #7 on: September 17, 2012, 02:13:50 PM »
Okay, I just added
Code: [Select]
/sbin/udhcpc -b -i wlan0 -x hostname:$(/bin/hostname) -p /var/run/udhcpc.wlan0.pid
to my wireless connection script.

Now when checking the processes it does show the hostname in there and checking DNS it now shows up properly in DNS.
So now my script goes
Code: [Select]
ifconfig wlan0 up
iwconfig wlan0 xxxxx
/sbin/udhcpc -b -i wlan0 -x hostname:$(/bin/hostname) -p /var/run/udhcpc.wlan0.pid

Would this be the correct way, or should I be doing something else?  So far it is working.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11041
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #8 on: September 17, 2012, 02:20:23 PM »
That's correct.
The only barriers that can stop you are the ones you create yourself.

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #9 on: September 17, 2012, 03:15:13 PM »
Cool, thank you very much for your help.

Also as an FYI to anyone else, I tried to just add /etc/init.d/dhcp.sh to the end of my wireless script, like so:
Code: [Select]
ifconfig wlan0 up
iwconfig wlan0 xxxx
/etc/init.d/dhcp.sh

And instead of it creating udhcpc processes for both eth0 and wlan0 it just created 2 processes for eth0.  For some reason it never saw my wlan0, or it thought that wlan0 was also eth0.
I think the problem is that it is just searching for /eth* in the /etc/init.d/dhcp.sh
I started to try and fix it, but realized I haven't played with awk in a few years.  If I get bored later I will take a look at it, and try and add wlan in there as well.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #10 on: September 17, 2012, 03:22:08 PM »
Running more than 1 dhcp instance on different interfaces on same host should be avoided.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #11 on: September 17, 2012, 04:17:05 PM »
Running more than 1 dhcp instance on different interfaces on same host should be avoided.

Could you elaborate a little more?  I haven't heard of that before.
If that is the case then should I be doing a nodhcp in my boot code to prevent udhcpc from running on eth0 ?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #12 on: September 17, 2012, 06:13:18 PM »
Running more than 1 dhcp instance on different interfaces on same host should be avoided.

Could you elaborate a little more?  I haven't heard of that before.

If you'd run 2 dhcp client instances, most likely they would interfere with each other - at least if they are not particularly configured.

Quote
If that is the case then should I be doing a nodhcp in my boot code to prevent udhcpc from running on eth0 ?

Absolutely
« Last Edit: September 17, 2012, 06:16:04 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline KHarvey

  • Full Member
  • ***
  • Posts: 102
Re: TinyCore not registering in DNS using DHCP over Wireless
« Reply #14 on: September 18, 2012, 09:44:30 AM »
Thanks for the added info and the link.  In the end the link just states that the OS could get confused as to which interface to send packets out of.  I'm not sure how often that happens, but to me that signifies that you have a problem with your network stack in your OS.   
I also did not understand the point of using one static assignment and one DHCP assignment.  Once an address is assigned it shouldn't matter how it was assigned, until it needs to renew its IP with the DHCP server.  The DHCP protocol also handles the issue using a three-way-handshake.

Either way I am following the best practices of that article, but not for the same reasons.  I have my network VLAN'd out based on the traffic, and it happens that my wireless traffic is on it's own VLAN.  And yes I do keep my VLAN's on separate subnets.  Also I do not have any of my TC stations with a physical network cable plugged into them, so they are all running on wireless.

Sorry, originally I was just going to post the first paragraph, but I got a little carried away.  :P