Solution to ubuntu unable to surf the Internet after plugging in the network cable

Preface#

I don’t know what’s going on recently. The ubuntu connection cable is always unavailable to the Internet, but the wifi is still available, so I haven’t fiddled with it, but today I can’t even use the wifi, so I can only start repairing it.

Repair plan#

ifconfig

enp2s0    Link encap:Ethernet hardware address 1c:39:47:d9:21:40  
   inet address:192.168.10.7 Broadcast:192.168.10.255 mask:255.255.255.0
   inet6 address: fe80::f9fd:aae3:56b1:811/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500 hops:1
   Receive packet:700 error:0 discarded:0 overload:0 frames:0
   Send packet:743 error:0 discarded:0 overload:0 carrier:0
   collision:0 Send queue length:1000 
   Receive byte:113101(113.1 KB)Send byte:61412(61.4 KB)

lo        Link encap:Local loopback
   inet address:127.0.0.1 mask:255.0.0.0
   inet6 address:::1/128 Scope:Host
   UP LOOPBACK RUNNING  MTU:65536 hops:1
   Receive packet:5301 error:0 discarded:0 overload:0 frames:0
   Send packet:5301 error:0 discarded:0 overload:0 carrier:0
   collision:0 Send queue length:1000 
   Receive byte:387565(387.5 KB)Send byte:387565(387.5 KB)

wlp3s0    Link encap:Ethernet hardware address b8:81:98:c9:5c:d4  
   inet address:192.168.1.173 Broadcast:192.168.1.255 mask:255.255.255.0
   inet6 address: fe80::d069:9062:bb59:e37c/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500 hops:1
   Receive packet:1236 error:0 discarded:0 overload:0 frames:0
   Send packet:2767 error:0 discarded:0 overload:0 carrier:0
   collision:0 Send queue length:1000 
   Receive byte:71967(71.9 KB)Send byte:281053(281.0 KB)

The first enp2s0 is the name of my Ethernet, record it for future use.

sudo vi /etc/network/interfaces

The content here should look like this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopbac

Manually add the following at the end:

auto enp2s0
iface enp2s0 inte dhcp
sudo service network-manager restart

If it doesn't work, try to disable wifi, generally speaking, it will be solved.

Conclusion#

Want to know more professional knowledge, forward-looking information, technical articles? Then please my personal official account: Attack program dog, make progress together!

Recommended Posts

Solution to ubuntu unable to surf the Internet after plugging in the network cable
Solution for Ubuntu unable to connect to the network
Solution to the problem that ubuntu cannot connect to the Internet in the virtual machine
Solution to the virtual machine ubuntu16.04 cannot connect to the Internet
Solution to the slow speed of ubuntu18.04 wireless network
Explain the solution to the Ubuntu 16.04 launcher icon exception
The solution to the failure to install .deb under Ubuntu 16.04
How to open the ubuntu system in win10
Introduction to the use of Hanlp in ubuntu
Solution to pycharm unable to import classes under Ubuntu
How to view detailed network routing table in Ubuntu
How to control the ubuntu system in win10 through ssh
Mac uses vnc to remotely log in to the ubuntu16.04 desktop
Detailed steps to automatically set the line number in ubuntu16.04
Explain the solution to the freeze when ubuntu dual system starts
Detailed steps to install MySQL to change the default password in Ubuntu
ubuntu14.04 sets the desktop to display network speed, cpu information, etc.