debian

Debian ifconfig命令格式是什么

小樊
40
2025-11-08 09:00:55
栏目: 智能运维

ifconfig 命令在 Debian 系统中用于配置、激活和查询网络接口。其基本格式如下:

ifconfig [interface] [options]

其中:

以下是一些常用的 ifconfig 选项:

以下是一些使用 ifconfig 命令的示例:

  1. 显示所有活动网络接口的信息:
ifconfig

或者

ifconfig -a
  1. 激活名为 eth0 的网络接口:
ifconfig eth0 up
  1. 关闭名为 eth0 的网络接口:
ifconfig eth0 down
  1. 为名为 eth0 的网络接口分配 IP 地址 192.168.1.100 和子网掩码 255.255.255.0
ifconfig eth0 inet addr:192.168.1.100 netmask:255.255.255.0

请注意,ifconfig 命令在某些 Debian 版本中可能已被弃用,建议使用 ip 命令来替代。

0
看了该问题的人还看了