配置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

最低0.47元/天 解锁文章
1509

被折叠的 条评论
为什么被折叠?



