1、修改/etc/modprobe.conf
- alias bond0 bonding
- options bond0 miimon=100 mode=0
2、修改ifcfg-eth0/1
vim /etc/sysconfig/network-scripts/ifcfg-eth0
- DEVICE=eth0
- BOOTPROTO=none
- HWADDR=00:1B:21:72:76:04
- ONBOOT=yes
- #IPADDR=192.168.10.25
- #NETMASK=255.255.255.0
- MASTER=bond0
- SLAVE=yes
- HOTPLUG=no
vim /etc/sysconfig/network-scripts/ifcfg-eth1
- DEVICE=eth1
- HWADDR=00:1B:21:72:76:05
- ONBOOT=yes
- BOOTPROTO=none
- #IPADDR=192.168.10.26
- #NETMASK=255.255.255.0
- #GATEWAY=192.168.10.1
- MASTER=bond0
- SLAVE=yes
- HOTPLUG=no
新建ifcfg-bond0 bond0:0 bond0:1 并修改配置如下:
- [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
- DEVICE=bond0
- BOOTPROTO=none
- ONBOOT=yes
- HOTPLUG=no
- TYPE=Ethernet
- [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0:0
- DEVICE=bond0:0
- BOOTPROTO=none
- ONBOOT=yes
- HOTPLUG=no
- TYPE=Ethernet
- IPADDR=192.168.10.25
- NETMASK=255.255.255.0
- [root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0:1
- DEVICE=bond0:1
- BOOTPROTO=none
- ONBOOT=yes
- HOTPLUG=no
- TYPE=Ethernet
- IPADDR=192.168.10.26
- NETMASK=255.255.255.0
记得配上网关与dns
- [root@localhost ~]# cat /etc/sysconfig/network
- NETWORKING=yes
- NETWORKING_IPV6=yes
- HOSTNAME=local_test
- GATEWAY=192.168.10.254
- [root@localhost ~]# cat /etc/resolv.conf
- search localdomain
- nameserver 202.96.134.133
- nameserver 202.96.128.68
改完之后最好认真检查一遍,最后重启网络服务生效生效哦。。。
- service network restart
- 或
- /etc/init.d/network restart
再个最后 ,看下成果ifconfig
[root@localhost ~]#ifconfig
- bond0 Link encap:Ethernet HWaddr 00:1B:21:72:76:04
- inet6 addr: fe80::21b:21ff:fe72:7604/64 Scope:Link
- UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
- RX packets:29339967287 errors:0 dropped:0 overruns:6481 frame:0
- TX packets:24178097116 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:8343201568017 (7.5 TiB) TX bytes:4275190529231 (3.8 TiB)
- bond0:0 Link encap:Ethernet HWaddr 00:1B:21:72:76:04
- inet addr:192.168.10.25 Bcast: Mask:255.255.255.0
- UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
- bond0:1 Link encap:Ethernet HWaddr 00:1B:21:72:76:04
- inet addr:192.168.10.26 Bcast: Mask:255.255.255.0
- UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
- eth0 Link encap:Ethernet HWaddr 00:1B:21:72:76:04
- UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
- RX packets:5479527332 errors:0 dropped:0 overruns:3472 frame:0
- TX packets:19809065892 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:1576807725210 (1.4 TiB) TX bytes:3504924699492 (3.1 TiB)
- Memory:df3c0000-df3e0000
- eth1 Link encap:Ethernet HWaddr 00:1B:21:72:76:04
- UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
- RX packets:23860440060 errors:0 dropped:0 overruns:3009 frame:0
- TX packets:4369031263 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:6766393860865 (6.1 TiB) TX bytes:770265833945 (717.3 GiB)
- Memory:df3e0000-df400000
更多配置详细信息请参考以下稀世珍图: