28

I had internet connection, but when I upgraded my VGA and restarted my PC then everything for eth0 has gone.

When I used ifdown:

 ifdown: interface eth0 not configured

Is there something I could do?

EDIT:
Content of /etc/network/interfaces

auto lo
iface lo inet loopback

When I ifconfig I don't have these lines:

inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0
inet6 addr: fe80::219:5bff:fe5e:a5e/64 Scope:Link

In the Terminal typed:

sudo gedit /etc/network/interfaces

and then added these lines in the bottom:

auto eth0
iface eth0 inet dhcp

then I typed:

sudo ifdown eth0
sudo ifup eth0

when I send the second command I received the below message:

No DHCPOFFERS received
No working leases in persistent database - sleeping

Any help?

1
  • What is the contents of the /etc/network/interfaces file?
    – jobin
    Dec 22, 2013 at 7:26

3 Answers 3

17
+50

Try:

sudo dpkg-reconfigure network-manager 

If that doesn't work boot from a live CD, back up your old network settings, clear out any system connection file and copy over the ones from the live CD.

Change to Root:

sudo su

backup:

mv /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf.broken

clear:

rm /media/<Name of your Ubuntu Partion>/etc/NetworkManager/system-connections/*

copy:

cp /etc/NetworkManager/NetworkManager.conf /media/<Name of your Ubuntu Partion>/etc/NetworkManager/NetworkManager.conf
cp /etc/NetworkManager/system-connections/* /media/<Name of your Ubuntu Partion>/etc/NetworkManager/system-connections/
8
  • Output message: Processing triggers for libc-bin === ldconfig deferred processing now tracking place I then restarted my network-manager, but nothing again.
    – Alireza
    Dec 24, 2013 at 7:59
  • @phpGeek I figured it wouldn't be that easy. Do you happen to have wicd already installed?
    – virtualxtc
    Dec 24, 2013 at 8:13
  • I don't have it. Is it important to have?
    – Alireza
    Dec 24, 2013 at 8:24
  • @phpGeek no, but you've pretty much exhausted the extent of my knowledge. Do you have a live CD you can boot from to get internet on that machine? We could just copy the network/interfaces files over from there...
    – virtualxtc
    Dec 24, 2013 at 13:12
  • Internet works on live CD! What command should I use to copy files in my system?
    – Alireza
    Dec 24, 2013 at 13:24
14

Can you try to edit /etc/network/interfaces and put it the default settings for DHCP below?

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Try to restart the networking service with:

sudo service network-manager stop

If it doesn't work, then try:

sudo service network-manager stop

Then the following command to bring up the interface:

sudo ifconfig eth0 up

Then, force Ubuntu to ask for a new DHCP lease with:

sudo dhclient eth0
7
  • I changed interfaces content to what you said. Double checked it. then restarted network-manager the message was: network-manager start/running, process 3025 nothing happened. I still don't have connection. when I type sudo dhclient eth0 in terminal it waits forever.
    – Alireza
    Dec 24, 2013 at 7:06
  • It might be hanging because it cannot get any IP address to lease? Try to identify which has the issue. Check your router first, maybe it only supports a maximum number of connected devices or the port you are connecting to is either not working or is blocked. Better if you try another laptop or pc to connect to the same port on the router just to know if it's not a router issue.
    – Chester
    Dec 24, 2013 at 7:15
  • I have one network cable. I plug it in into my laptop and everything works fine(Obtain an IP address automatically mode). When I plug the same cable into my desktop system it doesn't work. I didn't have problem on desktop system until I installed VGA driver and upgraded my ubuntu and some other pachages.
    – Alireza
    Dec 24, 2013 at 7:24
  • Try disabling dns mask? gksu gedit /etc/NetworkManager/NetworkManager.conf then comment out the line dns=dnsmasq by adding # before it.
    – Chester
    Dec 24, 2013 at 7:31
  • gksu is not installed by default. It says to install it with apt-get. I don't have Internet connection to install it, but I used sudo gedit if it's no problem and masked it and then restarted network-manager. nothing happened!
    – Alireza
    Dec 24, 2013 at 7:42
8

Thanks . It worked for me.

  1. I had the IP address but no internet connection
  2. The LAN port was active
  3. I had assigned static IP address

My /etc/network/interfaces had the following content:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

iface enp4s8 inet static
address 192.168.2.251
netmask 255.255.255.0
network 192.168.2.0

I was having ifconfig output as (this is manual edit - it was somewhat like this)

~$ ifconfig
enp4s8    Link encap:Ethernet  HWaddr 00:19:d1:73:b7:11  
          inet addr:192.168.2.251  Bcast:192.168.2.251  Mask:255.255.255.0
          inet6 addr: fe80::219:d1ff:fe73:b711/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13181 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8462 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:16690503 (16.6 MB)  TX bytes:884958 (884.9 KB)

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:317 errors:0 dropped:0 overruns:0 frame:0
          TX packets:317 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:40111 (40.1 KB)  TX bytes:40111 (40.1 KB)

I changed the /etc/network/interfaces to:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp4s8
#iface enp4s8 inet dhcp


#iface enp4s8 inet static
#address 192.168.2.251
#netmask 255.255.255.0
#network 192.168.2.0
#broadcast 192.168.2.255
#gateway 192.168.2.1
#dns-nameservers 192.168.2.1

Then I followed the steps included in the answer above:

sudo service network-manager stop
sudo ifconfig enp4s8 up
sudo dhclient enp4s8
sudo service network-manager start

This is when I got the connection to the network, these steps worked.

FYI - The Live CD also had internet connection. I did not copy the files from Live CD.

1
  • Upgraded from Ubuntu 16.04 to 18.04 and was facing this problem. Finally found a working solution just when I was about to downgrade to 16.04 again. You must post this answer in 'network connection problem after upgrade to Ubuntu 18' question. Aug 10, 2019 at 7:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .