KVM之网桥创建(ubuntu 环境)

简介:

KVM之网桥创建(ubuntu 环境)

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

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

这是interfaces配置文件的内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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





创建完成后,重启网络


本文转自 TtrToby 51CTO博客,原文链接:http://blog.51cto.com/freshair/1877883


相关文章
|
10天前
|
Ubuntu
【报错】解决Ubuntu环境下VsCode无法输入中文
【报错】解决Ubuntu环境下VsCode无法输入中文
|
10天前
|
Kubernetes Ubuntu Shell
wsl Ubuntu环境 创建 k8s集群
wsl Ubuntu环境 创建 k8s集群
|
10天前
|
IDE Ubuntu Java
百度搜索:蓝易云【Ubuntu快速搭建单步调试openjdk环境】
现在,你已经成功在Ubuntu上搭建了OpenJDK的单步调试环境,可以使用Eclipse IDE方便地进行Java程序的调试。请注意,Eclipse IDE提供了丰富的调试功能,使得调试过程更加高效和准确。
30 0
|
10天前
|
Ubuntu 网络协议 Linux
如何在无公网IP环境使用Windows远程桌面Ubuntu
如何在无公网IP环境使用Windows远程桌面Ubuntu
75 0
|
10天前
|
Ubuntu 测试技术 Linux
dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)
dpdk测试环境搭建(vmware下ubuntu环境参考上文汇总流程)
138 0
|
10天前
|
并行计算 Ubuntu Docker
Docker环境Ubuntu20.04安装Python3.10版本
Docker环境Ubuntu20.04安装Python3.10版本
73 0
|
10天前
|
NoSQL Ubuntu 开发工具
【gdb调试】在ubuntu环境使用gdb调试一棵四层二叉树的数据结构详解
【gdb调试】在ubuntu环境使用gdb调试一棵四层二叉树的数据结构详解
9 1
|
10天前
|
Ubuntu 开发工具 git
ubuntu18.04下配置muduoC++11环境
以上步骤将在Ubuntu 18.04下配置C++11环境,并编译安装muduo库。请根据实际情况对配置步骤进行调整。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
34 0
|
10天前
|
Ubuntu 关系型数据库 MySQL
ubuntu部署python环境,vscode编辑wsl项目遇到的问题汇总
ubuntu部署python环境,vscode编辑wsl项目遇到的问题汇总
|
10天前
|
关系型数据库 MySQL Apache
Ubuntu22.04搭建LAMP环境
LAMP是一个用于构建Web应用程序的技术堆栈,你可以用它开发很多Web程序,比如WordPress。如果你想手工在VPS上搭建WordPress的话,那么你就需要先搭建LAMP环境。这篇文章讲解如何在Ubuntu22.04上搭建LAMP环境。首先,你需要先注册一台VPS服务器,然后登录VPS安装Apache服务、安装MySQL数据库,以及安装PHP。
59 0
Ubuntu22.04搭建LAMP环境