리눅스 MAC주소 확인

gathering mac address of ethernet devices in linux
리눅스 이더넷 맥 주소 확인
리눅스 MAC 주소 확인

1 방법 1: ifconfig[ | ]

[root@zetawiki ~]# ifconfig -a | grep ^eth 
eth0      Link encap:Ethernet  HWaddr 71:23:45:0B:3D:90  
eth1      Link encap:Ethernet  HWaddr 71:23:45:0B:3D:91  
eth2      Link encap:Ethernet  HWaddr 71:23:45:0B:3D:92  
eth3      Link encap:Ethernet  HWaddr 71:23:45:0B:3D:93  
eth4      Link encap:Ethernet  HWaddr DE:F0:64:30:F1:28  
eth5      Link encap:Ethernet  HWaddr DE:F0:64:30:F1:2C  
eth6      Link encap:Ethernet  HWaddr DE:F0:64:30:F1:28  
eth7      Link encap:Ethernet  HWaddr DE:F0:64:30:72:5C  
eth8      Link encap:Ethernet  HWaddr 00:44:55:E7:D0:74  
eth9      Link encap:Ethernet  HWaddr 00:44:55:E7:D0:74  
eth10     Link encap:Ethernet  HWaddr 00:44:55:E7:D0:74  
eth11     Link encap:Ethernet  HWaddr 00:44:55:E7:D0:74

2 방법 2: ip[ | ]

[root@zetawiki ~]# ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:13:5e:7a:cf:92 brd ff:ff:ff:ff:ff:ff
→ ifconfig와는 달리 소문자로 나온다.

3 맥주소만 뽑기[ | ]

3.1 ifconfig 명령[ | ]

[root@zetawiki ~]# ifconfig -a | grep ^eth | awk '{print $5}'
71:23:B5:0B:3D:90
71:23:B5:0B:3D:91
71:23:B5:0B:3D:92
71:23:B5:0B:3D:93
DE:F0:64:30:F1:28
DE:F0:64:30:F1:2C
DE:F0:64:30:F1:28
DE:F0:64:30:72:5C
00:44:55:E7:D0:74
00:44:55:E7:D0:74
00:44:55:E7:D0:74
00:44:55:E7:D0:74

3.2 ip 명령[ | ]

[root@zetawiki ~]# ip link show | grep link | awk '{print $2}'
71:23:B5:0B:3D:90
71:23:B5:0B:3D:91
71:23:B5:0B:3D:92
71:23:B5:0B:3D:93
DE:F0:64:30:F1:28
DE:F0:64:30:F1:2C
DE:F0:64:30:F1:28
DE:F0:64:30:72:5C
00:44:55:E7:D0:74
00:44:55:E7:D0:74
00:44:55:E7:D0:74
00:44:55:E7:D0:74

4 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}