Linux ではネットワークアダプタのチーミングを「bonding」と呼ぶ。
NetworkManager は設定を勝手に変更する(?)ようなので network を使うようにする。
# chkconfig --list | grep -i network
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig NetworkManager off
# chkconfig network on
# chkconfig --list | grep -i network
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service NetworkManager stop
# service network restart
仮想NIC名 | bond0 |
---|---|
動作モード | 6 … Active Load Balancing (ALB, 負荷分散+耐障害性, 受信アダプタ固定) |
IPアドレス設定 | 固定IP |
IPアドレス | 192.168.0.2 |
MASTER | bond0 |
SLAVE | eth0, eth1 |
/etc/modprobe.d/bonding.conf
alias bond0 bonding
options bond0 mode=6
/etc/sysconfig/network-scripts/ifcfg-bond0
# Virtual NIC bond0 setting
DEVICE=bond0
BOOTPROTO=static
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
GATEWAY=192.168.0.1
DNS1=192.168.0.2
IPV6ADDR=
IPV6PREFIX=
ONBOOT=yes
#USERCTL=no
TYPE=Ethernet
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
#NAME="System bond0"
/etc/sysconfig/network-scripts/ifcfg-eth0 (eth1も同様に。)
MACアドレス(HWADDR)はそれぞれのNICの値を設定する。
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller
DEVICE=eth0
HWADDR=XX:XX:XX:XX:XX:XX
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
動作確認
# service network restart
# ifconfig
bond0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:XXXX errors:0 dropped:0 overruns:0 frame:0
TX packets:XXXX errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:XXXX (XXXX MiB) TX bytes:XXXX (XXXX MiB)
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:XXXX errors:0 dropped:0 overruns:0 frame:0
TX packets:XXXX errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:XXXX (XXXX MiB) TX bytes:XXXX (XXXX MiB)
Interrupt:XX Base address:0xXXXX
eth1 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:XXXX errors:0 dropped:0 overruns:0 frame:0
TX packets:XXXX errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:XXXX (XXXX MiB) TX bytes:XXXX (XXXX MiB)
Interrupt:XX Base address:0xXXXX
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:XXXX errors:0 dropped:0 overruns:0 frame:0
TX packets:XXXX errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:XXXX (XXXX MiB) TX bytes:XXXX (XXXX MiB)
動作確認その2。使用するNICを指定してarping。
# arping -c 5 -I bond0 192.168.0.x
# arping -c 5 -I eth0 192.168.0.x
# arping -c 5 -I eth1 192.168.0.x