位置: 编程技术 - 正文

CentOS6.3 KVM如何设置网卡为桥接模式(centos7.6安装kvm)

编辑:rootadmin
KVM的默认网络模式为NAT,就是说借助宿主机模式上网,现在我们想改成桥接模式,这样外界就可以直接和宿主机里的虚拟机通讯了。 1,首先看一下默认的网络设置 复制代码代码如下: # cat /etc/libvirt/qemu/networks/default.xml <network> <name>default</name> <uuid>1f---adcf-6bf6acac</uuid> <bridge name="virbr0" /> <mac address=':::F1:6B:6E'/> <forward/> <ip address="...1" netmask="...0"> <dhcp> <range start="...2" end="..." /> </dhcp> </ip> </network> 2,再看一下虚拟机配置文件里面的网络设置 #cat /etc/libvirt/qemu/ubuntu..xml <!-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: virsh edit ubuntu. or other application using the libvirt API. --> <domain type='kvm'> <name>ubuntu.</name> <uuid>2eeb-a2-a-4da3-fba1df</uuid> <memory unit='KiB'></memory> <currentMemory unit='KiB'></currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x_' 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/ubuntu..img'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x0'/> </disk> <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> <controller type='usb' index='0'> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x2'/> </controller> <controller type='ide' index='0'> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x1'/> </controller> <interface type='bridge'> 原来是interface type='default' <mac address=':::::7e'/> <source bridge='br1'/> 原来是source network='default',这里的br1要根据你的物理网卡下面有讲 <model type='virtio'/> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ich6'> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x0'/> </sound> <video> <model type='cirrus' vram='' heads='1'/> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x' bus='0x' slot='0x' function='0x0'/> </memballoon> </devices> </domain> [/code] 3,改完之后要更新一下配置文件 # virsh define ubuntu..xml 定义域 ubuntu.(从 ubuntu..xml) #然后就可以virsh start ubuntu.了,不过现在物理网卡这块还没有改好 4,物理网卡可以手动更改,不过现在有现成的工具包,可以用这个更改 #wget # tar zxvf convirture-tools-2.0.1.tar.gz # /root/convirture-tools/install/managed_server/scripts/convirt-tool --bridge setup 我的这里出现了点小问题,发现网络没起来,所以不要远程来做这个操作,主要原因是里面的配置文件有点需要 小的更改,我的是UUID注释了。 # ls ifcfg-* ifcfg-br1 ifcfg-br2 ifcfg-br3 ifcfg-br4 ifcfg-em1 ifcfg-em2 ifcfg-em3 ifcfg-em4 ifcfg-lo 我这里有四个物理网卡,所以生成了四个bridge,不过真实用的只有br1 这个工具好有一个好处就是保存了原配置文件,如果你不想用时还可以还原 # ls saved.ifcfg-em* saved.ifcfg-em1.. saved.ifcfg-em3.. saved.ifcfg-em2.. saved.ifcfg-em4.. 看下ifceg-em1 # cat ifcfg-em1 DEVICE="em1" #BOOTPROTO=none NM_CONTROLLED="yes" ONBOOT=yes TYPE="Ethernet" #UUID="3bc7fdcc-b1--b-ec8" #IPADDR... PREFIX= GATEWAY=... DNS1=...5 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System em1" HWADDR=:B1:1C::4D:A5 BRIDGE=br1 看下ifcfg-br1 # cat ifcfg-br1 DEVICE="br1" BOOTPROTO=none NM_CONTROLLED="yes" ONBOOT=yes #UUID="3bc7fdcc-b1--b-ec8" IPADDR=... PREFIX= GATEWAY=... DNS1=...5 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System br1" TYPE=Bridge 最后看下网卡 # ifconfig br1 Link encap:Ethernet HWaddr :B1:1C::4D:A5 inet addr:... Bcast:... Mask:...0 inet6 addr: fe::b1:1cff:fe:4da5/ Scope:Link UP BROADCAST RUNNING MULTICAST MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes: (.5 KiB) TX bytes: (.1 MiB) em1 Link encap:Ethernet HWaddr :B1:1C::4D:A5 inet6 addr: fe::b1:1cff:fe:4da5/ Scope:Link UP BROADCAST RUNNING MULTICAST MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen: RX bytes: (.7 KiB) TX bytes: (.7 MiB) Interrupt: lo Link encap:Local Loopback inet addr:.0.0.1 Mask:.0.0.0 inet6 addr: ::1/ Scope:Host UP LOOPBACK RUNNING MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes: (.5 MiB) TX bytes: (.5 MiB) virbr0 Link encap:Ethernet HWaddr :::F1:6B:6E inet addr:...1 Bcast:... Mask:...0 UP BROADCAST RUNNING MULTICAST MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes: (.8 KiB) TX bytes: (.2 KiB) vnet0 Link encap:Ethernet HWaddr FE:::::7E inet6 addr: fe::fc:ff:fe:e/ Scope:Link UP BROADCAST RUNNING MULTICAST MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen: RX bytes: (.1 KiB) TX bytes: (.7 KiB) vnet1 Link encap:Ethernet HWaddr FE:::B5:1A: inet6 addr: fe::fc:ff:feb5:1a/ Scope:Link UP BROADCAST RUNNING MULTICAST MTU: Metric:1 RX packets: errors:0 dropped:0 overruns:0 frame:0 TX packets: errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen: RX bytes: (8.5 KiB) TX bytes: (.2 KiB) 5,启动虚拟机ubuntu.后配置网卡 #cat /etc/network/interface auto lo iface lo inet loopback auto eth0 iface eth0 inet static address ... netmask ...0 gateway ... #/etc/init.d/networking restart 启动即可

