首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

CentOS6.3 KVM下设置网卡为桥接模式

CentOS6.3 KVM下设置网卡为桥接模式 KVM的默认网络模式为NAT,就是说借助宿主机模式上网,现在我们想改成桥接模式,这样外界就可以直接和宿主机里的 虚拟机通讯了。 1,首先看一下默认的网络设置 # cat /etc/libvirt/qemu/networks/default.xml <network>   <name>default</name>   <uuid>1f118032-0345-4725-adcf-6b94f6aca19c</uuid>   <bridge name="virbr0" />   <mac address='52:54:00:F1:6B:6E'/>   <forward/>   <ip address="192.168.122.1" netmask="255.255.255.0">     <dhcp>       <range start="192.168.122.2" end="192.168.122.254" />     </dhcp>   </ip> </network> 2,再看一下虚拟机配置文件里面的网络设置 #cat /etc/libvirt/qemu/ubuntu10.04.xml <domain type='kvm'>   <name>ubuntu10.04</name>   <uuid>2eeb1395-39a2-a169-4da3-f22b20a1d34f</uuid>   <memory unit='KiB'>1048576</memory>   <currentMemory unit='KiB'>1048576</currentMemory>   <vcpu placement='static'>1</vcpu>   <os>     <type arch='x86_64' machine='rhel6.3.0'>hvm</type>     <boot dev='hd'/>   </os>   <features>     <acpi/>     <apic/>     <pae/>   </features>   <clock offset='utc'/>   <on_poweroff>destroy</on_poweroff>   <on_reboot>restart</on_reboot>   <on_crash>restart</on_crash>   <devices>     <emulator>/usr/libexec/qemu-kvm</emulator>     <disk type='file' device='disk'>       <driver name='qemu' type='raw' cache='none'/>       <source file='/var/lib/libvirt/images/ubuntu10.04.img'/>       <target dev='vda' bus='virtio'/>      

    </disk>     <disk type='block' device='cdrom'>       <driver name='qemu' type='raw'/>       <target dev='hdc' bus='ide'/>       <readonly/>      
    </disk>     <controller type='usb' index='0'>      
    </controller>     <controller type

02
领券