####高级网络配置###
###bond类型
再添加一块网卡
systemctl status NetworkManager(观看是否处于活跃状态)
nmcli connection show
nmcli connection delete 'System eth0'
nmcli connection show(此处应该没有显示)
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.149/24
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0
nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0
查看状态
watch -n 1 "cat /proc/net/bonding/bond0"
ifconfig eth0 down
ifconfig eth0 up (eth1在工作)
###删除
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1
#####team类型
nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.149/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
查看
teamdctl team0 stat
ifconfig eth0 down(看是否转化为eth1)
ifconfig eth0 up
删除team
nmcli connection delete team0
nmcli connection delete eth0
nmcli connection delete eth1
###桥接###(在真机做)
cd /etc/sysconfig/network-scripts/
ls
mkdir /backup
mv ifcfg-br0 ifcfg-enp0s25 /backup/
ls
nm-connection-editor(删除所有东西)
添加网卡
cd /etc/sysconfig/network-scripts/
vim ifcfg-eth0(网卡的名字)
BOOTPROTO=none
DEVICE=enp0s25
ONBOOT=yes
BRIDGE=br0
vim ifcfg-br0
DEVICE=br0
ONBOOT=yes
BOOTPROTO=none
TPADDR=172.25.254.49
PREFTX=24
TYPE=Bridge
systemctl restart network
brctl show (观看是否桥接上)
###临时设定ip##
ifconfig enp0s25 172.25.254.25/24
###还原真机##
cd /etc/sysconfig/network-scripts/
ls
rm -fr ifcfg-br0 ifcfg-eth0
mv /backup/* .
ls
systemctl restart network
###在虚拟机做br0##
清空环境
brctl addbr br0
ifconfig br0
ping 172.25.254.49(ping 不通)
brctl show
brctl addif br0 eth0
brctl show
ping 172,25,254.49
###删除br0
brctl delif br0 eth0
brctl show
ifconfig br0 down
ifconfig
brctl show
brctl delbr br0
brctl show