推荐整理分享CentOS6.3 KVM如何设置网卡为桥接模式(centos7.6安装kvm),希望有所帮助,仅作参考,欢迎阅读内容。

CentOS6.3 KVM如何设置网卡为桥接模式(centos7.6安装kvm)

文章相关热门搜索词:centos kvm win7,centos安装kvm图形界面,centos kvm win7,centos7 kvm,centos7.6安装kvm,centos7 kvm,centos kvm win7,基于centos6安装kvm服务,内容如对您有帮助,希望把文章链接给更多的朋友!

linux backtrak无线配置教程 俺用backtrack不是为了破解,就是因为看到它有一句话说的很多thequieteryoubecome,themoreyouareabletohear.我说一下backtrack是如何无线上网的哈,其实bt的内核是ubun

Linux构造磁盘空间满的测试环境解决方案 利用suse操作系统的ramdisk,来挂接虚拟磁盘分区,然后通过填满虚拟磁盘分区来实现磁盘满环境的条件。ramdisk是操作系统自带的一种内存块设备,这种设备

Linux系统进程深入理解 1.什么是进程进程是处于执行期的程序以及它所包含的所有资源的总称,包括虚拟处理器,虚拟空间,寄存器,堆栈,全局数据段等。在Linux中,每个进

标签: centos7.6安装kvm

本文链接地址:https://www.jiuchutong.com/biancheng/362060.html 转载请保留说明!

上一篇:varnish3.0安装及配置教程(3.0vray安装教程)

下一篇:linux backtrak无线配置教程(linux怎么使用无线网卡)

  • 私车公用的税务风险
  • 增值税发票验真伪怎么验
  • 申请退还增量留抵税额的条件包括
  • 进项税转出包括什么
  • 已经抵扣的进项税额转出怎么申报
  • 个体户一定要自己经营吗
  • 发票没有纳税人识别号能开吗
  • 劳务外包 规定
  • 当前企业不存在是怎么回事
  • 建筑企业发生分包业务如何确认收入
  • 固定资产到期怎么处理
  • 债务重组损失计算公式
  • 借给股东的借款怎么做账
  • 去年销售怎么算
  • 地税能不能查到个人的贷款行为?
  • 职工教育经费进项
  • 月末在产品直接人工成本怎么算
  • 电商平台收取的运输费记收入吗
  • 负债清偿损益明细表可以0报么
  • 公司员工结婚礼金规定
  • u盘的重装系统
  • 对方已经认证的红字发票怎么开
  • 增值税一般纳税人申报流程
  • 电子发票上的电子税章如何才能自动生成
  • 如何安装电脑系统程序
  • 行政事业单位公车使用制度
  • iphone如何录音转文字
  • php网页爬虫
  • win7资源管理器叫什么
  • 增值税专用发票几个点
  • 公司股东变更要交税吗可以将股东变更吗
  • 接受捐赠会计准则
  • 装修费计入固定资产还是长期待摊
  • php超时限制
  • 浅析论文题目
  • 期初金额和期末金额怎么算
  • 结转生产成本是负数怎么办
  • 水利建设基金的计费方式
  • 以前年度未入账固定资产账务处理
  • 企业购买黄金可以避税
  • 2021年股权变更要怎么办理?
  • 网银数字证书年费
  • sql server 2008数据库没有备份文件恢复
  • 股东退股如何清算表格
  • 增资扩股和股权转让一样吗
  • 现金流量套期与公允价值套期的区别
  • 生产车间人员工资期末结转
  • 快递公司成本分析
  • 企业的营业税金怎么计算
  • 房地产公司项目经理待遇
  • 研发产品入库
  • 在贫困户入股分红大会上的讲话
  • 作废的发票对方还能认证吗
  • 什么是资金结存,它具体包括哪些内容
  • 私人贴现利息如何交税
  • 土地增值税计算题
  • 结算专用章是财务章吗
  • 低值易耗品怎么做账务处理
  • sqlserver代理服务启动失败
  • mysql学习资料
  • win7系统设置打印机共享
  • wlanplus是什么软件
  • win10连接ubuntu20.04远程桌面
  • centos 网卡顺序
  • Mac如何开启sip
  • explorer.exe是什么指令
  • windows8中“同步你的设置”使用介绍(让你的设置自动同步)
  • win10下载英雄联盟运行没反应
  • 电脑出现内部版本7601怎么办
  • 安卓专业图片处理软件
  • js插件写法
  • xcopy /i
  • 批处理执行另一个批处理
  • shell脚本ll
  • android数据存储总结
  • jquery-easyui-1.3.3
  • 广西税务局123
  • 贵州省产检费用报销流程
  • 重庆平均缴费指数查询
  • 北京昌平区租房价格
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设