阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ubuntu 环境下KVM网桥创建

143次阅读
没有评论

共计 1109 个字符,预计需要花费 3 分钟才能阅读完成。

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

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计1109字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中