你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu 环境下KVM网桥创建

[日期:2016-12-09] 来源:Linux社区  作者:freshair [字体:大 中 小]

Ubuntu 环境下KVM网桥创建

1、创建网桥的目的是为了让KVM虚拟机连接到这个网桥,从而使虚拟机可以和物理网络通信
2、当然,安装完kvm后,会自动建立一个网桥virbr0,这个网桥应该是nat模式

一、DHCP网桥创建
vim /etc/network/interfaces

这是interfaces配置文件的内容:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet dhcp 物理网卡也为DHCP
 
auto br100
iface br100 inet dhcp 配置br100网桥为DHCP
bridge_ports eth0    配置br100建立在物理网卡eth0上
bridge_stp off
bridge_fd

创建完成后,重启网络

静态网桥
vim /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
 
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.89.3
gateway 192.168.89.2
netmask 255.255.255.0
network 192.168.89.0
broadcast 192.168.89.255
 
auto br100
iface br100 inet static
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
address 192.168.89.3
network 192.168.89.0
netmask 255.255.255.0
broadcast 192.168.89.255
gateway 192.168.89.2

创建完成后,重启网络

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-12/138114.htm

linux
相关资讯       KVM网桥创建  KVM网桥 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款