My eth0 has gone and I don't have internet and network connection
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/
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 by sudo service network-manager stop
.
If it doesn't work, then try sudo service network-manager stop
.
Then sudo ifconfig eth0 up
to bring up the interface
Then, force Ubuntu to ask for a new DHCP lease by sudo dhclient eth0
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
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 followed the above steps :
1 - sudo service network-manager stop
2 - sudo ifconfig enp4s8 up
to bring up the interface
3 - Then, force Ubuntu to ask for a new DHCP lease by sudo dhclient enp4s8
4 - Manually did 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 files from live cd.
Todo - I need to have static ip address. Its not working , if i go back with old settings. still troubleshooting and not relevant to this post. Plz excuse.