想在创建虚拟机的时候指定ip调研
想調研一下libvit xml能否提供類似的配置選項:
?xml應該寫成這個樣子,預先要在宿主機上面創建br0,配置要分配指定ip
?
Using an existing host bridge
Since 0.9.4 This shows how to use a pre-existing host bridge "br0". The guests will effectively be directly connected to the physical network (i.e. their IP addresses will all be on the subnet of the physical network, and there will be no restrictions on inbound or outbound connections).
<network><name>host-bridge</name><forward mode="bridge"/><bridge name="br0"/></network> ?auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.254
bridge_ports eth0
這種配置需要進入客戶機OS然后指定ip之后才能使用橋接進入局域網
怎么把新創建的虛擬機加入到網橋中去? 在kvm的啟動命令中,vlan=0,1是核心嗎?在libvirt中怎么使用?不需要編輯/etc/networking/interface吧?在xml中指定就可以了吧?如果不行 用libvirtAPI 進行調用設置嗎? 應該是可以的
總結
以上是生活随笔為你收集整理的想在创建虚拟机的时候指定ip调研的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Lucene4:创建查询,并高亮查询关键
- 下一篇: IPv6与IPv4的区别