zoukankan      html  css  js  c++  java
  • linux 网络配置

    链路聚合:多个网卡聚合到一起.
    bond与team两种方法。
    bond: 0平衡轮循环 1主动备份   
    实验步骤
    bond网络接口;
    该网络接口同时支持连接到两块网卡,并且有不同的使用方式。
    roundrobin                                       平衡轮询模式:两块网卡同时接受数据。
    activebackup                                    主动备份模式:只有一块网卡工作。

    nmcli connection show           查看网卡接口
    nmcli connection delete "eth0"删除已有的接口

    添加网络接口bond0
    nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.103/24

    将eth0网卡添加到接口bond0中
    nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
    将eth1网卡添加到网络接口中
    nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0

    测试
    watch -n 1 cat /proc/net/bonding/bond0

    ifconfig eth0 down/up 
    通过执行此命令会发现当一块网卡停止工作时,另一块网卡会自动顶替之前工作的网卡,网络连接不中断 
    ------------------------------------------------------------
    删除之前的接口。

    team 支持8块网卡。
    删除之前的bond接口。
    nmcli connection delete bond0
    nmcli connection delete eth0
    nmcli connection delete eth1
    创建team接口
    nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.10/24
    创建连接team的网卡接口
    nmcli connection add con-name eth0 ifname eth0 type team-slave master team0
    nmcli connection add con-name eth1 ifname eth1 type team-slave master team0

    测试:
    teamctl team0 stat
    删除
    nmcli connection delete team0
    nmcli connection delete eth0
    nmcli connection delete eth1
    ------------------------------------------------------------
    网络桥接
    用于虚拟化
    桥接接口

    vim /etc/sysconfig/network-scrpits/ifcfg-enp0s25
    BOOTPROTO=none
    DEVICE=enp0s25
    ONBOOT=yes
    BRIDGE=br0
    vim /etc/sysconfig/network-scrpits/ifcfg-br0
    DEVICE=br0
    ONBOOT=yes
    BOOTPROTO=none
    IPADDR=172.25.254.4
    PREFIX=24
    TYPE=Bridge
    systemctl restart network
    检测:
    brctl show
     
  • 相关阅读:
    ASP.net 知识框架
    MD5验证用户登陆密码
    企业面试题汇总.net
    MD5 加密,AES加密,解密 方法
    我选择了学Python
    校内网的错误信息
    Gmail客户端详细架构之一
    UE
    Gmail客户端详细架构之二:象Gmail一样上传文件
    PATH OR FILE NOT FOUND 之 RTX51.LIB
  • 原文地址:https://www.cnblogs.com/zhengyipengyou/p/9463930.html
Copyright © 2011-2022 走看看