ifconfig 是一个用于配置和显示 Linux 内核中网络接口的命令行实用程序。以下是一些常用的 ifconfig 命令参数及其含义:
ifconfig:不带任何参数运行 ifconfig 命令将显示所有活动网络接口的详细信息。
ifconfig interface:将 interface 替换为您要查看的网络接口名称(例如:eth0、wlan0 等)。这将显示指定网络接口的详细信息。
ifconfig interface up:将指定网络接口(例如:eth0)设置为启用状态。
ifconfig interface down:将指定网络接口(例如:eth0)设置为禁用状态。
ifconfig interface hw ether address:将指定网络接口(例如:eth0)的硬件(MAC)地址更改为指定的地址(例如:00:11:22:33:44:55)。
ifconfig interface mtu size:将指定网络接口(例如:eth0)的最大传输单元(MTU)设置为指定的大小(例如:1500)。
ifconfig interface netmask mask:将指定网络接口(例如:eth0)的子网掩码设置为指定的值(例如:255.255.255.0)。
ifconfig interface broadcast address:将指定网络接口(例如:eth0)的广播地址设置为指定的值(例如:192.168.1.255)。
ifconfig interface pointopoint address:将指定网络接口(例如:eth0)的点对点地址设置为指定的值(例如:192.168.1.1)。
请注意,ifconfig 命令在某些 Linux 发行版中可能已被弃用,建议使用 ip 命令替代。