Code: Select all
# Generated by udhcpc for eth0
search localdomain.loc
nameserver 1.2.3.4
nameserver 1.2.3.5
Code: Select all
config_eth0='192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0'
routes_eth0='default via 192.168.0.1'

Code: Select all
# Generated by udhcpc for eth0
search localdomain.loc
nameserver 1.2.3.4
nameserver 1.2.3.5
Code: Select all
config_eth0='192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0'
routes_eth0='default via 192.168.0.1'
To make story short, udev was update, a note has been put udev change network device name, so your config targetting eth0 is targetting a non existing device now, and the new device name (a stupid mqlkdafjqsdmlfksdj like name) now have no rules and so openrc trigger dhcp to get an ip.curmudgeon wrote: What can trigger this, and (more important) how can I keep this from EVER running again?

I did read that note (especially the part about configuring rules to keep eth0 :) ).krinn wrote:If it's that, it's because you didn't read the note, so the answer to "What can trigger this" must be "udev stupid names" & "you".
Well in this particular case it is probably handy to have it try dhcp. Not everyone reads the notes carefully. So if someone rebooted after the udev update they could still reach it remotely. Also it fires only when it gets a network device, so why not probe for a automatic adres?curmudgeon wrote:I did read that note (especially the part about configuring rules to keep eth0krinn wrote:If it's that, it's because you didn't read the note, so the answer to "What can trigger this" must be "udev stupid names" & "you".).
I am still (very much) interested in the idea of some way to completely disable any possibility of a dhcp client automatically running if something fails (that is a very bad idea in my opinion).
Code: Select all
config_eth0="192.168.0.2/24"
routes_eth0="default via 192.168.0.1"
dns_servers_eth0="192.168.0.1"
It blew up /etc/resolv.conf (without backing it up, which is doubly annoying). The DNS servers that udhcpc picked up were horrible (minimum fifteen seconds to return anything), and on top of that, I run dnsmasq (which any decent dhcp client would have incorporated into a modified resolv.conf, but udhcpc didn't).khayyam wrote:Anyhow, none of this should result in "horrible network performance" so the actual issue may be elsewhere.
curmudgeon ... none of which are directly related to the quote above. It "blows up" resolv.conf because dhcp clients do this *unless* they are told not to request DNS (using the "nodns" switch in dhcp_${IFACE}), the dns servers "picked up" are provided by whatever is serving dhcp on the network, and if you want resolv.conf to be handled by multiple sources, or be static, then you need to figure out why udhcpc is started in the first place. As I said, the issue seems to be elsewhere as having a static address defined should be sufficent for the interface to be brought up, and no dhcp client should be called. So, something else is no doubt causing udhcpc to be started, what I can't tell, as there is too little information to go on.curmudgeon wrote:It blew up /etc/resolv.conf (without backing it up, which is doubly annoying). The DNS servers that udhcpc picked up were horrible (minimum fifteen seconds to return anything), and on top of that, I run dnsmasq (which any decent dhcp client would have incorporated into a modified resolv.conf, but udhcpc didn't).khayyam wrote:Anyhow, none of this should result in "horrible network performance" so the actual issue may be elsewhere.
There are security implication to any number of things, but it is by understanding the cause behind an event that allows for its mitigation. So, sure, we can state "that shouldn't happen" but that is in the realm of the obvious, and provides no clue as to the why.curmudgeon wrote:Beyond that, there are security implications involved in running a dhcp client when one is not desired.
As I stated above with a staticly defined address it shouldn't, so you need to look for the root cause and/or provide some clue as to why it might. Generally, to get your question answered its best to present the question in a way in which others can help, your "question has not been answered yet" because, quite frankly, no one has any idea what might be at work here, all we have is two lines from your /etc/conf.d/net ... and lots of huffing and puffing.curmudgeon wrote:Since my question has not been answered yet, I will repeat it - how do I block udhcpc from ever running under any circumstances?

Well-behaved dhcp clients will back up the original, and restore it when shutting down.khayyam wrote:none of which are directly related to the quote above. It "blows up" resolv.conf because dhcp clients do this *unless* they are told not to request DNS (using the "nodns" switch in dhcp_${IFACE}),
In looking at the time stamp on the altered resolv.conf, it appears that it happened several cycles (boots) ago. I have never watched for that before, and it has not happened since (and I have been paying VERY close attention to it. The log files (/var/log/messages*) contain no information about it.khayyam wrote:the dns servers "picked up" are provided by whatever is serving dhcp on the network, and if you want resolv.conf to be handled by multiple sources, or be static, then you need to figure out why udhcpc is started in the first place.
This is why running a dhcp client on a machine that is NEVER supposed to use dhcp is so pernicious. If the machine finds a rogue dhcp server on the network, it is easy to end up with hijacked dns servers, and it doesn't take much imagination to see the types of problems that can cause.khayyam wrote:There are security implication to any number of things, but it is by understanding the cause behind an event that allows for its mitigation. So, sure, we can state "that shouldn't happen" but that is in the realm of the obvious, and provides no clue as to the why.
As I stated above, it has a static address, and should always use it. I want to protect against the "known unknown" of activating a dhcp client that should never be activated under any circumstances.khayyam wrote:As I stated above with a staticly defined address it shouldn't, so you need to look for the root cause and/or provide some clue as to why it might.curmudgeon wrote:Since my question has not been answered yet, I will repeat it - how do I block udhcpc from ever running under any circumstances?
I absolutely do not want ANOTHER dhcp client on the machine, and I don't want to EVER use ANY dhcp client.nix213 wrote:There's a net.example file in /usr/share/doc/openrc*/ that might be of help to you.
You could, for example, install net-misc/dhcp then add stuff like this to /etc/conf.d/net:
config_eth0="dhcp"
modules_eth0="dhcpd !udhcp"
dhcp_eth0="release nodns"
dns_servers_eth0="8.26.56.26 198.153.192.40"

Still wouldn't solve the problem of a rogue dhcp server setting a malicious router.Jaglover wrote:Well, you can set immutable flag on resolv.conf, but this is hardly an elegant soulution.
I use a static ip address, and I didn't think there was any dhcp client either.Jaglover wrote:I use static conf and there is no DHCP client in the system.
Code: Select all
echo 'INSTALL_MASK="${INSTALL_MASK} /usr/share/udhcpc"' >> /etc/portage/make.confkrinn ... udhcpc is a component of /bin/busybox, busybox doesn't install anything to /usr/share/udhcpc. Anyhow, the problem isn't with udhcpc, thats meerly the effect.krinn wrote:then how about justCode: Select all
echo 'INSTALL_MASK="${INSTALL_MASK} /usr/share/udhcpc"' >> /etc/portage/make.conf
Code: Select all
interface anonexistantname
nix213 wrote:There's a net.example file in /usr/share/doc/openrc*/ that might be of help to you.
You could, for example, install net-misc/dhcp then add stuff like this to /etc/conf.d/net:
config_eth0="dhcp"
modules_eth0="dhcpd !udhcp"
dhcp_eth0="release nodns"
dns_servers_eth0="8.26.56.26 198.153.192.40"
just a few ideas