首页 > 代码库 > 高级网络配置

高级网络配置

 

###############team###############

1.team 也是链路聚合的一种方式,最多支持8块网卡

支持模式

广播

轮询

主备

负载均衡

 

2.配置

nmcli connection add con-name team0 ifname team0 type team config ‘{"runner":{"name":"activebackup"}}‘ ip4 172.25.254.195/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 maste

r team0

3.测试

watch -n 1 teamdctl team0 stat

ifconfig eth0 down

ifconfig eth0 up

 

 

##################网桥######################

配置方式

systemctl stop NetworkManager.service

vim /etc/sysconfig/network-scripts/ifcfg-enp0s25

DEVICE=enp0s25

ONBOOT=yes

BOOTPROTO=none

BRIDGE=br0

 

vim /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=enp0s25

ONBOOT=yes

BOOTPROTO=none

IPADDR=172.25.254.95

NETMASK=255.255.255.0

TYPE=Bridge

 

 

systemctl restart network

systemctl start NetworkManager.service

 

ifconfig

 

 

 

 

######命令管理方式

#添加

systemctl stop NetworkManager

brctl show

brctl addbr br0

brctl addif br0 eth0

ifconfig eth0 up

ifconfig br0 172.25.254.195 netmask 255.255.255.0

brctl show

ping 172.25.254.95

 

#删除

ifconfig br0 down

brctl delif br0 eth0

brctl delbr br0

brctl show

 


高级网络配置