Tuesday, May 14, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 17201  / 2 Years ago, sat, october 15, 2022, 7:03:02

After running apt-get upgrade and restarting an Ubuntu Server install I noticed the computer didn't have a network connection.



I checked ifconfig



~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:7376 errors:0 dropped:0 overruns:0 frame:0
TX packets:7376 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1424 (1.4 KB) TX bytes:1424 (1.4 KB)


The interface 'em1' was missing :/



So I tried ifconfig em1 up which brought the interface up and then dhclient em1 to get an IP address, but I ran into this error:



~$ dhclient em1
dhclient: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Permission denied
~$ dhclient
dhclient: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Permission denied


Does anyone have any idea what could be wrong? A number of people seemed to have issues with SELinux blocking dhclient, but even with setenforce 0 I get this issue.



I've used dhclient to manually bring up an interface on this computer before so I'm not sure what suddenly changed (and what changed to stop the interfacing auto-setting up on startup).



EDIT: The network adapter is fine and everything works when the ip/route/nameservers are set manually



Reinstalling isc-dhcp-client and isc-dhcp-common didn't help, nor did reinstalling libc6



EDIT2: I tried gertvdijk's suggestions. My /etc/network/interfaces is:



auto lo  
iface lo inet loopback

allow-hotplug em1
iface em1 inet dhcp


I tried sudo ifup em1 but I get the same error :(



~$ sudo ifup em1
dhclient: error while loading shared libraries: libc.so.6: failed to map segment from shared object: Permission denied
Failed to bring up em1.

More From » boot

 Answers
1

Turns out the problem was AppArmour related; apparmor_status showed that a profile sbin.dhclient had been loaded, so running:



~$ sudo ln -s /etc/apparmor.d/sbin.dhclient /etc/apparmor.d/disable/  
~$ sudo /etc/init.d/apparmor reload


Solved the problem. I could then bring up the interface as gertvdijk suggested



(No idea why/when that profile appeared - I suspect it might have something to do with the upgrade I ran just before)


[#30652] Sunday, October 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hentor

Total Points: 482
Total Questions: 104
Total Answers: 111

Location: South Korea
Member since Sun, Dec 25, 2022
1 Year ago
;