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


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

3.测试

 > ifconfig eth0 down  ###让eth0故障



> 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



-------------------------------------------------网络桥接------------------------------------------------------
配置方式
[root@foundation43 network-scripts]# vim ifcfg-enp0s25
DEVICE=enp0s25            ##设备名称
ONBOOT=yes                  ##开启服务设备自动激活
BOOTPROTO=none        ##网卡工作状态
BRIDGE=br0                     ##网卡开启的网桥接口

[root@foundation43 network-scripts]# vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.25.254.43
NETMASK=255.255.255.0
TYPE=Bridge              ##网络接口类型是桥接

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

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值