未知KVM虚拟机内部的ip情况下:

可以通过三条命令来过滤,发现虚拟被分配的IP地址

1、virsh list

root@all-in-one:~# virsh list
 Id    Name                           State
----------------------------------------------------
 20    o-master                       running
 21    o-node01                       running
 22    o-node02                       running
 27    k8s-m                          running
 28    k8s-node01                     running
 29    k8s-node02                     running

2、virsh  edit  $id

root@all-in-one:~# virsh edit 20
…………
 
      
…………

找到匹配的网卡MAC信息

3、arp

root@all-in-one:~# arp -a |grep 52:54:00:cd:99:30
? (192.168.50.129) at 52:54:00:cd:99:30 [ether] on virbr0

此处我们已经看到针对o-master這台虚拟主机的ip地址为192.168.50.129