在 Linux 中,使用 ifconfig 激活(启用)网卡的基本命令如下:
ifconfig eth0 up
或者使用 ip 命令(更推荐):
ip link set eth0 up
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
ifconfig
或
ip addr
sudoifconfig,可用:sudo apt install net-tools # Debian/Ubuntu
sudo yum install net-tools # CentOS/RHEL
ip 命令或 nmcli(NetworkManager)如果你说的是“网卡被 disable 了如何启用”,也可以告诉我具体系统(CentOS / Ubuntu / 麒麟等),我可以给更精确的命令。