高级网络配置
配置网络桥接
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