在Centos7上玩KVM的话一定要配置网桥的:

[root@localhost nb]# ls /etc/sysconfig/network-scripts
ifcfg-8866 ifdown ifdown-isdn ifdown-TeamPort ifup-ib ifup-post ifup-tunnel network-functions-ipv6
ifcfg-br0 ifdown-bnep ifdown-post ifdown-tunnel ifup-ippp ifup-ppp ifup-wireless
ifcfg-CCAP_guest ifdown-eth ifdown-ppp ifup ifup-ipv6 ifup-routes init.ipv6-global
ifcfg-enp0s25 ifdown-ib ifdown-routes ifup-aliases ifup-isdn ifup-sit keys-8866
ifcfg-iPak ifdown-ippp ifdown-sit ifup-bnep ifup-plip ifup-Team keys-iPak
ifcfg-lo ifdown-ipv6 ifdown-Team ifup-eth ifup-plusb ifup-TeamPort network-functions

上面的是配置好的,可以看到新增的文件ifcfg-br0

接下来看看ifcfg-br0 和ifcfg-enp0s25网卡文件:

# cat /etc/sysconfig/network-scripts/ifcfg-br0
TYPE=Bridge
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
DEVICE=br0
ONBOOT=yes
# cat /etc/sysconfig/network-scripts/ifcfg-enp0s25
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s25
UUID=cfe5e123-26a1-4f1d-bcd0-ec8a7a91c82f
DEVICE=enp0s25
ONBOOT=yes
BRIDGE=br0 #只是增加 了这么一条!!!

重启网卡enp0s25(每个机器的名子不同)

ifdown enp0s25 #先关闭然后重启网卡
# systemctl restart network
查看成功后的ip:
[root@localhost nb]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP qlen 1000
link/ether 54:xx:75:4e:37:d9 brd ff:ff:ff:ff:ff:ff
3: wlp4s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 02:d7:e5:72:e5:c8 brd ff:ff:ff:ff:ff:ff
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
link/ether 52:54:x0:fe:e5:29 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
link/ether 52:xx:00:fe:e5:29 brd ff:ff:ff:ff:ff:ff
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether fe:54:00:d6:81:e8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fed6:81e8/64 scope link
valid_lft forever preferred_lft forever
8: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 54:ee:75:4e:37:d9 brd ff:ff:ff:ff:ff:ff
inet 10.100.0.19/24 brd 10.100.0.255 scope global dynamic br0 #可以看到ip
valid_lft 86368sec preferred_lft 86368sec
inet6 fe80::56ee:75ff:fe4e:37d9/64 scope link
valid_lft forever preferred_lft forever

查看网桥:

# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.54ee754e37d9 no enp0s25
virbr0 8000.525400fee529 yes virbr0-nic

centos7配置网桥的更多相关文章

  1. VMware14 安装CentOS7及其配置;CentOS7配置网桥,做远程连接;

    1.VMware14安装        进入百度链接,按照图形安装就好了.https://jingyan.baidu.com/article/9f7e7ec09da5906f281554d6.html ...

  2. Centos7 配置网络步奏详解

    Centos7 配置网络步奏详解 编辑网卡配置文件 vi /etc/sysconfig/network-script/ifcfg-ens01 备注:这里的ens01不是所有系统都叫这个,有的可能叫其他 ...

  3. centos7配置开启无线网卡,重启防火墙

    centos7配置无线网卡: 在虚拟机为nat的网络连接下(就是默认的那个),centos7默认网卡未激活. 可以设置 文件 /etc/sysconfig/network-scripts/ifcfg- ...

  4. Centos7配置JAVA_HOME

    Centos7配置JAVA_HOME http://blog.csdn.net/zzpzheng/article/details/73613838 在Centos7上,通过yum install ja ...

  5. Centos7配置NFS

    centos7配置nfs yum -y install nfs-utils rpcbind 设置服务开机启动: systemctl enable rpcbind systemctl enable nf ...

  6. Centos7 配置ssh连接

    Centos7 配置ssh连接 1.检查是否安装openssh-server:#yum list installed | grep openssh-server 安装openssh-server:#y ...

  7. Linux下通过brctl配置网桥

    什么是网桥 网桥是一种在链路层实现中继,对帧进行转发的技术,根据MAC分区块,可隔离碰撞,将网络的多个网段在数据链路层连接起来的网络设备. 简单的理解就是交换机. Linux下配置网桥主要用 brct ...

  8. CentOS7 配置静态 ip

    1. 为 CentOS7 配置静态 ip 1.1 修改文件/etc/sysconfig/network-scripts/ifcfg-ens33 sudo vi /etc/sysconfig/netwo ...

  9. linux下brctl配置网桥

    原文:http://zhumeng8337797.blog.163.com/blog/static/1007689142011643834429/ 先装好网卡,连上网线,这是废话,不用说了. 然后开始 ...

随机推荐

  1. <c:url>标签相关知识点

    <c:url>标签: value:指定路径!他会在路径前面自动添加项目名. <c:url value="/index.jsp"/>,他会输出/day14/i ...

  2. Windows下VS2017编译OpenCV 3.4.0-rc

    简述 很久没有用过OpenCV了,这次需要做一点图像处理相关的工作,又需要用起来,这里记录一下编译的过程.之前介绍过使用vs2015编译opencv2.4的帖子在这里. 编译好的文件在这里https: ...

  3. Spring Cloud Edgware SR3 让Zuul支持形如 /xxx和/xxx/yyy 格式的路径配置

    在包路径:org.springframework.cloud.netflix.zuul.filters 下,新建类SimpleRouteLocator,取代jar包中的类.内容如下: /* * Cop ...

  4. Centos7 安装 docker-ce

    本文参考官网地址:https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements 1.卸载旧版本的docker $ su ...

  5. ansible2.4.x RPM急速安装

    概述: 在centos上安装ansible如果在线联网安装甚是方便,实际上大部分在内网安装隔绝外网,都是离线安装.如何急速安装软件,使我们迫切的愿望 环境: python2.6 ansible2.4. ...

  6. windows下Oracle Tuxedo编译应用前需要配置的相关环境变量

    rem (c) BEA Systems, Inc. All Rights Reserved. rem Copyright (c) BEA Systems, Inc. rem All Rights Re ...

  7. Swift3 CADisplayLink简单用法

    1.定义属性 var displayLinkTimer:CADisplayLink? = nil 2.init displayLinkTimer = CADisplayLink(target: sel ...

  8. 关于jsp发起请求加载datagrid数据(草稿)

    $(document).ready(function (){ var refNo = '${refNo}'; $('#caAbnDetail').datagrid('load',{ refNo:ref ...

  9. jeecg平台testDatagrid

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  10. windows修改环境变量

    windows的环境变量有两套: 系统的 当前用户的 不同的用户可以拥有不同的环境变量,当前用户的环境变量优先级比系统的环境变量优先级高,PATH环境变量比较特殊,它不是替换而是拼接. 在命令行下也可 ...