如何在宿主機上查看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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM