I have encountered a very weird error on ubuntu-server (8.04), I have no idea why dhclient is not allowed to set the network settings! I'm not the one who installed the server in the first place, so i don't know much about the setup. The server is only used as a firewall/gateway (custom iptables script) it's got three nic's one for internet, one for LAN and one for DMZ. Now the ISP have changed settings from static ip to "static" ip assigned through dhcp, and i cant really use it.
Sadly I can't just set the IP statically since the ISP closes my connection when the dhcp lease ends :o
This is the error i get: (and then it just hangs there..)
root@fw:~# dhclient eth2
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
Listening on LPF/eth2/00:50:52:c1:a1:32
Sending on LPF/eth2/00:50:52:c1:a1:32
Sending on Socket/fallback
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 8
DHCPOFFER of 2.10.56.19 from 93.87.36.42
DHCPREQUEST of 2.10.56.19 on eth2 to 255.255.255.255 port 67
DHCPACK of 2.10.56.19 from 93.87.36.42
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFNETMASK: Permission denied
SIOCSIFBRDADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCADDRT: Operation not permitted
for now i've fixed it by running killall dhclient; dhclient eth2
every hour and then setting static IP settings for the interface, this is enough to keep the connection live! but it's a pretty ugly hack in my opinion..
Based on the stack trace at http://silenzio.dk/pi/dhc.strace the first
SIOCSIFADDR: Permission denied
error occurs at line 735, during execution of process 26092:ifconfig eth2 inet 0 up
. Now onlyroot
canifconfig
something up, so let's trace the chain offork()
/exec()
and look for UID changes. It turns out that:So, the errors occur because the executing child process does not have the necessary root privileges. Why does this happen? The
debian/changelog
file in thedhcp3-3.0.6.dfsg
sources says:My guess is that
call-dhclient-script
has lost its set-UID bit, and is thus not executing with root privileges as it should. (According to thedebian/dhcp3-client.postinst
file in the sources, it should be owned byroot:dhcp
and mode4754
)What does your "dmesg" output show when you run dhclient?
If you're running Hardy, AppArmor is part of the default install. It's possible that the dhclient profile has gone haywire. Check "sudo aa-status" to see what is happening there.
Additionally how does your /etc/network/interfaces file read? Perhaps you have conflicting addresses, routes, etc that dhclient doesn't want to play with?
I would try installing nscd if that package is missing, and if it does not work with this, install also libnss-db.
Not sure if that will solve your problem, however, those are the things that your trace is trying to find and it fails.
Please run
sudo dpkg --configure -a
just to make sure it's not a repetition of the situation in https://bugs.launchpad.net/ubuntu/+source/dhcp3/+bug/19740/comments/67This is actually a bug in Ubuntu 8.04. For several use cases you NEED to have nscd installed (e.g. when using openvpn) or dhclient won't work. This doesn't happen in newer Ubuntu releases.