转至:https://www.cnblogs.com/kerrycode/p/13709537.html
如何使用命令查看网卡的MAC地址呢? 下面总结一下查看网卡MAC地址的方式。
1:ifconfig命令查看网卡MAC地址
/sbin/ifconfig | grep HWaddr
或
/sbin/ifconfig | grep ether
有些Linux发行版本的MAC地址字段为HWaddr,有些Linux发行版本的MAC地址字段为ether。根据实际情况选择上面命令。
[root@KerryDB ~]# ifconfig -a lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 858 bytes 72251 (70.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 858 bytes 72251 (70.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 p4p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.20.57.24 netmask 255.255.255.0 broadcast 10.20.57.255 inet6 fe80::b283:feff:fe55:32e5 prefixlen 64 scopeid 0x20<link> ether b0:83:fe:55:32:e5 txqueuelen 1000 (Ethernet) RX packets 6637181 bytes 1536293500 (1.4 GiB) RX errors 0 dropped 293652 overruns 0 frame 0 TX packets 4333535 bytes 1080300983 (1.0 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0