linux高级网络配置

高级网络配置
配置网络桥接

bonding 两块网卡
平衡轮播
监控命令
watch -n 1 cat /proc/net/bonding/bond0

nmcli connetion delete eth0
nmcli connention add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.177/24
这里写图片描述
此时有ip没有网卡
ifconfig
ping 172.25.254.77
这里写图片描述

nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
ping 172.25.254.77
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
ifconfig eth0 down
ifconfig eth0 up
这里写图片描述
删除bond0 eth1 eth0
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1
这里写图片描述

Team
watch -n 1 teamdctl team0 stat

nmcli connection add con-name team0 ifname team0 type team config ‘{“runner”:{“name”:”activebackup”}}’ ip4 172.25.254.177/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
ifconfig eth0 down
ifconfig eth0 up
‘{“runner”:{“name”:”activebackup”}}’
这里写图片描述

临时管理桥接接口
brctl show
brctl addbr br0 添加br0
这里写图片描述

brctl show
ifconfig
ifconfig br0 172.25.254.177/24 添加ip到br0
ifconfig br0
这里写图片描述

ping 172.25.254.77

brctl show
brctl addif br0 eth0 br0连接到eth0
brctl show
ping 172.25.254.77
这里写图片描述
brctl show
brctl delif br0 eth0 br0断开连接eth0
这里写图片描述
Brctl show
ifconfig
这里写图片描述

ifconfig br0 down 关闭br0
brctl show
ifconfig
brctl delbr br0 删除br0
这里写图片描述
ifconfig
brctl show
这里写图片描述
网络桥接
备份真机网络配置文件
cd /etc/sysconfig/network-scipts/
mv ifcfg-br0 ifcfg-enp0s25n /mnt/

vim ifcfg-enp0s25
DEVICE=enp0s25
ONBOOT=yes
BOOTPROTO=none
BRIDGE=br0

vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTOROTO=none
IPADDR=172.25.254.x
PREFIX=24
TYPE=Bridge

systemctl stop NetworkManager
systemctl restart network

brctl show

brctl delif br0 enp0s25

f2
wget ftp://172.25.254.21/pub/bigfile

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值