LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware dhcpcd client? (https://www.linuxquestions.org/questions/slackware-14/slackware-dhcpcd-client-302378/)

chbin 03-16-2005 01:50 PM

slackware dhcpcd client?
 
My dhcpcd client thinks my d-link router is a namsever?

Quote:

$ netconfig
hostname = localhost
domain = localdomain
... select dhcp
dhcp hostname = localhost
... accept

cat /etc/resolv.conf
nameserver 192.168.0.1
search xxx.xxx.xxx.net

umm, sorry linux dhcp client, my router at 192.168.0.1 is not a nameserver. However, it does have the DNS IP's, so why don't you ask it and it will kindly give them to you. Linux dhcp client says I don't know how to ask it politely. Why don't you tell me how?

Right now I'm runnig a static config w/ puting in dns ip into the resolv.conf manually. I would like to get this dhcp working properly though?

rose_bud4201 03-16-2005 02:42 PM

In /etc/rc.d/rc.inet1, you should be able to change $USE_DHCP to "Yes", configure any other options you may find interesting, and restart your ethernet interface via ifconfig.
If that works, I'd just manually remove your router's IP from resolv.conf - it probably isn't doing any harm, but it probably isn't helping either :-)

chbin 03-16-2005 02:55 PM

Quote:

Originally posted by rose_bud4201
If that works, I'd just manually remove your router's IP from resolv.conf - it probably isn't doing any harm, but it probably isn't helping either :-)


Manually remove the ip from resolv.conf and replace with real DNS servers???????????????????????????

THAT MISSES THE WHOLE POINT OF MY QUESTION? THE WHOLE POINT is that the dhcp client thinks that 192.168.0.1, my router, is a nameserver. I want the dhcp client to talk to the router and get the real DNS ip's and put them into resolv.conf automatically.

killerbob 03-16-2005 04:03 PM

Quote:

umm, sorry linux dhcp client, my router at 192.168.0.1 is not a nameserver. However, it does have the DNS IP's, so why don't you ask it and it will kindly give them to you. Linux dhcp client says I don't know how to ask it politely. Why don't you tell me how?
If your router is providing DHCP services, it's entirely possible that it's also providing DNS services as a caching or redirect server. Such a service wouldn't be beyond the realms of plausibility, considering that my own D-Link "router" (which is being used as a hub and print server, atm) has that capability.

Are you able to resolve FQDN's with the setting the way the DHCP client seems to be setting it?

djbanaan 03-16-2005 04:26 PM

killerbob is right. It is not dhcpcd that "thinks" 192.168.0.1 is a valid DNS server, it is your router's DHCP server that passes this address as a DNS server. In fact, this is a pretty common thing for a router to do, because caching DNS entries on the router can speed up name resolution.

The question remains, of course, whether this set up is working for you or not. Some routers will allow you to disable DNS caching/ forwarding and have their built-in DHCP server assign the ISP's DNS server addresses to your DHCP client.

On another note, I think there is no need TO SHOUT at someone who's trying to help you with your problem.

chbin 03-16-2005 04:32 PM

Yes you are indeed correct the router at 192.168.0.1 does provide a resolver. However, it is not a very good resolver and takes forever to resolve names. The other computer on the LAN with windows xp can automatically querry the router for the real dns ip's. It is just a matter of getting dhcp client in linux to ask ther router properly for it? And yes if I manually add the DNS names to the resolv.conf file then it works great. However, that is just a hack that bypasses the dhcp client. Any dhcp client worth using is supposed to querry the DHCP server for the real dns names. Otherwise what is the point of using a dhcp?

chbin 03-16-2005 04:36 PM

And yes it is possible because when windows xp querries the router is does get the real DNS ip's and not the 192.168.0.1 nameserver, which sucks.

chbin 03-16-2005 04:41 PM

Also, I didn't mean TO SHOUT, it's just that I've been trying to get the dhcp client to get the real DNS ip's for weeks and it is annoying the hell out of me. I am no newbie to linux and it is frustrating me because I con't figure it out.

killerbob 03-16-2005 05:08 PM

Are you certain that the Windows box is using dynamic configuration for *all* the options? It is entirely possible for Windows to be on DHCP for network configuration, but to use static configuration for DNS setup.

I ask, because as I understand it, DHCP is DHCP. Period.

DHCP works like this:
1 - Client sends out a DHCP probe packet, on the broadcast address 255.255.255.255.
2 - DHCP server hears the packet, and replies on the same broadcast address with an IP address and the client's MAC address.
3 - Client hears DHCP's response, and switches to using that IP address. It responds directly to DHCP server, asking for netmask, gateway, DNS, lease duration, and anything else that can be configured in DHCP's response.
4 - DHCP server replies with all of the information that it's configured to send out.
5 - Client autoconfigures with the information provided by the DHCP server.
6 - DHCP records the IP address and the MAC address in the leases file, so that it doesn't send out the same IP address to another computer, and so that it can send the same credentials to the same computer if it requests them for renewal or reboots before the lease expires.

