Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've noticed that my Ethernet port works fine once, but after it's disconnected and i connect to a wireless network and I go and try to plug the Ethernet port back in, it doesn't work until I reboot. Why is this?!

Also, the lights light up but it's like the Ubuntu doesn't see it. Is there a way to reboot the Ethernet port programmaticly through Terminal? I've also tried to delete and readd Auto Ethernet through the Network Preferences.

I have a Lenovo ThinkPad L512 with Ubuntu 10.04

==UPDATE==

I did the first step Maco said to do and here is what I got:

oscargodson@ubuntu:~$ sudo service network-manager stop
[sudo] password for oscargodson: 
network-manager stop/waiting
oscargodson@ubuntu:~$ sudo ifconfig eth0 up
SIOCSIFFLAGS: Cannot allocate memory
oscargodson@ubuntu:~$ sudo dhclient eth0
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

SIOCSIFFLAGS: Cannot allocate memory
SIOCSIFFLAGS: Cannot allocate memory
Listening on LPF/eth0/60:eb:69:02:50:f0
Sending on   LPF/eth0/60:eb:69:02:50:f0
Sending on   Socket/fallback
receive_packet failed on eth0: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17
send_packet: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
send_packet: Network is down
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

I've tried everything Maco suggested and finally figured out my memory isn't low although I keep getting a SIOCIFFLAGS: Cannot allocate memory error. I have over 1GB of RAM free as we speak.

I found this page: http://www.linuxquestions.org/questions/linux-newbie-8/weird-ethernet-problem-838220/

And did what the person there said which was:

lspci| grep -i ethernet
dmesg | grep -i ethernet

And it gave me some output and the last command gave me:

r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded

I then tried Maco's stuff again and i didn't get the error anymore, however, the Ethernet still doesn't connect although now it doesn't give me the memory allocation error.

share|improve this question
    
the dmesg | grep -i ethernet was just another way of doing what I looked in 70-persistent-net.rules -- both lspci & dmesg commands were rather exploratory –  maco Oct 20 '10 at 0:29
    
Any other ideas? :( –  Oscar Godson Oct 20 '10 at 8:27
    
Looks like i got it up and working again if i do those commands above then sudo service network-manager stop, then sudo ifconfig, then sudo dhclient, THEN sudo service network-manager start. How can i make it do this on start? –  Oscar Godson Oct 20 '10 at 16:31

2 Answers 2

up vote 3 down vote accepted

Sounds like bug. Lets dig in.

First, stop Network Manager: sudo service network-manager stop

Then, plug in the cable and bring up the interface sudo ifconfig eth0 up and tell it to ask for a new dhcp lease sudo dhclient eth0 (I'm guessing it's eth0, if not use the right name)

Did it work? If so, file a bug on Network Manager: ubuntu-bug -p network-manager

If not, try reloading the network driver. This should simulate a reboot to the ethernet port. To find out your driver, look in /etc/udev/rules.d/70-persistent-net.rules You'll see some bits like:

# PCI device 0x10ec:0x8136 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:f1:4c:01:94:3e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Finding the one that matches your interface's name, look at what's in the parentheses where mine says r8169. That's your module's name.

sudo modprobe -r r8169 && sudo modprobe r8169

(replacing r8169 with your module's name) Try the dhclient step again. If that worked, I suspect it's a kernel bug. ubuntu-bug -p linux

share|improve this answer
    
I did the first thing you had me do, and I got the above (i edited my original post). The 2nd one i dont have a /udev/ directory in /usr/? Whys this? –  Oscar Godson Oct 12 '10 at 16:36
    
Because I screwed up, sorry! I meant /etc/udev... –  maco Oct 13 '10 at 16:25
    
Maco, im getting the same result. After doing this (mine is also r8169) i ran sudo ifconfig eth0 up and it said the same as before "cannot allocate memory" then i did sudo dhclient eth0 and it gave me the output that i pasted above. Not sure if this helps but since this only happens when I go home, i suspect this only happens when i: use ethernet, unplug, use wifi, disconnect wifi, then plug in ethernet. Thanks so much! I really want this to work. It's a PITA to reboot every morning :) –  Oscar Godson Oct 15 '10 at 16:33
    
what's the output of free -m ? Are you actually out of memory? –  maco Oct 15 '10 at 19:06
    
Hmm, seems we might have found something: free -m output: pastebin.com/syX9jUx0 (think it's because it's 666? :P, but the first time I ran this I got only 32 free!) Here are all my running processes also: pastebin.com/DRVeMyht -- Any ideas? –  Oscar Godson Oct 18 '10 at 18:32

I'm getting the same problem. Wireless works on boot provided router is switched on beforehand. If its not then I have to go through the process of setting up a network again. Wired connection refuses to work at all with the ifconfig: SIOCSIFFLAGS: Cannot allocate memory coming up. N.B. This is using BrowserLinux (based on Puppy Linux)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.