zoukankan      html  css  js  c++  java
  • 想在创建虚拟机的时候指定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 进行调用设置吗? 应该是可以的

     
  • 相关阅读:
    Python3 字典Dict(十三)
    Python3 元组Tuple(十二)
    Python3 列表List(十一)
    Python3 循环语句(十)
    Python3 条件控制(九)
    Python3 运算符(八)
    Swift3.0语法2
    Swift反射机制实现 AppDelegate 字符串获取类并成为根控制器
    Swift语法(更新)
    单例
  • 原文地址:https://www.cnblogs.com/zhangzhang/p/2352386.html
Copyright © 2011-2022 走看看