网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

高级网络配置——bond/team/桥接网络

一。学习配置 bond 网络接口

创新互联主营新邵网站建设的网络公司,主营网站建设方案,app开发定制,新邵h5微信小程序开发搭建,新邵网站营销推广欢迎新邵等地区企业咨询

Red Hat Enterprise Linux 允许管理员使用bonding 内核模块和称为通道绑定接口的特殊网络接口将多个网络接口绑定到一个通道。根据选择的绑定模式 , 通道绑定使两个或更多个网络接口作为一个网络接口 , 从而增加带宽和 / 提供冗余性
1.利用 nmcli 命令管理 bond
     nm-connection-editor
           删除所有网络接口
     nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup ip4 172.25.254.199/24
     ifconfig
     watch -n 1 cat /proc/net/bonding/bond0
   
     nmcli connection add type bond-slave con-name eth0 ifname eth0 master bond0
     nmcli connection add type bond-slave con-name eth2 ifname eth2 master bond0
     ifconfig eth0 down
2.选择 Linux 以太网绑定模式
    模式 0 ( 平衡轮循 balance-rr) - 轮循策略 , 所有接口都使用采用轮循方式在所有 Slave 中传输封包 ; 任何Slave 都可以接收
    模式 1 ( 主动备份 active-backup ) - 容错。一次只能使用一个Slave 接口 , 但是如果该接口出现故障 , 另一个Slave 将 接替它
    模式 3 ( 广播 broadcast) - 容错。所有封包都通过所有Slave 接口广播
3.主动备份配置示例
   3-1 建立绑定接口 bond0 配置文件 :
/etc/sysconfig/network-scripts/ifcfg-bond0

– BOOTPROTO="none"
– IPADDR="10.1.1.250"
– PREFIX=”24”
– ONBOOT="yes"
– BONDING_OPTS=”mode=1 miimon=50”
   3-2 建立 Slave 接口 eth0 配置文件:
/etc/sysconfig/network-scripts/ifcfg-eth0
– DEVICE="eth0"         ####硬件网卡名
– BOOTPROTO="none"
– ONBOOT="yes"
– MASTER="bond0"
– SLAVE="yes“
   3-3 建立 Slave 接口 eth2 配置文件 :
/etc/sysconfig/network-scripts/ifcfg-eth2
– DEVICE="eth2"
– BOOTPROTO="none"
– ONBOOT="yes"
– MASTER="bond0"
– SLAVE="yes“
   3-4 配置系统加载 binding 模块 :
/etc/modprobe.d/bonding.conf
– alias bond0 bonding
ifenslave bond0 eth0 eth2

systemctl stop NetworkManager
systemctl restart network

查看 bonding 状态
– cat /proc/net/bonding/bond0

二。学习配置 team 网络接口
1.Team 接口
Team 和 bond0 功能类似
Team 不需要手动加载相应内核模块
Team 有更强的拓展性
– 支持 8 快网卡

2.Team 的种类

broadcast     广播容错
roundrobin    轮询
activebackup  主备
loadbalance   负载均衡

3.通过 nmcli 设定 team
nmcli connection add type team con-name team0 ifname team0 config '{"runner"{"name":"loadbalance"}}' ip4 172.25.254.198/24
nmcli connection add con-name eth0   ifname eth0 type team-slave master team0
nmcli connection add con-name eth2   ifname eth2 type team-slave master team0

4.监控team0,并测试
teamctl team0 stat      
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth2 down
ifconfig eth2 up

三。学习配置网络桥接
1.网络桥接
网络桥接用网络桥实现共享上网主机和客户机除了利用软件外,还可以用系统自带的网络桥建立连接用双网卡的机器做主机

2.网络桥接的配置
vim /etc/sysconfig/network-scripts/ifcfg-eth0
   DEVICE=eth0       ###设备名,可能不同
   ONBOOT=yes
   BOOTPROTO=none
   BRIDGE=br0      ###重点,必须说明
vim /etc/sysconfig/network-scripts/ifcfg-br0
   DEVICE=eth0      
   ONBOOT=yes
   BOOTPROTO=none
   TYPE=Bridge      ###重点,必须说明
   IPADDR=172.25.254.198

3.网络桥接的管理命令
brctl
### 桥接管理命令
– show ### 显示
– addbr ### 添加网桥
– delbr ### 删除网桥
– addif ### 添加网桥连接
– delif ### 删除网桥连接

  卸载桥接接口过程
  brctl show
  brctl delif br0 eth0
  brctl show
  brctl delbr br0
  ifconfig br0 down
  brctl show


分享文章:高级网络配置——bond/team/桥接网络
网页地址:http://bjjierui.cn/article/jdoesi.html

其他资讯