You are not logged in.

#1 2008-01-02 20:15:37

underpenguin
Member
Registered: 2007-02-01
Posts: 116

DHCPCD Issues

Hi all,

I'm having a bit of an issue with dhcpcd.

First of all, if i run manually

sudo dhcpcd eth0

everything works fine, i get an address, etc.

However, when i run

sudo /etc/rc.d/network restart

my ifconfig is as follows:

eth0      Link encap:Ethernet  HWaddr 00:1B:24:3C:9D:42
          inet6 addr: fe80::21b:24ff:fe3c:9d42/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:795 errors:0 dropped:0 overruns:0 frame:0
          TX packets:826 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:639652 (624.6 Kb)  TX bytes:132798 (129.6 Kb)
          Interrupt:10

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1000 (1000.0 b)  TX bytes:1000 (1000.0 b)

So, no ip.

my /etc/rc.conf does have

lo="lo 127.0.0.1"
eth0="dhcp"
INTERFACES=(lo eth0)

in it.

Also, my /var/log/messages.log may have an indicator of the problem:

Jan  2 14:05:37 hoth dhcpcd[8274]: eth0: dhcpcd 3.1.4 starting
Jan  2 14:05:37 hoth dhcpcd[8274]: eth0: hardware address = 00:1b:24:3c:9d:42
Jan  2 14:05:37 hoth dhcpcd[8274]: eth0: broadcasting for a lease
Jan  2 14:05:37 hoth dhcpcd[8274]: eth0: offered 192.168.2.4 from 192.168.2.1
Jan  2 14:05:38 hoth dhcpcd[8274]: eth0: checking 192.168.2.4 is available on attached networks
Jan  2 14:05:39 hoth dhcpcd[8274]: eth0: leased 192.168.2.4 for infinity
Jan  2 14:05:39 hoth dhcpcd[8274]: eth0: adding IP address 192.168.2.4/24
Jan  2 14:05:39 hoth dhcpcd[8274]: eth0: adding default route via 192.168.2.1 metric 0

Ideally, I want dhcpcd to get an ip address, but not put my router's ip in /etc/resolv.conf. I don't know if you can make some sort of mask, but i use my laptop many different places, so i can't just have dhcpcd not update my resolv.conf


thanks for you help

ben

Offline

#2 2008-01-02 20:47:28

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: DHCPCD Issues

Ben,

I do not see anything wrong with the data parsed in /var/log/messages.log. I take you have the network added to the DAEMONS line correct?
It may be driver not loading when your run /etc/rc.d/netewor restart?
Does it happen if you restart the machine of from cold boot?

As per /etc/resolv.conf that's normal behavior.  The DHCP server uses the nameserves you entered in your gateway. When you are at home, it uses your home settings, when you are somewhere else it uses the nameservers indicated in that other server.

Having said that, even if it was to use your home settings, it would work just fine in another network as log as it has a nameserver to resolve IP addresses.

Hope this helps.

R.

Offline

#3 2008-01-02 22:10:12

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Re: DHCPCD Issues

the network daemon is started.

everything works on a cold boot i believe. (except it tries to use my router as a DNS server -> very slow address resolution).

I don't think it is a driver issue, because when i run dhcpcd manually it works, basically, /etc/network restart seems to not be running dhcpcd (AFAIK), and I don't know why.

I know resolv.conf is updated automatically, but I want to be able to blacklist certain ips (192.168.2.1 for instance) so that i'm not using routers that don't function as nameservers.

Offline

#4 2008-01-02 23:20:07

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: DHCPCD Issues

underpenguin wrote:

except it tries to use my router as a DNS server -> very slow address resolution)

If you are certain that that is in fact the situation, then you have some misconfiguration in your router.
See, your router has settings to deliver DHCP addresses to devices attached to it. It also has, or should have, a setting to indicate theIP addresses of the DNS servers to use. If that is set up correctly you should have no problems.

Take a look at your router's manual to find out the correct settings for DNS.

R.

Edit: On second thought, can you please post your /etc/resolv.conf?

Last edited by ralvez (2008-01-02 23:22:53)

Offline

#5 2008-01-03 18:09:16

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: DHCPCD Issues

'/etc/rc.d/network restart' is troublesome, better use '..stop' and '..start'.


1000

Offline

#6 2008-01-03 19:33:31

underpenguin
Member
Registered: 2007-02-01
Posts: 116

Re: DHCPCD Issues

well, i looked at restart and all it does is stop and start with a delay, so i don't think the problem is there.

I am now having a problem with wireless. As it is now I have to do the following to get my wireless card working (ndiswrapper module loaded at startup) without 15sec waiting time to resolve domain names.

1) connect to the wireless network
2) run dhcpcd wlan0 to get the network's nameservers
3) remove the router's ip from resolv.conf
4) run dhcpcd wlan0 -R to get the new resolv.conf to take effect w/o updating it.

I don't want to just use static nameservers all the time, i guess i could use opendns, i may do that if i can't find an alternative.

I looked at my router configuration and there is just a setting to automatically get DNS servers form my ISP, which is what I am using now, and there isn't any problems with windows machines (or ubuntu when i was using it), so I'm pretty sure there is something adding the router IP to resolv.conf.

Offline

Board footer

Powered by FluxBB