目次
Linuxにて複数のNICを束ね冗長化・負荷分散を行う手順。
| OS | CentOS 5.3 |
| NIC | Intel PRO/1000 MT QuadPort ServerAdapter |
4ポートNICを使用し、1つの論理NICを構成する。
設定の手順は以下となる。
alias bond0 bonding options bond[n] mode=[MODE] miimon=[VALUE]
alias bond0 bonding options bond0 mode=balance-alb miimon=100 alias bond1 bonding options bond1 mode=balance-alb miimon=100
DEVICE=bond[n] BOOTPROTO=static ONBOOT=yes IPADDR=[IP ADDRESS] NETMASK=[NETMASK] NETWORK=[NETWORK ADDRESS] BROADCAST=[BROADCAST ADDRESS] GATEWAY=[DEFAULT GATEWAY]
# Linux Ethernet Bonding Driver # DEVICE=bond0 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.100.200 NETMASK=255.255.255.0 NETWORK=192.168.100.0 BROADCAST=192.168.1.255 GATEWAY=192.168.100.254
DEVICE=eth[n] BOOTPROTO=none ONBOOT=yes MASTER=bond[n] SLAVE=yes
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes MASTER=bond1 SLAVE=yes
/etc/init.d/network restart
# ifconfig
bond0 Link encap:Ethernet HWaddr 00:04:23:C6:B4:A4
inet addr:192.168.100.200 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::204:23ff:fec6:b4a4/64
Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST
MTU:1500 Metric:1
RX packets:41139981 errors:0 dropped:0
overruns:0 frame:0
TX packets:73872532 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:232665976 (221.8 MiB)
TX bytes:3337216009 (3.1 GiB)
eth0 Link encap:Ethernet HWaddr 00:04:23:D6:CA:3C
UP BROADCAST RUNNING SLAVE MULTICAST
MTU:1500 Metric:1
RX packets:67 errors:0 dropped:0
overruns:0 frame:0
TX packets:103200 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4266 (4.1 KiB)
TX bytes:6235233 (5.9 MiB)
Base address:0x9c00 Memory:fdde0000-fde00000
eth1 Link encap:Ethernet HWaddr 00:04:23:D6:CA:3D
UP BROADCAST RUNNING SLAVE MULTICAST
MTU:1500 Metric:1
RX packets:711 errors:0 dropped:0
overruns:0 frame:0
TX packets:102530 errors:0 dropped:0
overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:86431 (84.4 KiB)
TX bytes:6151106 (5.8 MiB)
Base address:0x9800 Memory:fddc0000-fdde0000
bondingモジュールにて使用できるパラメータの一覧は次の通りです。
mode=
bondingモジュールに許可された 4つのポリシーの中から1つを指定します。このパラメータに有効な値は次の通りです。