centos7多网卡配置bond0 (mode6无需交换机做配置)


centos7多网卡配置bond0 (mode6无需交换机做配置)

首先备份两块网卡的配置文件

            mv /etc/sysconfig/network-scripts/ifcfg-em1 /etc/sysconfig/bak_network-scripts/ifcfg-em1_bak

            mv /etc/sysconfig/network-scripts/ifcfg-em2 /etc/sysconfig/bak_network-scripts/ifcfg-em2_bak

            # 重新创建ifcfg-eth0网卡配置文件(em1;em2)
            vim /etc/sysconfig/network-scripts/ifcfg-em1
                TYPE=Ethernet
                BOOTPROTO=none
                DEFROUTE=yes
                PEERDNS=yes
                PEERROUTES=yes
                NAME=em1
                DEVICE=em1
                ONBOOT=yes
                MASTER=bond0
                SLAVE=yes
             # 创建bond0虚拟网卡配置文件ifcfg-bond0
             vim /etc/sysconfig/network-scripts/ifcfg-bond0
                DEVICE=bond0
                NAME=bond0
                TYPE=Bond
                IPADDR=192.168.67.109
                NETMASK=255.255.255.0
                ONBOOT=yes
                BOOTPROTO=none
                BONDING_OPTS="mode=6  miimon=100"
                USERCTL=no
                GATEWAY=192.168.67.254

           # 重启网卡生效
           systemctl restart network