Page 1 of 1

DHCPCD disable

Posted: 12 Nov 2012, 07:35
by Spice_Boy
Hi all,

I want to completely disable DHCPCD from ever running.

I have a machine with three network cards, two of which I want to assign addresses to, and the third is just for monitoring (no IP needed).

The problem I have is that if I use killall dhcpcd in /etc/rc.d/rc.local it comes back anyway, like a wrapper (if I've used that term correctly).

If I set my ip addresses manually, they only stick for a little while, as DHCPCD takes over them again.

I tried making a dummy /sbin/dhcpcd file but that didn't go well, and would have been messy anyway.
I also tried modifying /etc/NetworkManager/NetworkManager.conf by removing the dhcp line in there, but to no avail.

There must be something that stops this machine from ever looking for an address from DHCP.

Also, howcome sometimes between bootups the network cards change their identity. I mean, one time the eth0 card will be a certain physical card, but then it may become the eth2 card on the next boot up.

I hope someone can shed some light on this.

Re: DHCPCD disable

Posted: 12 Nov 2012, 07:58
by fanthom
Hi Spice_Boy,

NM is pretty stubborn so you have to terminate it with 'kill -9 ` command and then 'killall dhcpcd'.

or better just use 'nonetwork' cheatcode so they will never be started :)

Cheers

Re: DHCPCD disable

Posted: 12 Nov 2012, 09:30
by Spice_Boy
That nonetwork did the trick I wanted, thank you.

The second part is still a bit of an annoying issue that makes no sense. One boot (most boots) the network devices are numbered a certain way, but then another boot they might swap around, which makes my setup useless and I have to restart. I'm just baffled as to why hardware that hasn't changed gets its device numbering changed.

I'd like to set the host name too. I can change it with the hostname command, but don't know which file it actually changes to I can make it permanent.

Re: DHCPCD disable

Posted: 12 Nov 2012, 10:47
by Hamza

Code: Select all

chmod -x /sbin/dhcpcd

Re: DHCPCD disable

Posted: 12 Nov 2012, 18:31
by Ahau
Your devices are changing order because the system discovers your hardware and assigns each device to an alias one every boot, and it assigns them in the order they are discovered. This is basically a race condition -- sometimes one card is discovered first, sometimes another. I'm working through trying to resolve this for sound cards so that users will be able to select a particular card to load first (to act as default). I haven't done enough testing, but here are somethings that might be of interest, and you can test if you're up for it:

http://www.linuxquestions.org/questions ... ux-872850/
set an alias in /etc/modprobe.d/modprobe.conf, e.g.

Code: Select all

alias eth0 driver_name1
alias eth1 driver_name2
or

Code: Select all

install module2 /sbin/modprobe module1; /sbin/modprobe --ignore-install module2
In the second option, you're telling modprobe to load the driver for the device you want to be listed first, whenever it tries to load the device you want to be listed second.

If you have any luck with either of these methods, please let me know (it might save me some testing on my own).

Re: DHCPCD disable

Posted: 14 Nov 2012, 08:33
by Spice_Boy
Thank you for your response about this. I can see it's going to have to wait until I have a fair bit of time to play around, which I can't do at the moment.
Oddly enough, I've also found it with sound cards, like in your case and needed them to stay put.

Re: DHCPCD disable

Posted: 14 Nov 2012, 18:22
by Ahau
Thanks! I'm now in the process of writing the script for the sound cards. I don't have any hardware with multiple cards, so maybe you can help me test it when I have it ready :)

Re: DHCPCD disable

Posted: 15 Nov 2012, 01:54
by Spice_Boy
Mine is the built in sound card, and the microphone of a webcam. I set it up to use the microphone audio to stream its audio, not the sound card.
They sometimes change between boots, but generally the sound doesn't behave as badly as network cards.

Re: DHCPCD disable

Posted: 15 Nov 2012, 15:27
by Ahau
While operating in virtualbox, I was able to define/redefine device numbering for ethernet cards with a custom udev rule. Here's how:

modify and save this as /etc/udev/rules.d/99-custom-net.rules (the name is somewhat arbitrary but I believe it should have a high number like 99 so it is executed toward the end of the udev initialization):

Code: Select all

KERNEL=="eth?", ATTR{address}=="08:00:27:27:99:b4", NAME="eth0"  # MAC of first NIC in lowercase
KERNEL=="eth?", ATTR{address}=="08:00:27:2d:fc:17", NAME="eth1"  # MAC of second NIC in lowercase
KERNEL=="eth?", ATTR{address}=="08:00:27:ee:7a:5c", NAME="eth2"  # MAC of third NIC in lowercase
You can add another line for "eth3". swap out the MAC ID's with the appropriate ones for your devices, which you can see with 'ifconfig -a', e.g.:

Code: Select all

eth0      Link encap:Ethernet  HWaddr d4:be:d9:05:83:f2 


There are plenty of examples for this one on the net. Still working on sound cards... :)

Let me know if this helps or not.

Re: DHCPCD disable

Posted: 15 Nov 2012, 20:31
by Ahau
The discussion about sound card order should have its own topic. I've made one and posted a very preliminary version of my script there: http://forum.porteus.org/viewtopic.php?f=53&t=1676

Thanks!