在 Debian 系统中,ifconfig 是一个用于查看和配置网络接口的命令(来源于 net-tools 工具包)。
eth0 / ens33:有线网卡lo:回环接口(127.0.0.1)wlan0:无线网卡ifconfig # 查看所有启用的网络接口
ifconfig -a # 查看所有接口(包括未启用的)
ifconfig eth0 # 查看指定网卡
配置示例:
sudo ifconfig eth0 192.168.1.100 netmask 255.255.255.0
sudo ifconfig eth0 up
sudo ifconfig eth0 down
⚠️ ifconfig 已逐渐被弃用
ip 命令(来自 iproute2)等价替代:
ip addr # 替代 ifconfig
ip link # 替代 ifconfig -a
ip link set eth0 up
安装:
sudo apt update
sudo apt install net-tools
ifconfig:老式网络配置命令ip如果你愿意,我可以帮你对比 ifconfig vs ip 的对照表,或者看你当前 Debian 版本该怎么查 IP。