我在Ubuntu(Lucid)主机上有两个正在运行的KVM客户机。 其中一个使用最简单的NAT方法,并在里面使用DHCP。 另外使用里面的桥接方法和静态IP。 两者都很好。 我可以混合networking方法吗? 我想创build一些使用本地192.168.122.x地址的脚本,无论客户是否有一个额外的桥接LAN接口。 有eth0和eth1接口里面会没事的。 感谢您的关注。
具有virbr0和br0接口的主机的简单configuration:
主机上的域xml文件:
... <interface type='network'> <mac address='52:54:00:22:fb:b4'/> <source network='default'/> <model type='virtio'/> </interface> <interface type='bridge'> <mac address='52:54:00:22:fb:b5'/> <source bridge='br0'/> <model type='virtio'/> </interface> ...
来宾上的接口文件:
... auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet static address ... ...