Ubuntu 16.04 cannot connect to the Internet after plugging in the network cable (may also apply to 18.04)

Problem Description

Plug in the network cable and open the Firefox browser, it shows: The proxy server refuses to connect
Firefox browser shows

Solution 1

Firefox settings

Open the Firefox browser preferences
and scroll to the last network settings
and set it to not use a proxy server
insert image description here

Solution 2

Reference
System version: Ubuntu 16.04.2 LTS
Specific operation:

1. View the Ethernet through the command line ifconfig command

(that is, the name of the network cable socket), as shown in the figure below, 'enp3s0' is the network cable socket (Ethernet Ethernet):

enp3s0    Link encap:以太网  硬件地址 1c:69:7a:47:03:9f  
          inet 地址:10.111.9.247  广播:10.111.9.255  掩码:255.255.255.0
          inet6 地址: 2001:da8:204:10d9:e7a6:5ed0:3e90:1a3d/64 Scope:Global
          inet6 地址: 2001:da8:204:10d9:fc72:14cf:6212:5b92/64 Scope:Global
          inet6 地址: 2001:da8:204:10d9:73be:aca9:e29c:93d6/64 Scope:Global
          inet6 地址: fe80::6bf8:dcd4:743e:3a73/64 Scope:Link
          inet6 地址: 2001:da8:204:10d9:bc1c:2c69:469:2a82/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          接收数据包:59232 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:1529 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:8002488 (8.0 MB)  发送字节:145538 (145.5 KB)

lo        Link encap:本地环回  
          inet 地址:127.0.0.1  掩码:255.0.0.0
          inet6 地址: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  跃点数:1
          接收数据包:2630 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:2630 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:151380 (151.3 KB)  发送字节:151380 (151.3 KB)

wlp4s0    Link encap:以太网  硬件地址 9c:29:76:03:ff:93  
          inet 地址:10.62.37.212  广播:10.62.63.255  掩码:255.255.224.0
          inet6 地址: 2001:da8:204:2511:3b0:81f0:3ceb:b42e/128 Scope:Global
          inet6 地址: fe80::1e0:85c0:c0d5:b5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
          接收数据包:900 错误:0 丢弃:0 过载:0 帧数:0
          发送数据包:1023 错误:0 丢弃:0 过载:0 载波:0
          碰撞:0 发送队列长度:1000 
          接收字节:100761 (100.7 KB)  发送字节:108126 (108.1 KB)

2. Add or modify network parameters on the command line

sudo gedit /etc/network/interfaces

A text window pops up, as follows:

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

Add information about Ethernet in it

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

After adding, exiting the command window after saving
may prompt:

(gedit:6461): IBUS-WARNING **: The owner of /home/haha/.config/ibus/bus is not root!

** (gedit:6461): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-spell-enabled

** (gedit:6461): WARNING **: Set document metadata failed: 不支持设置属性 metadata::gedit-encoding

Do not care. , but I don’t know if I don’t need to worry about it, there is no problem at present.

3. Restart the network

sudo /etc/init.d/networking restart

Now you should be able to resume plugging in the network cable and be able to surf the Internet;

But if I can't get on the Internet, then I can't help it.

Notice:

After restoring the network cable to be able to access the Internet, disable the wifi and enable WIFI or enable WIF , otherwise it will automatically connect to the network again in a certain period of time, and then your Ethernet connection will be broken again . Restart the network )

4. There was another problem that the network could not be connected (20211020)

Debugged it according to the above method, but it still doesn't work.

4.1 Questions:

(1) An error occurred when displaying connection information, no legal active connection was found, and the problem was solved: Network management display: Unmanaged problem
(2) Ubuntu Ethernet gray (network connection gray problem) cannot connect.

4.2 Solutions:

(1) Solution to Problem 1

sudo gedit /etc/NetworkManager/NetworkManager.conf

(2) Problem (2) Solution
This is caused by network-manager and network interface,
terminal input

sudo gedit /etc/network/interfaces

keep only

auto lo 
iface lo inet loopback

Then restart the machine.
My problem is solved. Reference materials here:
Problem record: error when displaying connection information, no legal active connection found
Ask for advice ubuntu network connection gray, unavailable
insert image description here
Reference materials:
[1] Problem record: error when displaying connection information, no legal active connection found
[ 2] For advice, the ubuntu network connection is grayed out and unavailable
[3] Ubuntu’s wired Networks turns gray and cannot connect to the network
[4] Ubuntu uses a network cable to connect to the router and cannot access the Internet
. Note [4] There is a problem with the code here, it seems
wrong inte right inet
wrong

auto enp2s0
iface enp2s0 inte dhcp

correct

auto enp2s0
iface enp2s0 inet dhcp

[5] The solution to the problem that Ubuntu cannot connect to the network (the connection logo cannot be found in the upper right corner
[6] Ubuntu16.04 is connected to the network cable but cannot access the Internet

Guess you like

Origin blog.csdn.net/chen20170325/article/details/120733972