如何在宿主机上查看kvm虚拟机的IP

1.显示当前mac跟网关、ip地址

[root@localhost ~]# arp -a
? (172.17.0.2) at 02:42:ac:11:00:02 [ether] on docker0
? (192.168.25.1) at 00:50:56:c0:00:08 [ether] on ens33
? (192.168.25.131) at <incomplete> on ens33
gateway (192.168.25.2) at 00:50:56:ea:00:62 [ether] on ens33

2.输出需要查看IP虚拟机的mac配置:

[root@localhost ~]# virsh dumpxml centos7.0 | grep mac                     #dumpxml(demo)直接显示demo的xml文件配置
<partition>/machine</partition>
<type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
<mac address='52:54:00:7b:c8:0b'/>

 3.通过mac查看IP                       

[root@localhost ~]# arp -a | grep 52:54:00:52:68:c7
? (192.168.10.79) at 52:54:00:52:68:c7 [ether] on em2

猜你喜欢

转载自www.cnblogs.com/byfboke/p/9173464.html
今日推荐