配置KVM网络桥接功能

配置KVM网络桥接功能

配置之前我们来说说网桥:
网桥设备(Bridge),相当于现在的二层交换机,将同一网段的所有机器连接起来。我们配置的网络桥接功能就是将网络设备eth0加进br0(相当于一个交换机设备)。

在这里插入图片描述

因此,我们需要先添加一块br0设备(相当一个二层交换机)。

一、安装生成br0的工具

  [root@centos3 ~]# yum install -y bridge-utils
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.njupt.edu.cn
 * epel: hk.mirrors.thegigabit.com
 * extras: mirrors.njupt.edu.cn
 * updates: mirrors.nju.edu.cn
epel/x86_64/primary_db         FAILED                                          ETA 
http://hk.mirrors.thegigabit.com/epel/7/x86_64/repodata/256fe13c9b4274f5ab2b2c61d51d961ff7d1bb89cd8d57b6dffe1c9e78570aae-primary.sqlite.bz2: [Errno 12] Timeout on http://hk.mirrors.thegigabit.com/epel/7/x86_64/repodata/256fe13c9b4274f5ab2b2c61d51d961ff7d1bb89cd8d57b6dffe1c9e78570aae-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
正在尝试其它镜像。
epel/x86_64/primary_db         FAILED                                          ETA 
http://my.mirrors.thegigabit.com/epel/7/x86_64/repodata/256fe13c9b4274f5ab2b2c61d51d961ff7d1bb89cd8d57b6dffe1c9e78570aae-primary.sqlite.bz2: [Errno 12] Timeout on http://my.mirrors.thegigabit.com/epel/7/x86_64/repodata/256fe13c9b4274f5ab2b2c61d51d961ff7d1bb89cd8d57b6dffe1c9e78570aae-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
正在尝试其它镜像。
epel/x86_64/primary_db                                      | 6.9 MB  00:00:21     
软件包 bridge-utils-1.5-9.el7.x86_64 已安装并且是最新版本
无须任何处理

二、将eth0绑到br0下

1.更改以太网配置文件,如图中所示。

[root@centos3 ~]#  cd /etc/sysconfig/network-scripts/
[root@centos3 network-scripts]# ls
ifcfg-ens33  ifdown-isdn      ifup          ifup-plip      ifup-tunnel
ifcfg-lo     ifdown-post      ifup-aliases  ifup-plusb     ifup-wireless
ifdown       ifdown-ppp       ifup-bnep     
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值