KVM之网桥创建(ubuntu 环境)
1、创建网桥的目的是为了让KVM虚拟机连接到这个网桥,从而使虚拟机可以和物理网络通信
2、当然,安装完kvm后,会自动建立一个网桥virbr0,这个网桥应该是nat模式
一、DHCP网桥创建
vim /etc/network/interfaces
这是interfaces配置文件的内容:
#Thisfiledescribesthenetworkinterfacesavailableonyoursystem #andhowtoactivatethem.Formoreinformation,seeinterfaces(5). #Theloopbacknetworkinterface autolo ifaceloinetloopback #Theprimarynetworkinterface autoeth0 ifaceeth0inetdhcp物理网卡也为DHCP autobr100 ifacebr100inetdhcp配置br100网桥为DHCP bridge_portseth0配置br100建立在物理网卡eth0上 bridge_stpoff bridge_fd
创建完成后,重启网络
静态网桥
vim /etc/network/interfaces
#Thisfiledescribesthenetworkinterfacesavailableonyoursystem #andhowtoactivatethem.Formoreinformation,seeinterfaces(5). #Theloopbacknetworkinterface autolo ifaceloinetloopback #Theprimarynetworkinterface autoeth0 ifaceeth0inetstatic address192.168.89.3 gateway192.168.89.2 netmask255.255.255.0 network192.168.89.0 broadcast192.168.89.255 autobr100 ifacebr100inetstatic bridge_portseth0 bridge_stpoff bridge_fd0 bridge_maxwait0 address192.168.89.3 network192.168.89.0 netmask255.255.255.0 broadcast192.168.89.255 gateway192.168.89.2
创建完成后,重启网络
原文地址:https://www.jb51.cc/ubuntu/355756.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。