查看网卡的完整网络状态
用 ipconfig getsummary 一次性列出某网卡的 IP、路由器、DHCP 租约和 DNS 等全部信息。
运行 `ipconfig getsummary en0 | head -30` 可快速浏览该网卡的地址、路由器和租约信息。
01命令
命令
$ ipconfig getsummary en0 | head -3002作用说明
`ipconfig getifaddr en0` 只给 IP,而 getsummary 会把 DHCP 客户端掌握的全部信息倒出来:分配的地址、路由器、租约时间、DNS——怀疑租约出问题时特别有用。无线网卡还能看到 SSID 和信道。完整输出很长,建议配合 `head` 或 `grep` 使用。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- ipconfig — view and control IP configuration (macOS man page)依据: Documents `ipconfig getsummary <interface>` which dumps the full DHCP/PPP state for the interface including addresses, router and lease information.
最后验证: 2026-09-18 · 分类: 网络