1、virsh dumpxml win7 | grep mac   #查看win7虚拟机mac

2、arp -a   #显示mac与ip对应关系


示例:

[root@localhost ~]# virsh dumpxml ubuntu-yusen | grep mac
    <partition>/machine</partition>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
      <mac address='52:54:00:11:c5:4e'/>
[root@localhost ~]# ping 192.168.0.19
PING 192.168.0.19 (192.168.0.19) 56(84) bytes of data.
64 bytes from 192.168.0.19: icmp_seq=1 ttl=64 time=0.216 ms
64 bytes from 192.168.0.19: icmp_seq=2 ttl=64 time=0.150 ms
^C
--- 192.168.0.19 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.150/0.183/0.216/0.033 ms
[root@localhost ~]# arp -a | grep 52:54:00:11:c5:4e
? (192.168.0.19) at 52:54:00:11:c5:4e [ether] on br0
[root@localhost ~]#

说明:

1、ubuntu-yusen是虚拟机名称;

2、arp -a | grep 52:54:00:11:c5:4e 是找mac对应的ip。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