You are not logged in.

#1 2012-08-20 21:06:00

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

I have my /etc/conf.d/dhcpcd setup like this:

[orlfman@pienix64 ~]$ cat /etc/conf.d/dhcpcd 
#
# Arguments to be passed to the DHCP client daemon
#

DHCPCD_ARGS="-q -s 192.168.0.14"

[orlfman@pienix64 ~]$ 

But, dhcpcd is not requesting for that IP. I am using systemd to start dhcpcd but even if I run it manually with dhcpcd eth0, it still doesn't request that IP. It just takes a random one. Right now its using 192.168.0.77...


Edit:
I turned off dhcpcd, changed it to .77, restarted dhcpcd, and now its .79...

I don't think its an issue of other devices quickly taking the IP since .14 and .77 are both available since nothing else is using it..

Last edited by muffinss (2012-08-20 21:14:49)

Offline

#2 2012-08-20 21:16:31

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Are you sure -s is the right switch?  Looking at the manpage, -s issues an 'INFORM' rather than a 'DISCOVER/REQUEST'.  The -r switch seems to be more in line with what you're describing you want.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-08-20 21:21:15

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

I just tried the -r switch and it took .80 now lol...

I also have a samba/nfs file server and a squid proxy server which I did the same thing with. I have it set to 192.168.0.15 and 192.168.0.13 and it has no issue requesting and accepting those ip's every time I restart it...

edit:
https://wiki.archlinux.org/index.php/Co … IP_address

the wiki also says to use -s too.

Note: It is possible to have a static IP address using dhcpcd. Simply edit your /etc/conf.d/dhcpcd file to look something like this (where x.x.x.x is your desired IP address): DHCPCD_ARGS="-q -s x.x.x.x"

Last edited by muffinss (2012-08-20 21:23:10)

Offline

#4 2012-08-20 21:33:14

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Werid. I just ran dhcpcd -q -s 192.168.0.14 manually and it worked. Why doesn't it work when I run it either as dhcpcd eth0 or systemctl start dhcpcd@eth0.service? It works like that fine on my other two arch computers..

Offline

#5 2012-08-20 21:39:33

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Are your other servers using dhcpcd as well?  If so, are they using the same version?  The version in the repos was just added last month, maybe you've found a bug.

Nevermind, it seems your last post answered my question.

----

Maybe running without the -q switch would result in some useful information.

Last edited by alphaniner (2012-08-20 21:43:07)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2012-08-20 21:55:44

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

I tried that. Didn't work. Its like its ignoring what ever I put in /etc/conf.d/dhcpcd. For kicks I renamed  /etc/conf.d/dhcpcd to  /etc/conf.d/dhcpcdbak and dhcpcd still started right up.

It only works if I do it manually by typing dhcpcd -q -s x.x.x.x. Doing it manually either by doing dhcpcd eth0 or systemctl start dhcpcd@eth0.service doesn't work =/

Only difference between my file server and proxy and this computer is they are running Linux kernel 3.4.8-1 while this one is running 3.4.9-1 and uses systemd.

Last edited by muffinss (2012-08-20 22:00:22)

Offline

#7 2012-08-20 22:03:43

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Do you use the same method to start dhcpcd on the other servers?  I ask because it looks like the systemd dhcpcd .service doesn't make any use of /etc/conf.d/dhcpcd.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2012-08-20 22:11:22

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

On the other servers they are started using rc.conf. eth0 set in interface= and network set in daemons list.

Offline

#9 2012-08-21 13:30:28

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

The network initscript sources /etc/conf.d/dhcpcd and uses the variable DHCPCD_ARGS:

for s in wireless bonding bridges dhcpcd; do
        [[ -f /etc/conf.d/$s ]] && . "/etc/conf.d/$s"
done
...
dhcpcd $DHCPCD_ARGS $interface || return 1

Since the dhcpcd .service doesn't seem to do any of that, I suppose that's the cause of the problem.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#10 2012-08-21 15:11:29

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

yeah I came across this problem as well.  What I did is copy the service file to the /etc/systemd/system directory and then add the necessary flags within the service file itself.  Seemed to work for me, though I am unsure if this is the preferred way.  It seems you could also tell the service file to source the conf file, but I ahve never tried to do such a thing and am unsure if this even supports it.

Offline

#11 2012-08-22 03:14:04

muffinss
Member
From: united states
Registered: 2011-02-07
Posts: 54

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Thanks guys for the help. It isn't a big concern for me with this computer since it is my general Linux box. But because of this problem, I wont be switching my servers over to systemd. I need them to always be the same IP, especially my squid proxy.

Later down the line when I get unlazy I'll just make everything static.

Offline

#12 2013-02-09 18:11:23

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 568

Re: DHCPD not requesting -s ip address in /etc/conf.d/dhcpcd

Looks like the wiki is wrong and appending "-s x.x.x.x" to the DHCPCD_ARGS line in /etc/conf.d/dhcpcd doesn't work.

However, adding it to the ExecStart line in /usr/lib/systemd/system/dhcpcd.service, then running "systemctl --system daemon-reload" followed by "systemctl restart dhcpcd" gives the required static address smile

Offline

Board footer

Powered by FluxBB