分类: LINUX
2008-05-15 13:07:03
其中的DEVICE为设备的名称,
IPADDR为此设备的IP地址,
BROADCAST是广播地址,
NETMASK为子网掩码,
ONBOOT 表示在系统启动时自动启动。
如果需要再绑定多一个IP地址,
只需要把文件名和文件内的DEVICE中的eth0:x加一即可。
LINUX最多可以支持255个IP别名
bonding
把多块物理网卡绑为一块逻辑网卡,来做到网络负载均衡和网络冗余.
但是需要在交换机上设置连接bonding网卡的两个口子映射为同一个虚拟接口
[root@work_monitor ~]# uname -a
Linux work_monitor 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
内核2.6的无需编译内核
如果系统不支持还得把Bonding driver support以模块方式编译
[root@work_monitor ~]# modinfo bonding
filename: /lib/modules/2.6.18-8.el5/kernel/drivers/net/bonding/bonding.ko
author: Thomas Davis, tadavis@lbl.gov and many others
description: Ethernet Channel Bonding Driver, v3.0.3
version: 3.0.3
license: GPL
srcversion: 2547D22885C2FDF28EF7D98
depends:
vermagic: 2.6.18-8.el5 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1
parm: max_bonds:Max number of bonded devices (int)
parm: miimon:Link check interval in milliseconds (int)
parm: updelay:Delay before considering link up, in milliseconds (int)
parm: downdelay:Delay before considering link down, in milliseconds (int)
parm: use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)
parm: mode:Mode of operation : 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)
parm: primary:Primary network device to use (charp)
parm: lacp_rate:LACPDU tx rate to request from 802.3ad partner (slow/fast) (charp)
parm: xmit_hash_policy:XOR hashing method: 0 for layer 2 (default), 1 for layer 3+4 (charp)
parm: arp_interval:arp interval in milliseconds (int)
parm: arp_ip_target:arp targets in n.n.n.n form (array of charp)
[root@work_monitor network-scripts]# modinfo bonding
加载bonding模块以支持bonding
[root@work_monitor network-scripts]# lsmod | grep bonding
bonding 75305 0
[root@work_monitor network-scripts]# cp ifcfg-eth0 ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.1.172
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
USERCTL=no
GATEWAY=192.168.1.254
vi ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
vi ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
vi ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.1.172
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
USERCTL=no
GATEWAY=192.168.1.254
vi /etc/modprobe.conf
加入
alias bond0 bonding
options bond0 miimon=100 mode=1 primary=eth0
修改/etc/rc.d/rc.local,加入下面一行
/sbin/ifenslave bond0 eth0 eth1
就ok了
chinaunix网友2008-12-19 18:00:48
您好朋友:我现在有需求要做多网卡多IP聚合(目的增加传输带宽),链路是 多个无线网卡插主机上 与远程实现联网。目前想装XP 计划使用3年左右。我看到您这很多都是基于Uinx 和linux 的 请问在win下面能否实现? 如果没有好方法,是否可以用linux 或者uinx 以及其他的微型系统做成单一有聚合功能的联网终端,然后再接入XP电脑上?