If dhcpcd gets more than one answer for the DNS server, it'll put them all in /etc/resolv.conf. Before I switched to an internal DNS server on my network, I had 7 DNS servers in my DHCP configuration, and Linux had them all in /etc/resolv.conf. Windows isn't smart enough to allow more than two DNS servers, and it'll put them in its configuration in the order they arrive in. It's actually possible for a DHCP response to have dozens of DNS servers configured, and there is absolutely no way to structure a DHCP server to give a different response to a different OS, short of having a packet filter that checks the OS signature (like nmap does), and directs the packets to a different server configuration based on the client OS.

Somehow, I don't think that D-Link would have put that kind of smarts into your router....


So the question remains. Are you *certain* that Windows is using dynamic configuration for DNS? Did you install any special software in Windows for the router, that could, conceivably, allow Windows to ask the router for information that isn't sent through DHCP?

And is there a reason that you can't just configure the DNS numbers manually in Linux? If you've already established that it works that way, why trouble yourself with trying to fix it? How many clients are you planning on adding to your network that you have to worry about the small trouble that would cause you over the aggravation of trying to change a DHCP server's request?

Is it enough that you should be considering using a real DHCP server instead of your NAT box?

chbin 03-16-2005 06:30 PM

Yeah am absolutely 100% positive that the window boxes on the LAN are using dynamic DHCP, I set them up myself. They querry the router for all the information, IP, netmask, gateway, and dns.

Thanks you for all the detailed info. I'm going to put my eht0 into promisc mode and dump the packets and see what is going on here. My understanding is that DHCP is generic so it should just work and be independent of the OS. I'm going to figure this one out.

Quote:

why trouble yourself with trying to fix it?
It's how I am. Yeah, right now I have a static config and it works, but I'm a person that likes to know the nuts and bolts of everything. I'm an Engineer. Not computer by the way. :) Computers are my hobby and I enjoy it, although sometimes it drives me crazy in the end I will be more knowledgeable for it.

Quote:

Is it enough that you should be considering using a real DHCP server instead of your NAT box?
I'm running a small LAN here and I don't want to have a dedicated computer on 24/7 to do routing/gateway/firewall/DHCP although maybe one day.

Thanks, I'll post back let you know how it goes.

chbin 03-16-2005 08:11 PM

hmm, interesting this is the pertinent information of my eth0 packet dump when it gets a replay from the router.

BOOTP/DHCP, Reply, length: 548, xid:0xd608075e, flags: [none] (0x0000)
Your IP: 192.168.0.100
Client Ethernet Address: 00:00:xx:xx:xx:xx [|bootp]


as you can see the dhcp router aint sending much? it sends that twice and then that's it. It seems is not even sending any DNS IP's. The dhcp client just assumes one of 192.168.0.1 and puts it in the resolv.conf file.

Now I have to do the same in windows xp, which is going to be harder because I don't know how to get packet dumps in windows xp.

egag 03-16-2005 08:26 PM

a way to solve your prob. would be to add the "-R " option to any instance of the " dhcpcd" command
in /etc/rc.d/rc.inet1.
in that case /etc/resolv.conf won't be overwritten, and you can put your own dns-server(s) there.

see " man dhcpcd "

egag

chbin 03-16-2005 09:05 PM

ahhh the -R option is for wussies :)

I'm getin this baby to work the right way. Further investigation of my packets tells me it is using the BOOTP protocol rather than the DHCP protocol. Reading on the net and it seems that the BOOTP protocal is a primative one and doesn't do much. So now I have to get my dhcp client to use the more advanced DHCP protocol. Think maybe the one I'm using "dhcpcd" can't do this. I'm going to get a new one. I think the dhclient one looks more advanced. I WILL FIGURE THIS OUT.

killerbob 03-16-2005 09:15 PM

Nonsense.... I'm using dhcpcd myself, on my laptop, desktop, and the Linux installation on my mother's computer (that she doesn't know is there ;)), and I've never had the problems you're describing. I'm getting IP, netmask, DNS, time, and gateway from my DHCP server.

I'm also running a server with dhcpd, rather than using a NAT box.

chbin 03-16-2005 09:51 PM

It's not the "NAT box". Absolutely without a doubt, 100% sure. The router is capable of sending the DNS info as windows xp gets it this way. The dhclient does look a lot more advanced, it has 10,000 options. Can I ask what flags your or passing to dhcpcd?

The BOOTP and DHCP are 2 different protocols as defined here:

http://www.rhyshaden.com/dhcp.htm

From my packet analysis, dhcpcd is only using the bootp protocal. Don't know why?


All times are GMT -5. The time now is 06:54 PM.