You are not logged in.

#1 2010-04-02 16:39:09

SavageMessiah
Member
Registered: 2004-03-20
Posts: 76

dhcpcd won't set IP on interface

I've found today that dhcpcd seems to refuse to set the ip on an interface if the ip has been set statically before.
For instance if I set my ip like so:

sudo ifconfig eth0 10.100.100.240 netmask 255.255.255.0 broadcast 10.100.100.255

and then run

sudo dhcpcd -nd eth0

It says that it gets the ip and lease from the server and then forks into the backround.
I'm not going to post the output because it's a pain in the ass to get it off the segregated network.
HOWEVER ifconfig stills shows the old ip.
dhclient DOES work however.
Also if my settings in rc.conf are set to dhcp dhcpcd properly sets the ip on the interface on boot.
If i set the ip statically in rc.conf, then change them to dhcp and do /etc/rc.d/network restart the same thing happens so it's not something I'm doing.

Is this a bug in dhcpcd or arch or something?
If it's a bug in arch I'll submit it but I wanted to see if anyone had any ideas first.

Last edited by SavageMessiah (2010-04-02 16:44:02)

Offline

#2 2010-04-02 17:04:36

Slurp53
Member
Registered: 2010-03-31
Posts: 20

Re: dhcpcd won't set IP on interface

I don't think it's a bug, probably you need to bring the interface down first

ifconfig eth0 down

Then issue the dhcpcd command.

I would think it would be the same using the configs

/etc/rc.d/network stop

Then change the configs to dhcp, then start

/etc/rc.d/network start

Offline

#3 2010-04-02 17:17:53

SavageMessiah
Member
Registered: 2004-03-20
Posts: 76

Re: dhcpcd won't set IP on interface

Nope, did the following and it didn't have any effect:

sudo ifconfig eth0 down
sudo dhcpcd -nd eth0

Offline

#4 2010-04-02 18:51:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: dhcpcd won't set IP on interface

I had a similar problem - setting IP manually and then not being able to tell dhcpcd to do its thing but 'sudo ifconfig eth0 down' and a reboot worked.

I have this in my /etc/rc.cionf

eth0="dhcp"
INTERFACES=(eth0)

Offline

#5 2010-04-03 01:46:18

timm
Member
From: Wisconsin
Registered: 2004-02-25
Posts: 417

Re: dhcpcd won't set IP on interface

I would think you could do:

/etc/rc.d/network restart

instead of a reboot to accomplish this

Offline

#6 2010-04-05 15:05:21

SavageMessiah
Member
Registered: 2004-03-20
Posts: 76

Re: dhcpcd won't set IP on interface

Unfortunately a reboot is a last resort for a heap of reasons I can't go into here. network restart doesn't help. It seems to be something with dhcpcd. If you've manually set the ip for an interface dhcpcd WILL NOT EVER change the ip for it until you reboot. Taking the interface down and up again doesn't help either. I think I'll just run dhclient after the settings change, that one actually works in these circumstances.

Offline

Board footer

Powered by FluxBB