1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 基于linux下的高级网络接口设置

基于linux下的高级网络接口设置

时间:2021-03-18 22:40:20

相关推荐

基于linux下的高级网络接口设置

1.高级网络设置

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

模式0 (平衡轮循)表示轮循方式,任何slave都可以接收

模式1 (主动备份) 一次只能使用一个slave接口,出现故障,另一个slave将替代

模式3 (广播) 容错,所有封包都通过所有slave接口

添加两个网卡virt-managerNIC:00:09:0a选择添加,设备模式选择virtionmcli connection delete eth0 删除eth0的配置

添加bondnmcli connection add con-name bond0 ifname-backup ip4 172.25.254.109/24把eth0添加到bond中nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0把eth1添加到bond中nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0

监控watch -n 1 cat /proc/net/bonding/bond0打开另一个shell ping 172.25.88.56 使网卡进行工作

ifconfig eth0 down 可以监控到eth1进行工作,顶替eth0nmcli connection delete bond0 删除bond0nmcli connection delete eth0 卸载bond0上的eth0nmcli connection delete eth1 卸载bond0上的eth1

(2) Team接口的设置

优势:不需要手动加载相应内核模块

有更强拓展性

支持8块网卡

nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.109/24nmcli connection add con-name eth0 ifname eth0 type team-slave master team0nmcli connection add con-name eth1 ifname eth1 type team-slave master team0

watch -n 1 teamdctl team0 stat 对网卡的运行情况进行监控

ifconfig eth0 down 关闭eth0ifconfig eth0 up 开启eth0nmcli connection delete team0 删除team0nmcli connection delete eth0 卸载team0上的eth0nmcli connection delete eth1 卸载team0上的eth1

2.搭建网桥

主机上进行cd /etc/sysconfig/network-scripts/lsmv ifcfg-br0 ifcfg-enp0s25 /opt/ls

nm-connection-editor同时把wifi等没有用的接口的删除 新建一个网卡

systemctl stop NetworkManagersystemctl restart networkvim ifcfg-enp0s25编辑内容如下DEVICE=enp0s25ONBOOT=yesBOOTPROTO=noneBRIDGE=brovim ifcfg-br0DEVICE=br0ONBOOT=yesBOOTPROTO=noneIPADDR=172.25.88.56(真机ip)PREFIX=24TYPE=Bridgebrctl show 进行网桥的查看

临时网桥的搭建

虚拟机:brctl addbr br0 添加网桥brctl showifconfigifconfig br0 172.25.254.109/24ping 172.25.254.9 不通brctl addif br0 eth0 让eth0成为br0的一个端口brctl show 查看网桥ping 172.25.254.9 通了

brctl delif br0 eth0 将br0从eth0上移出ifconfig br0 down 关闭br0ifconfig br0消失brctl delbr br0 删除br0

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。