在Linux系统中,ifconfig命令用于配置、激活和查询网络接口
打开终端(Terminal)。
首先,使用以下命令查看所有可用的网络接口:
ifconfig -a
确定要启用的网络接口名称。它通常类似于eth0(有线连接)或wlan0(无线连接)。
使用以下命令启用网络接口:
sudo ifconfig <interface_name> up
将<interface_name>替换为实际的网络接口名称,例如:
sudo ifconfig eth0 up
ifconfig <interface_name>
请注意,ifconfig命令在某些Linux发行版中可能已被弃用,取而代之的是ip命令。在这种情况下,您可以使用以下命令启用网络接口:
ip link show
sudo ip link set <interface_name> up
将<interface_name>替换为实际的网络接口名称,例如:
sudo ip link set eth0 up