zoukankan      html  css  js  c++  java
  • centos 7 配置多网卡bond

    原文

    https://www.cnblogs.com/yxy-linux/p/8327818.html

    关闭 NetworkManager 服务

    systemctl stop NetworkManager.service
    systemctl disable NetworkManager.service

    配置网卡1

    复制代码
    vim /etc/sysconfig/network-scripts/ifcfg-eno24
    TYPE=Ethernet
    BOOTPROTO=none
    USERCTL=no
    DEVICE=eno24
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    复制代码

     配置网卡2

    复制代码
    vim /etc/sysconfig/network-scripts/ifcfg-eno25
    TYPE=Ethernet
    BOOTPROTO=none
    USERCTL=no
    DEVICE=eno25
    ONBOOT=yes
    MASTER=bond0
    SLAVE=yes
    复制代码

    配置bond

    复制代码
    vim /etc/sysconfig/network-scripts/ifcfg-bond0
    TYPE=Bond
    BOOTPROTO=none
    ONBOOT=yes
    USERCTL=no
    DEVICE=bond0
    IPADDR=192.168.1.4
    PREFIX=24
    GATEWAY=192.168.1.254
    NM_CONTROLLED=no
    BONDING_MASTER=yes
    复制代码

    加bonding内核模板

    modprobe --first-time bonding
    lsmod | grep bonding 或者 modinfo bonding

    配置bonding驱动

    (实践该步骤未做,便可用)
    vim /etc/modprobe.d/bond.conf
    alias bond0 binding
    options bond0 miimon=100 mode=1

    重启网络服务

    service network restart

    查看bond0生效

    cat /proc/net/bonding/bond0

    配置dns

    vim /etc/resolv.conf 
    nameserver 202.106.0.20

    centos 7默认启动时没有加载bonding模块

    复制代码
    # 查看bonding模块详细信息
    modinfo bonding
    filename  /lib/modules/3.10.0-229.el7.x86_64/kernel/drivers/net/bonding/bonding.ko
    
    
    # 配置系统启动时加载bonding模块
    vim /etc/sysconfig/modules/bonding.modules 
    #!/bin/sh
    /sbin/modinfo -F filename bonding > /dev/null 2>&1
    if [ $? -eq 0 ];then
        /sbin/modprobe bonding
    fi
    
    
    # 设置执行权限
    chmod 755 /etc/sysconfig/modules/bonding.modules 
    # 重启查看是否生效 reboot
    复制代码
  • 相关阅读:
    网络适配器、网卡和网卡驱动
    PostgreSQL
    vsftp安装
    Ubuntu里面软件的安装与卸载
    ubuntu下查找某个文件的路径
    TCP的几个状态
    C++产生随机数
    ERROR Cannot determine the location of the VS Common Tools Folder
    小波变换C++实现(一)----单层小波变换
    离散卷积的计算
  • 原文地址:https://www.cnblogs.com/itfat/p/12342066.html
Copyright © 2011-2022 走看看