如何在命令行中重启有线网络?
Tofloor
poster avatar
wenlin
deepin
2017-01-06 00:16
Author
ifconfig xxx down / ifconfig xxx up;service network restart可以重启网卡,但如果控制中心中没启用的话也不起作用。
如何直接在命令行中操纵控制中心?
Reply Favorite View the author
All Replies
avatar
jingle
deepin
2017-01-06 05:27
#1
这个我反馈上去看下。
Reply View the author
avatar
A·S·M·X·T 😏😜
deepin
2017-01-06 05:35
#2
ip link set xxx down / up可以不?
Reply View the author
avatar
MeowSprite
deepin
2017-01-06 17:41
#3
ifconfig是直接操作网卡了,比较底层了。而控制中心使用的是networkmanager来管理网络的。
想重启网络比较简单的方式:
1. 直接重启networkmanager服务
  1. sudo service network-manager restart
Copy the Code

2. 通过nmcli来控制networkmanager,其实就是相当于命令行操作控制中心,这个命令不需要sudo
  1. nmcli n off
  2. nmcli n on
Copy the Code

上面是直接开启关闭整体网络,也可以通过指定网络连接来连接或断开,比如你就想断开有线网络。
  1. nmcli c show
  2. nmcli c down [网络名称]
  3. nmcli c up [网络名称]
Copy the Code

网络名称比如有线网应该是有线连接啊之类的,通过第一条命令可以查看到。
Reply View the author
avatar
wenlin
deepin
2017-01-09 20:52
#4
谢谢
Reply View the author
avatar
lengfeng910
deepin
2021-05-11 05:42
#5

控制中心禁用了有线网卡,上面的命令就都没用了,那么又该使用哪个命令来“启用网络”呢?

Reply View the author