未知KVM虚拟机内部的ip情况下:
可以通过三条命令来过滤,发现虚拟被分配的IP地址
1、virsh list
[email protected]:~# 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
[email protected]:~# virsh edit 20 ………… <interface type=‘network‘> <mac address=‘52:54:00:cd:99:30‘/> …………
找到匹配的网卡MAC信息
3、arp
[email protected]:~# 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
时间: 2024-10-21 02:06:35