分类:
2010-09-14 12:25:15
目录
[root@linuxsir:/home/beinan#] uname -a
Linux linuxsir 2.6.20 #7 SMP Sun May 6 00:20:14 CST 2007 x86_64 x86_64 x86_64 GNU/Linux
[root@linuxsir:/home/beinan#] /sbin/modinfo modinfo
[root@linuxsir:/home/beinan#] modprobe bonding
[root@linuxsir:/home/beinan#] cd /usr/src/linux-2.6.20/Documentation/networking
[root@linuxsir:/home/networking#] gcc -Wall -Wstrict-prototypes -O -I/usr/src/linux-2.6.20/include ifenslave.c -o ifenslave
[root@linuxsir:/home/networking#] cp ifenslave /sbin/ifenslave
. /etc/rc.d/rc.inet1.conf
# bonding conf
/sbin/ifenslave bond0 eth0
/sbin/ifenslave bond0 eth1
/sbin/ifenslave bond0 eth2
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
GATEWAY="192.168.1.1"
#注:网关的ip地址,局域网都通过192.168.1.1 出去,可以自己根本情况来设置 ;
IFNAME[4]="bond0" #注:bond0 网络设备
HWADDR[4]="00:13:72:25:f3:6c" #注:eth0 网卡的物理地址;
IPADDR[4]="" #注:如果您用指定IP地址,就可以设置为您所指定的IP地址,要放在""之间;
NETMASK[4]="" #注:bond0的掩码,比如 255.255.255.0 类似的,这个也是根据自己的情况来设置;
USE_DHCP[4]="yes" #注:是否用DHCP,我是用DHCP ,所以我就要设置为yes ;
DHCP_HOSTNAME[4]="192.168.1.1 "
#注:DHCP 服务器主机名,比如dns.linuxsir.org也行,当然您得做DHCP 服务器了,如果没做,就用IP地址也可以 。
/sbin/modprobe bonding
alias bond0 bonding
options bonding mode=0 miimon=100
[root@linuxsir:/home/beinan#]modprobe bonding
[root@linuxsir:/home/beinan#] /sbin/ifconfig eth0 down
[root@linuxsir:/home/beinan#] /sbin/ifconfig eth0 down
[root@linuxsir:/home/beinan#] /sbin/ifconfig eth0 down
[root@linuxsir:/home/beinan#] /sbin/ifenslave bond0 eth0
[root@linuxsir:/home/beinan#] /sbin/ifenslave bond0 eth1
[root@linuxsir:/home/beinan#] /sbin/ifenslave bond0 eth2
[root@linuxsir:/home/beinan#] /sbin/ifconfig
bond0 Link encap:Ethernet HWaddr 00:23:00:a5:b3:3C
inet addr:192.168.1.171 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::213:72ff:fe25:f36c/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:601775 errors:0 dropped:0 overruns:0 frame:0
TX packets:421244 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:866655472 (826.5 Mb) TX bytes:26175996 (24.9 Mb)
eth0 Link encap:Ethernet HWaddr 00:23:00:a5:b3:3C
inet6 addr: fe80::213:72ff:fe25:f36c/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:192677 errors:0 dropped:0 overruns:0 frame:0
TX packets:138863 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:278360897 (265.4 Mb) TX bytes:9486604 (9.0 Mb)
Interrupt:17
eth1 Link encap:Ethernet HWaddr 00:23:00:a5:b3:3C
inet6 addr: fe80::213:72ff:fe25:f36c/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:206372 errors:0 dropped:0 overruns:0 frame:0
TX packets:141191 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:296700989 (282.9 Mb) TX bytes:8348311 (7.9 Mb)
Interrupt:18 Base address:0xae00
eth2 Link encap:Ethernet HWaddr 00:23:00:a5:b3:3C
inet6 addr: fe80::213:72ff:fe25:f36c/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:202726 errors:0 dropped:0 overruns:0 frame:0
TX packets:141190 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:291593586 (278.0 Mb) TX bytes:8341081 (7.9 Mb)
Interrupt:16 Base address:0xcf00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:200 (200.0 b) TX bytes:200 (200.0 b)