通过命令行进行网卡的开关

Linux端

查看网卡

ifconfig

开启网卡

ifconfig [NIC_NAME] Up

例如:

ifconfig enp0s3 up

关闭网卡

ifconfig [NIC_NAME] Down

例如:

ifconfig enp0s3 down

Windows端

查看网卡

ipconfig /all

开启网卡

netsh interface set interface "NetworkAdapterName" enable

例如:

netsh interface set interface "NetworkAdapterName" enable

关闭网卡

netsh interface set interface enp0s3 disable

例如

netsh interface set interface enp0s3 disable

posted @ 2025-03-07 14:46  VictoryHan  阅读(48)  评论(0)    收藏  举报