zoukankan      html  css  js  c++  java
  • linux下网卡绑定

    网卡绑定的作用:1、冗余,防止单点故障 

            2、防止传输瓶颈

    1.交换机端口绑定:

    1 system-view
    2 link-aggregation group 1 mode manual
    3 
    4 比如把端口1和2进行绑定
    5 
    6 interface Ethernet1/0/1                  #进入交换机1口
    7 port link-aggregation group 1        #把当前端口加入汇聚组1
    8 interface Ethernet1/0/2                  #进入交换机2口
    9 port link-aggregation group 1        

    2.系统网卡绑定

    1.设置Bounding
    vi /etc/modules.conf   #添加以下内容
    alias bond0 bonding
    options bonding mode=1 miimon=200 primary=eth2 use_carrier=1
    
    2. 加载bonding模块
    modprobe bonding
    
    3.创建/修改bond0 eth0 eth1 配置文件
    vi /et/sysconfig/network-ifcfg-“网卡名”
    
    DEVICE='bond0'
    BOOTPROTO='static'
    BROADCAST='x.x.x.x'
    IPADDR='x.x.x.x'
    
    DEVICE=eth0
    BOOTPROTO='static'
    STARTMODE='onboot'
    
    DEVICE=eth1
    BOOTPROTO='static'
    STARTMODE='onboot'
    
    4.重启所有网卡
    rcnetwork restart
    
    5.绑定eth0 eth1 到bond0
    ifenslave bond0 eth0
    ifenslave bond0 eth1
    
    6.重启后自动加载设置:
    
    在/etc/init.d/中添加bonding启动文件
    vi /etc/init.d/bonding  #添加以下语句
    case “$1in
        start)
    /sbin/ifenslave bond0 eth0
    /sbin/ifenslave bond0 eth1
    ;;
            *)
    ;;
    esac
    
    7.把加载bonding模块的脚本加入启动脚本中
    
    vi /etc/init.d/boot.local
    modprobe bonding
    请查看新博客:www.vhosts.cn
  • 相关阅读:
    MQ的导出备份
    js中this的使用
    wordpress目录文件结构说明
    css3 rem的用法
    初探Backbone
    call 和 apply使用
    公告栏放honehoneclock和喂小老鼠flash
    什么是好单位与坏单位
    常用正则表达式
    gulp入门教程
  • 原文地址:https://www.cnblogs.com/cpy-devops/p/3961383.html
Copyright © 2011-2022 走看看