linux配置网卡后,单独关掉网卡和重启网卡的命令是什么?

linux配置网卡后,单独关掉网卡和重启网卡的命令是什么?,第1张

第一种:

/etc/init.d/network stop 关闭

/etc/init.d/network restart 重启

第二种:

ifup eth* *代表网卡,第一块网卡为0 ifup eth0开启,ifdown eth0 关闭

第三种:

service network stop/start 关闭 or 启动

service network restart 重启

望采纳,lznmvp

ifconfig -a (不加-a参数,只能查启用的网卡)

例如:网卡名 eth0

启用网卡命名 ifconfig eth0 up

禁用网卡命名 ifconfig eth0 down

验证了 suse系统/redhat系统/ubuntu系统/Frdora系统/CentOS系统,均能使用。

https://linuxconfig.org/how-to-configure-static-ip-address-on-ubuntu-18-10-cosmic-cuttlefish-linux

service network restart

首先通过ifconfig -a命令查找当前网络下存在的网卡,一般为eth0、1、2...or wlan0、1、2、3...

由于你的无线网卡被关闭了,最直接的就是需要进行启动 *** 作;eth=本地网卡,既表示有线网卡类,wlan=无线局域网,既表示无线网卡类;

进行启动 *** 作,命令为:

sudo iwconfig wlanX(X代表网卡后缀,以实际情况为据) up

当然完整的执行顺序应该是以下方式:

进行网络设置

关闭无线网络:sudo iwconfig wlanX down

启动无线网络:sudo iwconfig wlanX up


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7681815.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-08
下一篇2023-04-08

发表评论

登录后才能评论

评论列表(0条)

    保存