温馨提示×

debian ifconfig怎样开启

小樊
50
2026-09-12 11:20:32
栏目: 智能运维

在 Debian 中,ifconfig 属于 net-tools 工具包。默认较新版本的 Debian 可能没有安装,所以你直接输入 ifconfig 会提示命令找不到。

一、安装 ifconfig(开启使用)

sudo apt update
sudo apt install net-tools

安装完成后,就可以直接使用:

ifconfig

二、如果你是想“开启网卡”

如果你说的“开启”是指启用某个网络接口,可以用:

sudo ifconfig eth0 up

(把 eth0 换成你的网卡名,比如 ens33)

或者用更推荐的 ip 命令:

sudo ip link set eth0 up

三、查看网卡名称

ip addr

或

ls /sys/class/net

四、补充说明(推荐)

Debian 官方已逐步弃用 ifconfig,建议使用:

ip addr
ip link

功能更全、更稳定。

如果你是想开机自动开启网卡或配置静态 IP,也可以告诉我你的 Debian 版本,我可以给你具体配置方法。

0 踩