首页 > 系统服务 > 详细

KVM之网桥创建(ubuntu 环境)

时间:2016-11-29 23:32:13      阅读:198      评论:0      收藏:0      [点我收藏+]

KVM之网桥创建(ubuntu 环境)

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





创建完成后,重启网络

本文出自 “FA&IT运维-Q群:223843163” 博客,请务必保留此出处http://freshair.blog.51cto.com/8272891/1877883

KVM之网桥创建(ubuntu 环境)

原文:http://freshair.blog.51cto.com/8272891/1877883

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!