DHCPCD disable

Post here if you are a new Porteus member and you're looking for some help.
Spice_Boy
White ninja
White ninja
Posts: 6
Joined: 11 Mar 2011, 22:04
Location: Country

DHCPCD disable

Post#1 by Spice_Boy » 12 Nov 2012, 07:35

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.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: DHCPCD disable

Post#2 by fanthom » 12 Nov 2012, 07:58

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
Please add [Solved] to your thread title if the solution was found.

Spice_Boy
White ninja
White ninja
Posts: 6
Joined: 11 Mar 2011, 22:04
Location: Country

Re: DHCPCD disable

Post#3 by Spice_Boy » 12 Nov 2012, 09:30

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.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: DHCPCD disable

Post#4 by Hamza » 12 Nov 2012, 10:47

Code: Select all

chmod -x /sbin/dhcpcd
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: DHCPCD disable

Post#5 by Ahau » 12 Nov 2012, 18:31

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).
Please take a look at our online documentation, here. Suggestions are welcome!

Spice_Boy
White ninja
White ninja
Posts: 6
Joined: 11 Mar 2011, 22:04
Location: Country

Re: DHCPCD disable

Post#6 by Spice_Boy » 14 Nov 2012, 08:33

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.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: DHCPCD disable

Post#7 by Ahau » 14 Nov 2012, 18:22

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 :)
Please take a look at our online documentation, here. Suggestions are welcome!

Spice_Boy
White ninja
White ninja
Posts: 6
Joined: 11 Mar 2011, 22:04
Location: Country

Re: DHCPCD disable

Post#8 by Spice_Boy » 15 Nov 2012, 01:54

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.

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: DHCPCD disable

Post#9 by Ahau » 15 Nov 2012, 15:27

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.
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: DHCPCD disable

Post#10 by Ahau » 15 Nov 2012, 20:31

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!
Please take a look at our online documentation, here. Suggestions are welcome!

Post Reply