Linux学习篇第三章之~高级网络配置

配置网络桥接

•配置 bond 网络接口

•配置 team 网络接口

--------------------------------------------------bond网络------------------------------------------------------

1.bond 网络 

允许管理员使用bonding 内核模块和称为通道绑定接口的特殊网络接口将多个网络接口绑定到一个通道。根据选择的绑定模式 , 通道绑定使两个或更多个网络接口作为一个网络接口 , 从而增加带宽和 / 提供冗余性

2.利用 nmcli 命令管理 bond
 > nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup
  ip4 172.25.254.243/24

 ###添加主动备份模式的bond0,ip172.25.254.243
 > nmcli connection add type bond-slave ifname eth0 master bond0 con-name bond0-eth1

 ###bond0添加etho0接口
 > nmcli connection add type bond-slave ifname eth1 master bond0 con-name bond0-eth2

Linux学习篇第三章之~高级网络配置

 > watch -n 1 cat /proc/net/bonding/bond0  ##监测

3.测试

 > ifconfig eth0 down  ###让eth0故障

Linux学习篇第三章之~高级网络配置


> eth1接替eth0工作


----------------------------------------------team网络------------------------------------------------------------

1.team也是链路聚合的一种方式最多支持8块网卡
支持模式:广播、轮询、主配、负载均衡
2.配置
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.243/24
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

3.测试
watch -n 1 teamdctl team0 stat
ifconfig eth0 down
ifconfig eth0 up
ping 172.25.254.250

Linux学习篇第三章之~高级网络配置



-------------------------------------------------网络桥接------------------------------------------------------
配置方式
[[email protected] network-scripts]# vim ifcfg-enp0s25
DEVICE=enp0s25            ##设备名称
ONBOOT=yes                  ##开启服务设备自动**
BOOTPROTO=none        ##网卡工作状态
BRIDGE=br0                     ##网卡开启的网桥接口
Linux学习篇第三章之~高级网络配置
[[email protected] network-scripts]# vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.43
NETMASK=255.255.255.0
TYPE=Bridge              ##网络接口类型是桥接
Linux学习篇第三章之~高级网络配置
systemctl stop NetworkManager.service
systemctl restart network
systemctl start NetworkManager.service
ifconfig


--------------------------------------命令管理方式------------------------------------
1.添加
systemctl stop NetworkManager
brctl show
brctl addbr br0
brctl addif br0 eth0
ifconfig eth0 up
ifconfig br0 172.25.254.243 netmask 255.255.255.0
brctl show
ping 172.25.254.250
Linux学习篇第三章之~高级网络配置
2.删除
ifconfig br0 down
brctl delif br0 eth0
brcl delbr br0
brctl show

----------------------------------------------ipv6----------------------------------------------

1.
internet proto version 6
ipv4 32/2    地址枯竭 子网掩码24 16 8
ipv6 128/2    子网16 32 48 64 80
128/2 ------------> 128/8    16    ------> 0-f
2017:0:0:0:f:0:0:1/48
2017::f:0:0:1
2017:0:0:0:f::1
0000------>ffff