# 使用 ifconfig 命令查看 MAC 地址
ifconfig
# 或者使用 ip 命令查看 MAC 地址
ip link show
ifconfig 命令:这是传统的网络配置工具,可以显示所有网络接口的详细信息,包括 MAC 地址。MAC 地址通常在输出中的 HWaddr 或 ether 字段中显示。
ip link show 命令:这是较新的网络配置工具,推荐在现代 Linux 系统中使用。它同样可以显示所有网络接口的信息,MAC 地址会在 link/ether 字段中显示。
如果你在终端中运行上述命令之一,你将能够看到类似如下的输出:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:feb9:2a9e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:b9:2a:9e txqueuelen 1000 (Ethernet)
RX packets 123456 bytes 78901234 (75.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 654321 bytes 43210987 (41.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
在这个例子中,ether 00:0c:29:b9:2a:9e 就是 eth0 接口的 MAC 地址。
上一篇:linux解压缩命令 rar
下一篇:linux防火墙放行端口命令
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站