como mostrar apenas o endereço mac no virtualbox

0

Estou tentando conhecer uma maneira de mostrar apenas o endereço MAC de cada NIC que tenho em qualquer máquina virtual em execução:

Até agora eu tenho isso:

ipcopv2
-----------------------------------------------
Groups:          /Infraestructura
State:           powered off (since 2018-03-16T13:30:56.389000000)
NIC 1:           MAC: 080027D40320, Attachment: Bridged Interface 'eth1.15', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2:           MAC: 080027660656, Attachment: Bridged Interface 'eth1', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           MAC: 0800270D3D9E, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
Capture screens:    0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Eu quero ter isso:

ipcopv2
-----------------------------------------------
Groups:          /Infraestructura
State:           powered off (since 2018-03-16T13:30:56.389000000)
NIC 1:           MAC: 080027D40320, Attachment: Bridged Interface 'eth1.15', Cable connected: on
NIC 2:           MAC: 080027660656, Attachment: Bridged Interface 'eth1', Cable connected: on
NIC 3:           MAC: 0800270D3D9E, Attachment: Bridged Interface 'eth0', Cable connected: on
Capture screens:    0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Como conseguir isso? Eu quero entender como ler a informação e só mostrar essa parte usando o bash.

    
por maniat1k 27.03.2018 / 22:06

1 resposta

2

Isso parece fazer o truque:

$ ip link | awk '/link/ { print $2 }'
00:00:00:00:00:00
00:20:78:1c:xx:yy
00:1d:92:67:xx:yy
    
por 27.03.2018 / 22:48