systemctl nmcli bond

多用户文本模式:

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

图形模式:

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

service servicename start|stop|restart|reload|status  chkconfig servicename on|off chkconfig--list

systemctl start|stop|restart|reload|status|enable|disable|is-enabled servicename systemctl list-unit-files type=service

设置第1块网卡为从卡,而主卡为bond0:

[root@linuxprobe ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777728
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=eno16777728
MASTER=bond0
SLAVE=yes

相似的方法设置第2块网卡,主卡依然为bond0:

[root@linuxprobe ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno33554968
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=eno33554968
MASTER=bond0
SLAVE=yes

创建绑定网卡的配置文件并指定IP地址等信息:

[root@linuxprobe ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond0
IPADDR=192.168.10.10
PREFIX=24
DNS=192.168.10.1
NM_CONTROLLED=no

第3步:让内核支持Bonding的驱动。

为bond0网卡添加bonding驱动的支持:

[root@linuxprobe ~]# vim /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=100 mode=6

常用的绑定驱动模式有:
mode=0平衡负载模式:平时两块网卡均工作,且自动备援,采用Switch支援。
mode=1自动备援模式:平时只有一块网卡工作,故障后自动替换为另外的网卡。
mode=6:平衡负载模式:平时两块网卡均工作,且自动备援,无须设置Switch支援。

第4步:重新加载网卡后绑定即成功。

重新加载网卡信息:

[root@linuxprobe ~]# systemctl restart network
posted @ 2016-11-08 11:24  howhy  阅读(169)  评论(0)    收藏  举报