●mii監視
●IF設定
※enp0s9とenp0s10のMACをVBOXで同じにしておいた
※enp0s9とenp0s10のMACをVBOXで同じにしないとF/Oが失敗するが、MACが変えられない場合はfail_over_mac=activeを指定すれば、F/O時にbond0のmacが変わる。
[root@rhel74 network-scripts]# nmcli connection add type bond autoconnect no con-name bond0 ifname bond0 mode active-backup
接続 'bond0' (40527aa5-08e6-4d56-a35d-1706f5038e45) が正常に追加されました。
[root@rhel74 network-scripts]# nmcli connection add type bond-slave autoconnect no ifname enp0s10 con-name enp0s10 master bond0
接続 'enp0s10' (eee1180c-d275-4398-b04b-34c05934a016) が正常に追加されました。
[root@rhel74 network-scripts]# nmcli connection add type bond-slave autoconnect no ifname enp0s9 con-name enp0s9 master bond0
接続 'enp0s9' (77d8ba88-46e0-44a5-a6dd-c279d77f2287) が正常に追加されました。
[root@rhel74 network-scripts]# nmcli
enp0s3: 接続済み to enp0s3
"Intel 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)"
ethernet (e1000), 08:00:27:F0:84:FB, hw, mtu 1500
ip4 デフォルト
inet4 10.0.2.15/24
inet6 fe80::a00:27ff:fef0:84fb/64
enp0s8: 接続済み to enp0s8
"Intel 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)"
ethernet (e1000), 08:00:27:5B:9B:D9, hw, mtu 1500
inet4 192.168.56.114/24
inet6 fe80::a00:27ff:fe5b:9bd9/64
enp0s10: 切断済み
"Intel 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)"
1 接続が利用可能
ethernet (e1000), 08:00:27:AC:2B:5B, hw, mtu 1500
enp0s9: 切断済み
"Intel 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)"
1 接続が利用可能
ethernet (e1000), 08:00:27:AC:2B:5B, hw, mtu 1500
lo: 管理無し
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
DNS configuration:
servers: 192.168.0.1
domains: Planex
interface: enp0s3
[root@rhel74 network-scripts]# nmcli c mod bond0 ipv4.method manual ipv4.addresses "192.168.100.114/24"
[root@rhel74 network-scripts]# nmcli c mod bond0 +bond.options fail_over_mac=none,primary=enp0s9,primary_reselect=always
[root@rhel74 network-scripts]# nmcli c mod bond0 autoconnect yes
[root@rhel74 network-scripts]# nmcli c mod enp0s9 autoconnect yes
[root@rhel74 network-scripts]# nmcli c mod enp0s10 autoconnect yes
[root@rhel74 network-scripts]# systemctl restart network
[root@rhel74 network-scripts]# ping 192.168.100.111
PING 192.168.100.111 (192.168.100.111) 56(84) bytes of data.
64 bytes from 192.168.100.111: icmp_seq=1 ttl=64 time=0.389 ms
[root@rhel74 network-scripts]# nmcli c show bond0
connection.id: bond0
connection.uuid: 40527aa5-08e6-4d56-a35d-1706f5038e45
connection.stable-id: --
connection.interface-name: bond0
connection.type: bond
connection.自動接続: yes
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.timestamp: 1552142863
connection.read-only: no
connection.permissions: --
connection.zone: --
connection.マスター: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: 不明
connection.lldp: -1 (default)
802-3-ethernet.ポート: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: no
802-3-ethernet.mac-address: --
802-3-ethernet.cloned-mac-address: --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist: --
802-3-ethernet.mtu: 自動
802-3-ethernet.s390-subchannels: --
802-3-ethernet.s390-nettype: --
802-3-ethernet.s390-options: --
802-3-ethernet.wake-on-lan: 1 (default)
802-3-ethernet.wake-on-lan-password: --
ipv4.method: manual
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: (デフォルト)
ipv4.dns-priority: 0
ipv4.addresses: 192.168.100.114/24
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
ipv6.method: auto
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: (デフォルト)
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.ignore-auto-routes: no
ipv6.ignore-auto-dns: no
ipv6.never-default: no
ipv6.may-fail: yes
ipv6.ip6-privacy: -1 (不明)
ipv6.addr-gen-mode: stable-privacy
ipv6.dhcp-send-hostname: yes
ipv6.dhcp-hostname: --
ipv6.token: --
bond.options: fail_over_mac=none,primary_reselect=always,mode=active-backup,primary=enp0s9
proxy.method: none
proxy.browser-only: no
proxy.pac-url: --
proxy.pac-script: --
GENERAL.名前: bond0
GENERAL.UUID: 40527aa5-08e6-4d56-a35d-1706f5038e45
GENERAL.デバイス: bond0
GENERAL.状態: アクティベート済み
GENERAL.デフォルト: いいえ
GENERAL.デフォルト6: いいえ
GENERAL.VPN: いいえ
GENERAL.ゾーン: --
GENERAL.DBUS パス: /org/freedesktop/NetworkManager/ActiveConnection/35
GENERAL.CON パス: /org/freedesktop/NetworkManager/Settings/13
GENERAL.スペックオブジェクト: --
GENERAL.マスターパス: --
IP4.アドレス[1]: 192.168.100.114/24
IP4.ゲートウェイ: --
IP6.アドレス[1]: fe80::a657:3e94:5b6d:6dd6/64
IP6.ゲートウェイ: --
[root@rhel74 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp0s9 (primary_reselect always)
Currently Active Slave: enp0s9
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
[root@rhel74 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="primary_reselect=always fail_over_mac=none mode=active-backup primary=enp0s9"
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=bond0
UUID=40527aa5-08e6-4d56-a35d-1706f5038e45
ONBOOT=yes
IPADDR=192.168.100.114
PREFIX=24
[root@rhel74 network-scripts]# cat ifcfg-enp0s9
TYPE=Ethernet
NAME=enp0s9
UUID=77d8ba88-46e0-44a5-a6dd-c279d77f2287
DEVICE=enp0s9
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@rhel74 network-scripts]# cat ifcfg-enp0s10
TYPE=Ethernet
NAME=enp0s10
UUID=eee1180c-d275-4398-b04b-34c05934a016
DEVICE=enp0s10
ONBOOT=yes
MASTER=bond0
SLAVE=yes
●テスト
a)マスターインターフェースを起動しても、スレーブインターフェースは自動的に起動されない。->OK
b)スレーブインターフェースを起動すると、マスターインターフェースは毎回、自動的に起動される。->OK
c)マスターインターフェースを停止すると、スレーブインターフェースも停止される。->OK
d)enp0s10→enp0s9の順に起動してもenp0s9がactiveになる->OK
e)enp0s9停止→enp0s9起動でenp0s9がactiveになる->OK
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
bond0 bond 接続済み bond0
enp0s10 ethernet 接続済み enp0s10
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s9 ethernet 接続済み enp0s9
lo loopback 管理無し --
[root@rhel74 network-scripts]# ifdown bond0
デバイス 'bond0' が正常に切断されました。
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s10 ethernet 切断済み --
enp0s9 ethernet 切断済み --
lo loopback 管理無し --
↑c)OK
[root@rhel74 network-scripts]# ifup bond0
接続が正常にアクティベートされました (マスターはスレーブを待機しています) (D-Bus ア クティブパス: /org/freedesktop/NetworkManager/ActiveConnection/40)
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
bond0 bond 接続済み bond0
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s10 ethernet 切断済み --
enp0s9 ethernet 切断済み --
lo loopback 管理無し --
[root@rhel74 network-scripts]# ifdown bond0
デバイス 'bond0' が正常に切断されました。
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s10 ethernet 切断済み --
enp0s9 ethernet 切断済み --
lo loopback 管理無し --
↑a)OK
[root@rhel74 network-scripts]# ifup enp0s10
接続が正常にアクティベートされました (D-Bus アクティブパス: /org/freedesktop/NetworkManager/ActiveConnection/41)
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
bond0 bond 接続済み bond0
enp0s10 ethernet 接続済み enp0s10
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s9 ethernet 切断済み --
lo loopback 管理無し --
↑b)OK
[root@rhel74 network-scripts]# ifup enp0s9
接続が正常にアクティベートされました (D-Bus アクティブパス: /org/freedesktop/NetworkManager/ActiveConnection/43)
[root@rhel74 network-scripts]# nmcli device status
デバイス タイプ 状態 接続
bond0 bond 接続済み bond0
enp0s10 ethernet 接続済み enp0s10
enp0s3 ethernet 接続済み enp0s3
enp0s8 ethernet 接続済み enp0s8
enp0s9 ethernet 接続済み enp0s9
lo loopback 管理無し --
[root@rhel74 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp0s9 (primary_reselect always)
Currently Active Slave: enp0s9
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
↑d)OK
[root@rhel74 network-scripts]# ifdown enp0s9
デバイス 'enp0s9' が正常に切断されました。
[root@rhel74 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: enp0s10
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
[root@rhel74 network-scripts]# ifup enp0s9
接続が正常にアクティベートされました (D-Bus アクティブパス: /org/freedesktop/NetworkManager/ActiveConnection/44)
[root@rhel74 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp0s9 (primary_reselect always)
Currently Active Slave: enp0s10
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
Slave Interface: enp0s9
MII Status: down
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
↑enp0s9に戻らず、数秒たったら戻った↓
[root@rhel74 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: enp0s9 (primary_reselect always)
Currently Active Slave: enp0s9
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ac:2b:5b
Slave queue ID: 0
↑e)OK
●fail_over_mac=activeの実験
[root@rhel74 ~]# nmcli c mod bond0 +bond.options fail_over_mac=active
[root@rhel74 ~]# systemctl poweroff
※macアドレスを変更後、起動
[root@rhel74 ~]# ip a
4: enp0s9: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 08:00:27:fc:26:7c brd ff:ff:ff:ff:ff:ff
5: enp0s10: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 08:00:27:d6:a7:1a brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 08:00:27:fc:26:7c brd ff:ff:ff:ff:ff:ff
inet 192.168.100.114/24 brd 192.168.100.255 scope global bond0
valid_lft forever preferred_lft forever
↑bond0のmac=enp0s9のmacになっている
[root@rhel74 ~]# nmcli device disconnect enp0s9
デバイス 'enp0s9' が正常に切断されました。
[root@rhel74 ~]# ip a
4: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:fc:26:7c brd ff:ff:ff:ff:ff:ff
5: enp0s10: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 08:00:27:d6:a7:1a brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 08:00:27:d6:a7:1a brd ff:ff:ff:ff:ff:ff
inet 192.168.100.114/24 brd 192.168.100.255 scope global bond0
valid_lft forever preferred_lft forever
↑bond0のmac=enp0s10のmacになっている
[root@rhel74 ~]# nmcli connection up enp0s9
接続が正常にアクティベートされました (D-Bus アクティブパス: /org/freedesktop/NetworkManager/ActiveConnection/6)
[root@rhel74 ~]# ip a
4: enp0s9: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 08:00:27:fc:26:7c brd ff:ff:ff:ff:ff:ff
5: enp0s10: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 08:00:27:d6:a7:1a brd ff:ff:ff:ff:ff:ff
6: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 08:00:27:fc:26:7c brd ff:ff:ff:ff:ff:ff
inet 192.168.100.114/24 brd 192.168.100.255 scope global bond0
valid_lft forever preferred_lft forever
↑bond0のmac=enp0s9のmacに戻っている
おまけ
<Active変更>
[root@ora12ee02 ~]# ifenslave -c bond0 enp0s9