【求助】16.04升级到18.04有线网卡不识别

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
qiaowb
帖子: 1
注册时间: 2018-04-19 9:24

【求助】16.04升级到18.04有线网卡不识别

#1

帖子 qiaowb » 2018-04-19 9:29

16.04升级到18.04有线网卡不识别,现象:
1、插上网线网卡的灯不亮;
2、ifconfig只有lo;
3、网络连接处显示的是设备未托管;

求大神帮解决,谢谢。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 【求助】16.04升级到18.04有线网卡不识别

#2

帖子 poloshiao » 2018-04-19 10:04

1. Ubuntu 16.04 網卡界面 預設是由
/etc/network/interfaces
network-manager
兩者設定/啟動/管理

2. Ubuntu 18.04 網卡界面 預設是由
netplan
指定
systemd-networkd
network-manager
兩者設定/啟動/管理
2-1. /etc/network/interfaces 有關的指令 已經不適用
2-2. 凡非
systemd-networkd
network-manager
設定範圍的網卡界面 均不生效

3. 詳細參閱
3-1. 建議 先從這一篇閱讀入門
https://help.ubuntu.com/community/Netwo ... orkManager
3-1-2. 熟悉 nmcli 指令用法
https://help.ubuntu.com/community/Netwo ... mmand_line
Using NetworkManager on the command line
3-2. Ubuntu 18.04 入門
https://wiki.ubuntu.com/BionicBeaver/Re ... figuration
3-3. 進一步參閱
https://netplan.io/
头像
Archer123
帖子: 146
注册时间: 2008-05-18 10:16

Re: 【求助】16.04升级到18.04有线网卡不识别

#3

帖子 Archer123 » 2018-04-28 13:34

poloshiao 写了:1. Ubuntu 16.04 網卡界面 預設是由
/etc/network/interfaces
network-manager
兩者設定/啟動/管理

2. Ubuntu 18.04 網卡界面 預設是由
netplan
指定
systemd-networkd
network-manager
兩者設定/啟動/管理
2-1. /etc/network/interfaces 有關的指令 已經不適用
2-2. 凡非
systemd-networkd
network-manager
設定範圍的網卡界面 均不生效

3. 詳細參閱
3-1. 建議 先從這一篇閱讀入門
https://help.ubuntu.com/community/Netwo ... orkManager
3-1-2. 熟悉 nmcli 指令用法
https://help.ubuntu.com/community/Netwo ... mmand_line
Using NetworkManager on the command line
3-2. Ubuntu 18.04 入門
https://wiki.ubuntu.com/BionicBeaver/Re ... figuration
3-3. 進一步參閱
https://netplan.io/



楼上两位好 ,我也在折腾ubuntu18.04 的桌面版的 wifi设置 ,已经确认 ubuntu16.04我升级后,的以前用的/etc/network/interface 这套配置已经不行了.

我目前已经重装ubuntu18.04 楼主可以参考这篇弄wifi
https://websiteforstudents.com/configur ... 8-04-beta/

可能要科学上网 我直接贴上内容

CONFIGURE STATIC IP ADDRESSES ON UBUNTU 18.04 LTS SERVER
!robot | 01/02/2018 | Labs, Linux Ubuntu | 1 Comment
I have just started testing Ubuntu 18.04 . The first thing I noticed was how different it handles network interfaces. The way Ubuntu manages network interfaces has completely changed.

Have you heard of NetPlan? Probably not, if you have, then you’re a step ahead of many. NetPlan is a new network configuration tool introduced in Ubuntu 17.10 to manage network settings.

It can be used write simple YAML description of the required network interfaces with what they should be configured to do; and it will generate the required configuration for a chosen renderer tool.

