ubuntu

Ubuntu ifconfig命令格式是什么

小樊
40
2025-05-28 16:28:49
栏目: 智能运维

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

ifconfig [interface] [options]

其中:

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

  1. 显示所有活动网络接口的信息:
ifconfig
  1. 显示特定网络接口的信息(例如 eth0):
ifconfig eth0
  1. 激活名为 eth0 的网络接口:
ifconfig eth0 up
  1. 关闭名为 eth0 的网络接口:
ifconfig eth0 down
  1. 为名为 eth0 的网络接口分配 IP 地址 192.168.1.100
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up

请注意,ifconfig 命令在某些现代 Linux 发行版中已被弃用,推荐使用 ip 命令来替代。

0
看了该问题的人还看了