[root@rhel75 network-scripts]# nmcli c mod bond0 +bond.options arp_validate=1
[root@rhel75 network-scripts]# nmcli c mod bond0 +bond.options fail_over_mac=none,primary=ifcfg-bond-slave-enp0s9,primary_reselect=always
※primary=ifcfg-bond-slave-enp0s9 これ間違い。正しくはif名?miiの手順参照
[root@rhel75 network-scripts]# nmcli c mod bond0 autoconnect yes
[root@rhel75 network-scripts]# nmcli c mod bond-slave-enp0s10 autoconnect yes
[root@rhel75 network-scripts]# nmcli c mod bond-slave-enp0s9 autoconnect yes
●既存のを削除
[root@rhel75 network-scripts]# nmcli c delete enp0s10
接続 'enp0s10' (e4e4d880-f588-484e-b971-841a2b151c52) が正常に削除されました。
[root@rhel75 network-scripts]# nmcli c delete enp0s9
接続 'enp0s9' (d58fc901-3df7-4a1b-a786-2897677a614e) が正常に削除されました。
●反映
[root@rhel75 network-scripts]# systemctl restart network
[root@rhel75 network-scripts]# ip a
4: enp0s9: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 08:00:27:ea:b4:c4 brd ff:ff:ff:ff:ff:ff
5: enp0s10: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 08:00:27:ea:b4:c4 brd ff:ff:ff:ff:ff:ff
7: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 08:00:27:ea:b4:c4 brd ff:ff:ff:ff:ff:ff
inet 192.168.100.113/24 brd 192.168.100.255 scope global noprefixroute bond0
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:feea:b4c4/64 scope link
valid_lft forever preferred_lft forever
[root@rhel75 ~]# nmcli c show bond0
connection.id: bond0
connection.uuid: fdc953a3-f207-43ff-91b3-0ff6c5bdd1f9
connection.stable-id: --
connection.type: bond
connection.interface-name: bond0
connection.autoconnect: はい
connection.autoconnect-priority: 0
connection.autoconnect-retries: -1 (default)
connection.auth-retries: -1
connection.timestamp: 1550948859
connection.read-only: いいえ
connection.permissions: --
connection.zone: --
connection.master: --
connection.slave-type: --
connection.autoconnect-slaves: -1 (default)
connection.secondaries: --
connection.gateway-ping-timeout: 0
connection.metered: 不明
connection.lldp: default
802-3-ethernet.port: --
802-3-ethernet.speed: 0
802-3-ethernet.duplex: --
802-3-ethernet.auto-negotiate: いいえ
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: 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.113/24
ipv4.gateway: --
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.ignore-auto-routes: いいえ
ipv4.ignore-auto-dns: いいえ
ipv4.dhcp-client-id: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: はい
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.never-default: いいえ
ipv4.may-fail: はい
ipv4.dad-timeout: -1 (default)
ipv6.method: ignore
ipv6.dns: --
ipv6.dns-search: --
ipv6.dns-options: ""
ipv6.dns-priority: 0
ipv6.addresses: --
ipv6.gateway: --
ipv6.routes: --
ipv6.route-metric: -1
ipv6.route-table: 0 (unspec)
ipv6.ignore-auto-routes: いいえ
ipv6.ignore-auto-dns: いいえ
ipv6.never-default: いいえ
ipv6.may-fail: はい
ipv6.ip6-privacy: -1 (不明)
ipv6.addr-gen-mode: stable-privacy
ipv6.dhcp-send-hostname: はい
ipv6.dhcp-hostname: --
ipv6.token: --
bond.options: arp_interval=1000,arp_ip_target=192.168.100.
proxy.method: none
proxy.browser-only: いいえ
proxy.pac-url: --
proxy.pac-script: --
GENERAL.NAME: bond0
GENERAL.UUID: fdc953a3-f207-43ff-91b3-0ff6c5bdd1f9
GENERAL.DEVICES: bond0
GENERAL.STATE: アクティベート済み
GENERAL.DEFAULT: いいえ
GENERAL.DEFAULT6: いいえ
GENERAL.SPEC-OBJECT: --
GENERAL.VPN: いいえ
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnec
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/2
GENERAL.ZONE: --
GENERAL.MASTER-PATH: --
IP4.ADDRESS[1]: 192.168.100.113/24
IP4.GATEWAY: --
IP4.ROUTE[1]: dst = 192.168.100.0/24, nh = 0.0.0.0, mt = 3
IP6.ADDRESS[1]: fe80::a00:27ff:feea:b4c4/64
IP6.GATEWAY: --
IP6.ROUTE[1]: dst = ff00::/8, nh = ::, mt = 256, table=255
IP6.ROUTE[2]: dst = fe80::/64, nh = ::, mt = 256
●テスト1
[root@rhel75 ~]# 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: enp0s9
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 1000
ARP IP target/s (n.n.n.n form): 192.168.100.111, 192.168.100.112
Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ea:b4:c4
Slave queue ID: 0
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ea:b4:c4
Slave queue ID: 0
[root@rhel75 ~]# ifdown enp0s9
デバイス 'enp0s9' が正常に切断されました。
↑ifdown ↓F/O成功
[root@rhel75 ~]# 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): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 1000
ARP IP target/s (n.n.n.n form): 192.168.100.111, 192.168.100.112
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ea:b4:c4
Slave queue ID: 0
[root@rhel75 ~]# ifup enp0s9
接続が正常にアクティベートされました (D-Bus アクティブパス: /org/freedesktop/NetworkManager/ActiveConnection/9)
↑ifup ↓enp0s10がActiveのまま
[root@rhel75 ~]# 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): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 1000
ARP IP target/s (n.n.n.n form): 192.168.100.111, 192.168.100.112
Slave Interface: enp0s10
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ea:b4:c4
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:ea:b4:c4
Slave queue ID: 0
[root@rhel75 ~]# ifdown enp0s10
デバイス 'enp0s10' が正常に切断されました。
[root@rhel75 ~]# 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: enp0s9
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 1000
ARP IP target/s (n.n.n.n form): 192.168.100.111, 192.168.100.112
Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:ea:b4:c4
Slave queue ID: 0
※一度bond0をdownさせるとスレーブをdownさせてからbond0をupさせないといけないようだ
[root@rhel75 network-scripts]# nmcli c mod bond0 +bond.options arp_ip_target="192.168.100.111 192.168.100.112",arp_interval=1000
[root@rhel75 network-scripts]# nmcli c mod bond0 +ipv6.method ignore
●arp監視のターゲットIPへの監視は同時に行われる
22:35:26.460153 08:00:27:ea:b4:c4 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 1600, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.100.114 tell 192.168.100.115, length 46
22:35:26.460749 08:00:27:ea:b4:c4 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 1600, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has ora12ee021 tell 192.168.100.115, length 46
22:35:26.461432 08:00:27:ea:b4:c4 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 1600, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.100.120 tell 192.168.100.115, length 46
●「ターゲットIPが全滅する障害」が発生後、3回目のarp監視のタイミングでF/Oが発生する
Apr 21 22:38:20 ターゲットIPを全滅させた
↓1回目、2回目のarp監視
22:39:06.236503 08:00:27:ea:b4:c4 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 1600, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.100.114 tell 192.168.100.115, length 46
22:39:36.316320 08:00:27:ea:b4:c4 (oui Unknown) > Broadcast, ethertype 802.1Q (0x8100), length 64: vlan 1600, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.100.114 tell 192.168.100.115, length 46
↓3回目の時刻にmacアドレスを変更するログが書き込まれており、F/Oしたとわかる。その後も3回ごとに繰り返しF/Oしている
Apr 21 22:40:06 rhel75 kernel: bond0: link status definitely down for interface enp0s9, disabling it
Apr 21 22:40:06 rhel75 kernel: bond0: making interface enp0s10 the new active one
Apr 21 22:40:06 rhel75 NetworkManager[700]: <info> [1555854006.4495] device (bond0.1600): set-hw-addr: set MAC address to 08:00:27:11:BF:AE (vlan-parent)
Apr 21 22:40:36 rhel75 kernel: bond0: link status definitely up for interface enp0s9
Apr 21 22:41:36 rhel75 kernel: bond0: link status definitely down for interface enp0s10, disabling it
Apr 21 22:41:36 rhel75 kernel: bond0: making interface enp0s9 the new active one
Apr 21 22:41:36 rhel75 NetworkManager[700]: <info> [1555854096.7136] device (bond0.1600): set-hw-addr: set MAC address to 08:00:27:EA:B4:C4 (vlan-parent)
Apr 21 22:42:06 rhel75 kernel: bond0: link status definitely up for interface enp0s10
Apr 21 22:43:06 rhel75 kernel: bond0: link status definitely down for interface enp0s9, disabling it
Apr 21 22:43:06 rhel75 kernel: bond0: making interface enp0s10 the new active one
Apr 21 22:43:06 rhel75 NetworkManager[700]: <info> [1555854186.9348] device (bond0.1600): set-hw-addr: set MAC address to 08:00:27:11:BF:AE (vlan-par
nmcliを使用したbonding(arp監視)
[root@rhel75 ~]# nmcli c
NAME UUID TYPE DEVICE
enp0s3 72c585c7-9bcc-4294-adf0-3cf3f5f96a70 ethernet enp0s3
enp0s8 ea146572-d89c-4a0b-8c12-de9d090fe1bf ethernet enp0s8
enp0s10 e4e4d880-f588-484e-b971-841a2b151c52 ethernet --
enp0s9 d58fc901-3df7-4a1b-a786-2897677a614e ethernet --
[root@rhel75 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:3a:02:1c brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global noprefixroute dynamic enp0s3
valid_lft 59480sec preferred_lft 59480sec
inet6 fe80::a00:27ff:fe3a:21c/64 scope link
valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:1a:38:bb brd ff:ff:ff:ff:ff:ff
inet 192.168.56.113/24 brd 192.168.56.255 scope global noprefixroute enp0s8
valid_lft forever preferred_lft forever
inet6 fe80::a00:27ff:fe1a:38bb/64 scope link
valid_lft forever preferred_lft forever
4: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:ea:b4:c4 brd ff:ff:ff:ff:ff:ff
5: enp0s10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:07:bb:2b brd ff:ff:ff:ff:ff:ff
●bond0を作成
[root@rhel75 ~]# nmcli connection add type bond autoconnect no con-name bond0 ifname bond0 mode active-backup
接続 'bond0' (fdc953a3-f207-43ff-91b3-0ff6c5bdd1f9) が正常に追加されました。
[root@rhel75 ~]# nmcli c
NAME UUID TYPE DEVICE
enp0s3 72c585c7-9bcc-4294-adf0-3cf3f5f96a70 ethernet enp0s3
enp0s8 ea146572-d89c-4a0b-8c12-de9d090fe1bf ethernet enp0s8
bond0 fdc953a3-f207-43ff-91b3-0ff6c5bdd1f9 bond --
enp0s10 e4e4d880-f588-484e-b971-841a2b151c52 ethernet --
enp0s9 d58fc901-3df7-4a1b-a786-2897677a614e ethernet --
●slaveを作成
[root@rhel75 network-scripts]# nmcli connection add type bond-slave autoconnect no ifname enp0s9 master bond0
接続 'bond-slave-enp0s9' (99bc924a-1ed4-47b1-a0fc-e133bb6bf351) が正常に追加されました。
[root@rhel75 network-scripts]# nmcli connection add type bond-slave autoconnect no ifname enp0s10 master bond0
接続 'bond-slave-enp0s10' (ddcbfdce-1247-46fa-88f0-f9a40206174b) が正常に追加されま した。
[root@rhel75 network-scripts]# nmcli c
NAME UUID TYPE DEVICE
enp0s3 72c585c7-9bcc-4294-adf0-3cf3f5f96a70 ethernet enp0s3
enp0s8 ea146572-d89c-4a0b-8c12-de9d090fe1bf ethernet enp0s8
bond-slave-enp0s10 ddcbfdce-1247-46fa-88f0-f9a40206174b ethernet --
bond-slave-enp0s9 99bc924a-1ed4-47b1-a0fc-e133bb6bf351 ethernet --
bond0 fdc953a3-f207-43ff-91b3-0ff6c5bdd1f9 bond --
enp0s10 e4e4d880-f588-484e-b971-841a2b151c52 ethernet --
enp0s9 d58fc901-3df7-4a1b-a786-2897677a614e ethernet --
●設定
[root@rhel75 network-scripts]# nmcli c mod bond0 ipv4.method manual ipv4.addresses "192.168.100.113/24"