高级网络配置:
1,配置网络桥接桥接作用使你的虚拟机和真机使用同一块网络设备#brctl show#brctl delif br0 eth0#brctl addif br0 eth0#vim /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=nonePEERDNS=noBRIDGE=br0vim /etc/sysconfig/network-scripts/ifcfg-br0DEVICE=br0ONBOOT=yesBOOTPROTO=noneIPADDR=172.25.254.100NETMASK=255.255.255.0PEERDNS=noTYPE=Bridge#systemctl restart network //启动两次 brctl### 桥接管理命令– show ### 显示– addbr ### 添加网桥– delbr ### 删除网桥– addif ### 添加网桥连接– delif ### 删除网桥连接2,bond网络配置(1),使用命令配置即临时配置nmcli connect add type bond con-name bond0 ifname bond0 mode active-backup ip4 172.25.254.100/24 gw4 172.25.254.250 //建立绑定接口 bond0nmcli connection add type bond-slave con-name eth0 ifname eth0 master bond0 //建立 Slave 接口 eth0nmcli connection add type bond-slave con-name eth1 ifname eth1 master bond0 //建立 Slave 接口 eth1监控watch -n 1 /proc/net/bonding/bond0需要关掉#systemctl stop NetworkManager排错,有时候不成功,需要nmcli connection show/delete/add(2), 建立绑定接口 bond0 配置文件 :#vim /etc/sysconfig/network-scripts/ifcfg-bond0DEVICE=bond0NAME=bond0TYPE=bondBOOTPROTO=noneIPADDR=172.25.254.100PREFIX0=24ONBOOT=yesBONDING_OPTS=”mode=1 miimon=50”#vim /etc/sysconfig/network-scripts/ifcfg-eth0TYPE=EthernetNAME=eth0DEVICE=eth0ONBOOT=yesMASTER=bond0SLAVE=yes##############vim /etc/sysconfig/network-scripts/ifcfg-eth1TYPE=EthernetNAME=eth1DEVICE=eth1ONBOOT=yesMASTER=bond0SLAVE=yes#vim /etc/modprobe.d/bonding.confalias bond0 bondingsystemctl restart networkcat /proc/net/bonding/bond0查看bonding状态bond默认支持两块网卡,team默认支持8块网卡3, 配置team网络配置team接口#nmcli connection add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup"}}' ip4 172.25.254.100 gw4 172.25.254.250#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#systemctl restart network#teamdctl team0 state#ifconfig eth0 down#teamdctl team0 state#ifconfig eth0 up#teamdctl team0 state