This new tool replaces the static interfaces (/etc/network/interfaces) file that had previously been used to configure Ubuntu network interfaces. Now you must use /etc/netplan/*.yaml to configure Ubuntu interfaces.

The new interfaces configuration file now lives in the /etc/netplan directory. There are two renderers. NetworkManager and networkd.

NetworkManager renderer is mostly used on desktop computers and networkd on servers. If you want NetworkManager to control the network interfaces, use NetworkManager as the renderer, otherwise use networkd.

When you use NetworkManager as the renderer, you will use the NetworkManager GUI to manage the interfaces.

Below is a sample file for a network interface using networkd as renderer using DHCP. Networkd uses the command line to configure the network interfaces.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: yes
dhcp6: yes
To save your changes, you run the commands below.

sudo netplan apply

CONFIGURING STATIC IP ADDRESSES WITH NETWORKD
To configure a static IP address using the new NetPlan tool, the file should look like this: IPv4 address (192.168.1.2), Gateway (192.168.1.1), DNS Servers (8.8.8.8,8.8.4.4)

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.1.2/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
Exit and save your changes by running the commands below

sudo netplan apply

You can add IPv6 addresses line, separated by a comma.. example below.

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.1.2/24, '2001:1::2/64']
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
Save your changes, apply and you’re done.

This is how to set static IP addresses on Ubuntu 18.04 .

For more about NetPlay, visit this site.

CONFIGURE NETWORK INTERFACES WITH NETWORKMANAGER
NetworkManager sample configuration file.

# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
Next, open the network interfaces GUI on Ubuntu to manage the network.

Congratulations! You’ve just successfully configured static IP addresses on Ubuntu servers.

Enjoy!~
头像
Archer123
帖子: 146
注册时间: 2008-05-18 10:16

Re: 【求助】16.04升级到18.04有线网卡不识别

#4

帖子 Archer123 » 2018-04-28 13:40

另外 我先看到了 这个


https://www.scivision.co/ubuntu-wifi-on-but-no-connect/


NetworkManager WiFi Power Saving
NetworkManager supports WiFi powersaving but the function is rather undocumented.
From the source code: wifi.powersave can have the following value:
NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
NM_SETTING_WIRELESS_POWERSAVE_ENABLE (3): enable powersave
Then I propose 2 files, only one of them needs to be put under /etc/NetworkManager/conf.d/.
One is forcing to disable powersaving, while the other one enable it.
Once you have put the file in the right folder, simply restart NetworkManager:
sudo systemctl restart NetworkManager


看意思还是和以前一样 控制自动休眠或省电设置wifi的 以前的配置参考我以前弄的ubuntu16.04 rtl8723be viewtopic.php?f=116&t=462588

那目前呢ubuntu18.04 这个配置的修改就是 移动到了 /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
我看了我的默认 默认是写的3 我参考这个改为了2

sudo gedit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
wifi.powersave = 2

然后 不用reboot 可以直接 sudo systemctl restart NetworkManager


但是这样之后 右上角的wifi 连接 选择一个 以前可连的wifi 也可以设置连接密码 但是连接点了后 就是转 然后提示你未连接.
头像
Archer123
帖子: 146
注册时间: 2008-05-18 10:16

Re: 【求助】16.04升级到18.04有线网卡不识别

#5

帖子 Archer123 » 2018-04-28 13:50

http://manpages.ubuntu.com/manpages/art ... lan.5.html

这下边 有参考配置 你参考着编辑


我目前 可以在右上角的 图形化的 有限设置中 设置有线固定ip 设置完成后

查了下 默认的设置内容:

cmd@TR:/etc/netplan$ cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no



发现 最终的固定ip 配置写到了此处
cmd@TR:/etc/NetworkManager/system-connections$ ls -al
总用量 20
drwxr-xr-x 2 root root 4096 4月 28 13:18 .
drwxr-xr-x 7 root root 4096 4月 27 02:24 ..
-rw------- 1 root root 316 4月 27 13:52 zwc
-rw------- 1 root root 343 4月 28 13:18 zwc-guest
-rw------- 1 root root 403 4月 28 13:17 '有线连接 1'

cmd@TR:/etc/NetworkManager/system-connections$ sudo cat '有线连接 1'
内容我就不贴了



这里的配置 是开启的 NetworkManage 与文章 https://websiteforstudents.com/configur ... 8-04-beta/ 描述一致
cmd@TR:/etc/netplan$ ls -al
总用量 20
drwxr-xr-x 2 root root 4096 4月 27 02:33 .
drwxr-xr-x 140 root root 12288 4月 28 12:59 ..
-rw-r--r-- 1 root root 104 4月 27 02:33 01-network-manager-all.yaml
cmd@TR:/etc/netplan$ cat 01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManage
回复