https://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&feed=atom&action=historyワイヤレスボンディング - 版の履歴2024-03-28T19:55:07Zこのウィキのこのページに関する変更履歴MediaWiki 1.34.0https://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=32738&oldid=prevKusanaginoturugi: 関連ページへのリンクを修正2023-07-07T03:25:30Z<p>関連ページへのリンクを修正</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="ja">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← 古い版</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">2023年7月7日 (金) 03:25時点における版</td>
</tr><tr>
<td colspan="2" class="diff-lineno">9行目:</td>
<td colspan="2" class="diff-lineno">9行目:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|アドホックネットワーク}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|アドホックネットワーク}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|インターネット共有}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|インターネット共有}}</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ワイヤレス設定}}</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ワイヤレス<ins class="diffchange diffchange-inline">ネットワーク</ins>設定}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|WPA supplicant}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|WPA supplicant}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ネットワークブリッジ}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ネットワークブリッジ}}</div></td>
</tr>
</table>Kusanaginoturugihttps://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=32735&oldid=prevKusanaginoturugi: 関連ページを削除2023-07-07T03:23:13Z<p>関連ページを削除</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="ja">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← 古い版</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">2023年7月7日 (金) 03:23時点における版</td>
</tr><tr>
<td colspan="2" class="diff-lineno">11行目:</td>
<td colspan="2" class="diff-lineno">11行目:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ワイヤレス設定}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ワイヤレス設定}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|WPA supplicant}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|WPA supplicant}}</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>{{Related|WPA2 Enterprise}}</div></td>
<td colspan="2" class="diff-empty"> </td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ネットワークブリッジ}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|ネットワークブリッジ}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|Netctl#ボンディング}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|Netctl#ボンディング}}</div></td>
</tr>
</table>Kusanaginoturugihttps://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=12198&oldid=prevKusakata.bot: 文字列「http://www.ibm.com/」を「https://www.ibm.com/」に置換2018-02-06T14:44:48Z<p>文字列「http://www.ibm.com/」を「https://www.ibm.com/」に置換</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="ja">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← 古い版</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">2018年2月6日 (火) 14:44時点における版</td>
</tr><tr>
<td colspan="2" class="diff-lineno">72行目:</td>
<td colspan="2" class="diff-lineno">72行目:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>These are only issues with dhclient and IPv4. Fortunately, on a dhclient DHCP request, after the lease expires, dhclient "does the right thing". dhclient will function properly no matter on which slave interface it was started.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>These are only issues with dhclient and IPv4. Fortunately, on a dhclient DHCP request, after the lease expires, dhclient "does the right thing". dhclient will function properly no matter on which slave interface it was started.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This problem '''cannot''' be solved by configuring the bonding driver with the default {{ic|1=fail_over_mac=none}}. Almost all network interface devices will not pass traffic with a MAC address which is not their own. An example of this kind of warning can be seen [<del class="diffchange diffchange-inline">http</del>://www.ibm.com/developerworks/linux/linux390/development_restrictions.html#net here]. Strange network behavior will be the result, where broadcast packets will pass, but ping/icmp packets will only pass in some circumstances and not others.</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This problem '''cannot''' be solved by configuring the bonding driver with the default {{ic|1=fail_over_mac=none}}. Almost all network interface devices will not pass traffic with a MAC address which is not their own. An example of this kind of warning can be seen [<ins class="diffchange diffchange-inline">https</ins>://www.ibm.com/developerworks/linux/linux390/development_restrictions.html#net here]. Strange network behavior will be the result, where broadcast packets will pass, but ping/icmp packets will only pass in some circumstances and not others.</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Ideally, dhclient would re-determine the bonding interface MAC address each time it initially retried contacting the DHCP server. Without that, a different approach is to simply delay the start of dhclient until after the kernel bonding driver has configured an active slave. If the active slave is to be the wireless interface, then wpa_supplicant will first have authenticated, associated, and authorized with the access point/base station, and dhclient will adopt the correct MAC address. If the active slave is the primary slave, again dhclient will adopt the correct MAC address. This delay is imposed with the simple {{ic|1=ExecStartPre= /usr/bin/sleep 8}} line in the dhclient service unit file, a conservatively long delay between the time systemd starts dhclient and the supplicant and the bonding driver selects the active interface. This selection time is longest during system boot, when many processes are starting. On faster hardware, a shorter delay, perhaps {{ic|sleep 4}}, may still be effective.</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Ideally, dhclient would re-determine the bonding interface MAC address each time it initially retried contacting the DHCP server. Without that, a different approach is to simply delay the start of dhclient until after the kernel bonding driver has configured an active slave. If the active slave is to be the wireless interface, then wpa_supplicant will first have authenticated, associated, and authorized with the access point/base station, and dhclient will adopt the correct MAC address. If the active slave is the primary slave, again dhclient will adopt the correct MAC address. This delay is imposed with the simple {{ic|1=ExecStartPre= /usr/bin/sleep 8}} line in the dhclient service unit file, a conservatively long delay between the time systemd starts dhclient and the supplicant and the bonding driver selects the active interface. This selection time is longest during system boot, when many processes are starting. On faster hardware, a shorter delay, perhaps {{ic|sleep 4}}, may still be effective.</div></td>
</tr>
</table>Kusakata.bothttps://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=11424&oldid=prevKusakata.bot: Pkg/AUR テンプレートの更新2018-01-18T13:05:19Z<p>Pkg/AUR テンプレートの更新</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="ja">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← 古い版</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">2018年1月18日 (木) 13:05時点における版</td>
</tr><tr>
<td colspan="2" class="diff-lineno">20行目:</td>
<td colspan="2" class="diff-lineno">20行目:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>全てのインターフェイスで wpa_supplicant を動作させ、必要に応じて仮想の "bond0" インターフェイスで DHCP と DHCPv6 クライアントを動かします。有線接続が使える場合は高速でセキュリティが安全な有線接続を使って、有線ができない場合は無線インターフェイスを使用したい場合に有用です。基本的なアイデアとしては有線・無線両方のインターフェイスを常時有効にして、仮想インターフェイスの "master" にボンディングし、カーネルのボンディングモジュールによってインターフェイスの切り替えを処理させています。この方法はあらゆるタイプのネットワークインターフェイスで使うことができ、複数の物理・仮想ネットワークインターフェイスを使用するようにすることもできます。</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>全てのインターフェイスで wpa_supplicant を動作させ、必要に応じて仮想の "bond0" インターフェイスで DHCP と DHCPv6 クライアントを動かします。有線接続が使える場合は高速でセキュリティが安全な有線接続を使って、有線ができない場合は無線インターフェイスを使用したい場合に有用です。基本的なアイデアとしては有線・無線両方のインターフェイスを常時有効にして、仮想インターフェイスの "master" にボンディングし、カーネルのボンディングモジュールによってインターフェイスの切り替えを処理させています。この方法はあらゆるタイプのネットワークインターフェイスで使うことができ、複数の物理・仮想ネットワークインターフェイスを使用するようにすることもできます。</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>ホストのネットワークは [[systemd]] で直接管理するため、他の接続マネージャは使用しません。ただし wpa_supplicant は {{<del class="diffchange diffchange-inline">Pkg</del>|wpa_supplicant_gui}} の {{ic|wpa_gui}} を使って直接管理することができ、新しいワイヤレスポイントやベースステーションをスキャン・選択・接続できます。</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>ホストのネットワークは [[systemd]] で直接管理するため、他の接続マネージャは使用しません。ただし wpa_supplicant は {{<ins class="diffchange diffchange-inline">AUR</ins>|wpa_supplicant_gui}} の {{ic|wpa_gui}} を使って直接管理することができ、新しいワイヤレスポイントやベースステーションをスキャン・選択・接続できます。</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>6つの [[systemd]] サービスユニットファイルを使用して、5つの設定ファイルを使用します。それぞれで [https://www.kernel.org/doc/Documentation/networking/bonding.txt カーネルのボンディングモジュール], [[wpa_supplicant]], [https://aur.archlinux.org/packages/wide-dhcpv6/ dhcp6c], {{Pkg|dhclient}}, 固定ネットワークを設定して一番に優先するネットワークインターフェイスの名前を指定しています。6つのユニットファイルは汎用のサービスユニットファイルであり、設定や編集は必要ありません。個々のサービスユニットを停止・起動・再起動してもエラーが起こることはありません。ネットワークインターフェイスのデバイス (有線またはワイヤレスカード) を取り外したり再接続すると、自動的に再設定が行われます。</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>6つの [[systemd]] サービスユニットファイルを使用して、5つの設定ファイルを使用します。それぞれで [https://www.kernel.org/doc/Documentation/networking/bonding.txt カーネルのボンディングモジュール], [[wpa_supplicant]], [https://aur.archlinux.org/packages/wide-dhcpv6/ dhcp6c], {{Pkg|dhclient}}, 固定ネットワークを設定して一番に優先するネットワークインターフェイスの名前を指定しています。6つのユニットファイルは汎用のサービスユニットファイルであり、設定や編集は必要ありません。個々のサービスユニットを停止・起動・再起動してもエラーが起こることはありません。ネットワークインターフェイスのデバイス (有線またはワイヤレスカード) を取り外したり再接続すると、自動的に再設定が行われます。</div></td>
</tr>
</table>Kusakata.bothttps://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=7750&oldid=prevKusakata.bot: 文字列「[[zh-cn:」を「[[zh-hans:」に置換2017-02-09T12:10:31Z<p>文字列「[[zh-cn:」を「[[zh-hans:」に置換</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="ja">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← 古い版</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">2017年2月9日 (木) 12:10時点における版</td>
</tr><tr>
<td colspan="2" class="diff-lineno">1行目:</td>
<td colspan="2" class="diff-lineno">1行目:</td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:無線ネットワーク]]</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[Category:無線ネットワーク]]</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[en:Wireless bonding]]</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>[[en:Wireless bonding]]</div></td>
</tr>
<tr>
<td class="diff-marker">−</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[zh-<del class="diffchange diffchange-inline">cn</del>:Wireless bonding]]</div></td>
<td class="diff-marker">+</td>
<td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[zh-<ins class="diffchange diffchange-inline">hans</ins>:Wireless bonding]]</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related articles start}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related articles start}}</div></td>
</tr>
<tr>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|Systemd}}</div></td>
<td class="diff-marker"> </td>
<td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{Related|Systemd}}</div></td>
</tr>
</table>Kusakata.bothttps://wiki.archlinux.jp/index.php?title=%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%83%9C%E3%83%B3%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0&diff=6642&oldid=prevKusakata: ページの作成:「Category:無線ネットワーク en:Wireless bonding zh-cn:Wireless bonding {{Related articles start}} {{Related|Systemd}} {{Related|ネットワーク設定...」2016-12-04T14:54:44Z<p>ページの作成:「<a href="/index.php/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:%E7%84%A1%E7%B7%9A%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF" title="カテゴリ:無線ネットワーク">Category:無線ネットワーク</a> <a href="https://wiki.archlinux.org/title/Wireless_bonding" class="extiw" title="en:Wireless bonding">en:Wireless bonding</a> <a href="https://wiki.archlinux.org/index.php/Wireless_bonding_(简体中文)" class="extiw" title="zh-cn:Wireless bonding">zh-cn:Wireless bonding</a> {{Related articles start}} {{Related|Systemd}} {{Related|ネットワーク設定...」</p>
<p><b>新規ページ</b></p><div>[[Category:無線ネットワーク]]<br />
[[en:Wireless bonding]]<br />
[[zh-cn:Wireless bonding]]<br />
{{Related articles start}}<br />
{{Related|Systemd}}<br />
{{Related|ネットワーク設定}}<br />
{{Related|Dnsmasq}}<br />
{{Related|ソフトウェアアクセスポイント}}<br />
{{Related|アドホックネットワーク}}<br />
{{Related|インターネット共有}}<br />
{{Related|ワイヤレス設定}}<br />
{{Related|WPA supplicant}}<br />
{{Related|WPA2 Enterprise}}<br />
{{Related|ネットワークブリッジ}}<br />
{{Related|Netctl#ボンディング}}<br />
{{Related|アプリケーション一覧/インターネット#ネットワーク管理}}<br />
{{Related articles end}}<br />
Linux カーネルのボンディングドライバーを使うことで複数のネットワーク接続をまとめてスループットを最大化したり、ネットワークをいつでも使えるように冗長化することができます。以下は速度が一番速い接続を選んで、ネットワークデバイスを切り替えることができるようにネットワーク接続を設定する例です。有線・無線ネットワークを自動的に切り替える設定で使用しているのは、"active-backup" モードのカーネルのボンディングモジュールと sysfs、{{Pkg|iproute2}} コマンド、{{Pkg|systemd}} のテンプレートのユニットファイルだけです。[[systemd-networkd]] は使用しません。<br />
<br />
全てのインターフェイスで wpa_supplicant を動作させ、必要に応じて仮想の "bond0" インターフェイスで DHCP と DHCPv6 クライアントを動かします。有線接続が使える場合は高速でセキュリティが安全な有線接続を使って、有線ができない場合は無線インターフェイスを使用したい場合に有用です。基本的なアイデアとしては有線・無線両方のインターフェイスを常時有効にして、仮想インターフェイスの "master" にボンディングし、カーネルのボンディングモジュールによってインターフェイスの切り替えを処理させています。この方法はあらゆるタイプのネットワークインターフェイスで使うことができ、複数の物理・仮想ネットワークインターフェイスを使用するようにすることもできます。<br />
<br />
ホストのネットワークは [[systemd]] で直接管理するため、他の接続マネージャは使用しません。ただし wpa_supplicant は {{Pkg|wpa_supplicant_gui}} の {{ic|wpa_gui}} を使って直接管理することができ、新しいワイヤレスポイントやベースステーションをスキャン・選択・接続できます。<br />
<br />
6つの [[systemd]] サービスユニットファイルを使用して、5つの設定ファイルを使用します。それぞれで [https://www.kernel.org/doc/Documentation/networking/bonding.txt カーネルのボンディングモジュール], [[wpa_supplicant]], [https://aur.archlinux.org/packages/wide-dhcpv6/ dhcp6c], {{Pkg|dhclient}}, 固定ネットワークを設定して一番に優先するネットワークインターフェイスの名前を指定しています。6つのユニットファイルは汎用のサービスユニットファイルであり、設定や編集は必要ありません。個々のサービスユニットを停止・起動・再起動してもエラーが起こることはありません。ネットワークインターフェイスのデバイス (有線またはワイヤレスカード) を取り外したり再接続すると、自動的に再設定が行われます。<br />
<br />
{{Note|Arch Linux のパッケージに含まれている標準のファイルとは異なっているため全ての systemd サービスファイルや設定ファイルを載せています。必要に応じて編集してください。}}<br />
<br />
== DHCP の設定 ==<br />
<br />
{{hc|/etc/dhclient.conf|2=<br />
# These time-outs are aggressively short, supposing a sparsely populated network.<br />
initial-interval 2;<br />
reboot 5;<br />
timeout 10;<br />
retry 20;<br />
<br />
# RFC 4361 Node-specific Identifiers for DHCPv4 February 2006<br />
send dhcp-client-identifier 00:02:00:02:2e:2d:01:bd:c3:92:9a:44:2a:c4 ;<br />
send host-name "laptop";<br />
}}<br />
<br />
DHCP Client Identifier と DHCPv6 Client Identifier の DUID が等しいことを確認してください。{{ic|xxd -g1 -s2 /var/lib/dhcpv6/dhcp6c_duid}} を見てください。DHCP サーバー (例: {{Pkg|dnsmasq}}) を設定することで MAC アドレスやホストネーム、Client Identifier にあわせて固定 IP アドレスを付与するように設定できます。<br />
<br />
{{hc|/etc/systemd/system/dhclient@.service|2=<br />
[Unit]<br />
Description= ISC dhclient on interface %I<br />
Documentation= man:dhclient(8) man:dhclient.conf(5)<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network.target<br />
Before= network.target<br />
After= network-pre.target<br />
<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
ExecStartPre= /usr/bin/sleep 8<br />
ExecStart= /usr/bin/dhclient -d -pf /run/dhclient-%i -i %I<br />
<br />
# Release the current lease and ensure that dhclient has actually stopped.<br />
ExecStop= /usr/bin/dhclient -r -pf /run/dhclient-%i<br />
ExecStop= /usr/bin/sleep 1<br />
<br />
Restart= on-abnormal<br />
<br />
[Install]<br />
WantedBy= sys-subsystem-net-devices-%i.device<br />
}}<br />
<br />
There is a particular issue to address. When ''starting'' kernel bonding, where the only working interface is the ''non''-primary slave - for instance, starting with only a wireless interface available when the wired interface is the primary - then dhclient will quickly start and adopt the MAC address of the initial primary slave, and use that MAC address when attempting to communicate with the DHCP server. When the wireless interface, some short time later, is authenticated, associated, and authorized with the access point/base station, establishing a connection to the network, the bonding driver will make the wireless interface the new active interface, and change the active MAC address on the bond0 interface, to match the wireless MAC address. Because dhclient will continue to use the MAC address from the wired interface, and that MAC address is no longer accepted by the bond0 interface, all DHCP communication will fail. If there is no saved lease file in /var/lib/dhclient/dhclient.leases, then no IPv4 address will be configured, and no IPv4 traffic will be possible. It can also be seen that when dhclient starts quickly, it can read the primary slave's firmware MAC address, rather than any MAC address assigned to the device interface. If the firmware MAC address is "null", then dhclient assigns a random MAC address. BOOTP/DHCP packets using these firmware or random MAC addresses may "succeed" in gaining a reply on the primary slave device and fail on the non-primary slave device. That can be confusing and annoying.<br />
<br />
These are only issues with dhclient and IPv4. Fortunately, on a dhclient DHCP request, after the lease expires, dhclient "does the right thing". dhclient will function properly no matter on which slave interface it was started.<br />
<br />
This problem '''cannot''' be solved by configuring the bonding driver with the default {{ic|1=fail_over_mac=none}}. Almost all network interface devices will not pass traffic with a MAC address which is not their own. An example of this kind of warning can be seen [http://www.ibm.com/developerworks/linux/linux390/development_restrictions.html#net here]. Strange network behavior will be the result, where broadcast packets will pass, but ping/icmp packets will only pass in some circumstances and not others.<br />
<br />
Ideally, dhclient would re-determine the bonding interface MAC address each time it initially retried contacting the DHCP server. Without that, a different approach is to simply delay the start of dhclient until after the kernel bonding driver has configured an active slave. If the active slave is to be the wireless interface, then wpa_supplicant will first have authenticated, associated, and authorized with the access point/base station, and dhclient will adopt the correct MAC address. If the active slave is the primary slave, again dhclient will adopt the correct MAC address. This delay is imposed with the simple {{ic|1=ExecStartPre= /usr/bin/sleep 8}} line in the dhclient service unit file, a conservatively long delay between the time systemd starts dhclient and the supplicant and the bonding driver selects the active interface. This selection time is longest during system boot, when many processes are starting. On faster hardware, a shorter delay, perhaps {{ic|sleep 4}}, may still be effective.<br />
<br />
== DHCPv6 の設定 ==<br />
<br />
{{hc|/etc/wide-dhcpv6/dhcp6c.conf|2=<br />
profile default { # generic interface using a profile named "default"<br />
send ia-na 1; # a corresponding identity association statement must exist with the same ID.<br />
# send ia-pd 2;<br />
send rapid-commit;<br />
# send authentication auth-protocol;<br />
request domain-name-servers, domain-name, ntp-servers;<br />
# script "/etc/wide-dhcpv6/dhcp6c-script";<br />
};<br />
<br />
id-assoc na 1 { # Identity Association for Non-temporary Addresses request<br />
# Optionally request a specific address.<br />
# address <ipv6-address> <pltime> [<vltime>];<br />
};<br />
<br />
keyinfo kame-key { # Required to use the dhcp6ctl tool.<br />
realm "kame.net";<br />
keyid 1;<br />
secret "ErEJ0GEz7HS3uBU03/hKZA==";<br />
# Generate with "sudo sh -c 'openssl rand -base64 16 > /etc/wide-dhcpv6/dhcp6cctlkey'".<br />
# Copy the key from /etc/wide-dhcpv6/dhcp6cctlkey<br />
};<br />
}}<br />
<br />
A simple example configuration file, with no Prefix Delegation being requested. Here, the "Profile" statement is used instead of the "Interface" statement, since the same configuration is to be applied to whatever interface is provided on the dhcp6c command line. A keyfile is required to allow dhcp6ctl to communicate with dhcp6c.<br />
<br />
{{hc|/etc/systemd/system/dhcp6c@.service|2=<br />
[Unit]<br />
Description= WIDE-DHCPv6 dhcp6c on interface %I<br />
Documentation= man:dhcp6c(8) man:dhcp6c.conf(5) man:dhcp6ctl(8)<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network.target<br />
Before= network.target<br />
After= network-pre.target<br />
<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
ExecStart= /usr/bin/dhcp6c -f -P default -c /etc/wide-dhcpv6/dhcp6c.conf %I<br />
<br />
# Configure keyinfo in /etc/wide-dhcpv6/dhcp6c.conf<br />
ExecReload= /usr/bin/dhcp6ctl reload<br />
ExecReload= /usr/bin/dhcp6ctl start interface %I<br />
<br />
ExecStop= /usr/bin/dhcp6ctl stop<br />
ExecStop= /usr/bin/sleep 1<br />
<br />
Restart= on-abnormal<br />
<br />
[Install]<br />
WantedBy= sys-subsystem-net-devices-%i.device<br />
}}<br />
<br />
== 固定ネットワークの設定 ==<br />
<br />
{{hc|/etc/conf.d/network.conf|2=<br />
# These Environment names are formed by prefixing the base variable name with the interface names.<br />
# Remember, here, these are systemd.service Environment variables, not shell variables.<br />
# Variables that are not set or that are set to the empty string will have no effect.<br />
# Add a list of interface names here, in the form of a comment, for reference.<br />
# wlp2s0 enp3s0 bond0<br />
<br />
# PRIMARY is the name of the preferred network interface in the bonded group of interfaces.<br />
bond0PRIMARY='enp3s0'<br />
<br />
# ADDRS is a single-quoted space separated list of IPv4 and IPv6 addresses to apply to the interface.<br />
# The ADDRESS must be followed by a slash and a decimal number which encodes the network prefix length.<br />
# interfaceADDRS='address1/length address2/length ...'<br />
bond0ADDRS='192.168.0.2/24'<br />
wlp2s0ADDRS=''<br />
enp3s0ADDRS=''<br />
<br />
# ROUTES is a single-quoted space separated list of double-quoted ip-route ROUTE specifications.<br />
# A PREFIX must be followed by a slash and a decimal number which encodes the network prefix length.<br />
# Remember, to be able to add a route, the host must first be able to reach the gateway.<br />
# interfaceROUTES='"to prefix1/length] via gateway1" "to prefix2/length via gateway2" ...'<br />
bond0ROUTES=''<br />
}}<br />
<br />
Here, for instance, a static private IPv4 address will be assigned to the bonding interface as a "fail-safe", were the DHCP server to fail or be otherwise inaccessible. The primary slave interface is also specified in this file.<br />
<br />
{{hc|/etc/systemd/system/static@.service|2=<br />
[Unit]<br />
Description= Static Network Configuration on %I<br />
Documentation= man:ip-address(8) man:ip-route(8) man:systemd.service(5)<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network.target<br />
Before= network.target<br />
<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
EnvironmentFile= /etc/conf.d/network.conf<br />
<br />
Type= oneshot<br />
RemainAfterExit= yes<br />
<br />
# Apparently, "ip" is not synchronous/atomic, so allow some time.<br />
ExecStart=-/usr/bin/ip link set %I up<br />
ExecStart=-/usr/bin/sh -c '[ "$%IADDRS" ] && \<br />
for a in $%IADDRS;do /usr/bin/ip address add local $$a dev %I;done'<br />
ExecStart= /usr/bin/sleep 1<br />
ExecStart=-/usr/bin/sh -c '[ "$%IROUTES" ] && \<br />
for r in ${%IROUTES};do /usr/bin/ip route replace $$r dev %I;done'<br />
<br />
ExecStop=-/usr/bin/sh -c '[ "$%IROUTES" ] && \<br />
for r in ${%IROUTES};do /usr/bin/ip route del $$r dev %I;done'<br />
ExecStop= /usr/bin/sleep 1<br />
ExecStop=-/usr/bin/sh -c '[ "$%IADDRS" ] && \<br />
for a in $%IADDRS;do /usr/bin/ip address del local $$a dev %I;done'<br />
<br />
[Install]<br />
WantedBy= sys-subsystem-net-devices-%i.device<br />
}}<br />
<br />
Of course, static network configuration may be used as an alternative to, or in addition to, dynamic network configuration, or not at all.<br />
<br />
== wpa_supplicant の設定 ==<br />
<br />
{{hc|/etc/wpa_supplicant/wpa_supplicant.conf|2=<br />
ctrl_interface=/var/run/wpa_supplicant<br />
ctrl_interface_group=wheel<br />
update_config=1<br />
eapol_version=2<br />
ap_scan=1<br />
# fast_reauth=1<br />
country=US<br />
<br />
network={<br />
ssid="MyHome"<br />
priority=2<br />
proto=RSN<br />
group=CCMP<br />
pairwise=CCMP<br />
key_mgmt=WPA-PSK<br />
#psk="SuperSecret"<br />
psk=404fe69d94ef522ba8e7a0c456a67a583c8f39ba0b29a3ac22ebe9494cf9992b<br />
}<br />
}}<br />
<br />
Be careful with the actual protocol configuration in the [[wpa_supplicant]] configuration file. Using protocols incompatible with the base station can result in unstable and otherwise difficult to troubleshoot wireless connections. Pre-compute the PSK with {{ic|wpa_passphrase ssid passphrase}}. {{ic|wpa_gui}} can overwrite this file. Note that {{ic|wpa_supplicant}} can be run on any wired or wireless interface, as needed.<br />
<br />
{{hc|/etc/systemd/system/supplicant@.service|2=<br />
[Unit]<br />
Description= wpa_supplicant on %P<br />
Documentation= man:wpa_supplicant(8) man:wpa_cli(8) man:wpa_supplicant.conf(5) man:wpa_passphrase(8)<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network-pre.target<br />
Before= network-pre.target<br />
<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
# Disable legacy 802.11b bitrates.<br />
ExecStartPre=-/usr/bin/iw %I set bitrates legacy-2.4 6 9 12 18 24 36 48 54<br />
<br />
ExecStart= /usr/bin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211,wext,wired -i %I<br />
ExecStartPost=-/usr/bin/sh -c "/usr/bin/iw phy phy`iw dev %I info{{!}}grep wiphy{{!}}cut -d' ' -f2` set distance 10"<br />
<br />
ExecReload= /usr/bin/wpa_cli -i %I reconfigure<br />
ExecReload= /usr/bin/wpa_cli -i %I reassociate<br />
<br />
ExecStop= /usr/bin/wpa_cli -i %I terminate<br />
<br />
# Reset bitrates.<br />
ExecStopPost=-/usr/bin/iw %I set bitrates<br />
<br />
Restart= on-abnormal<br />
<br />
[Install]<br />
WantedBy= sys-subsystem-net-devices-%i.device<br />
}}<br />
<br />
The supplicants and the DHCP and DHCPv6 clients are ordered relative to the network-pre.target on shutdown. The supplicants must not be stopped before the DHCP and DHCPv6 clients release their address leases.<br />
<br />
Remember that the {{ic|iw}} commands do not work with the wired interface drivers or with older wireless drivers which rely upon the Wireless Extensions user-space driver, and will be ignored in those cases.<br />
<br />
== スレーブ設定 ==<br />
<br />
{{hc|/etc/systemd/system/slave@.service|2=<br />
[Unit]<br />
Description= %P@%I Slave<br />
Documentation= https://www.kernel.org/doc/Documentation/networking/bonding.txt<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network.target<br />
Before= network.target<br />
<br />
Requires= master@%i.service<br />
After= master@%i.service<br />
<br />
Before= dhclient@%i.service<br />
Before= dhcp6c@%i.service<br />
Before= static@%i.service<br />
Before= supplicant@%p.service<br />
<br />
BindsTo= sys-subsystem-net-devices-%p.device<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
Type= oneshot<br />
RemainAfterExit= yes<br />
<br />
ExecStart=\<br />
/usr/bin/ip link set %P down ;\<br />
/usr/bin/ip address flush dev %P ;\<br />
/usr/bin/ip link set %P master %I ;\<br />
/usr/bin/ip link set %P up<br />
<br />
ExecStop=\<br />
-/usr/bin/ip link set %P nomaster ;\<br />
-/usr/bin/ip link set %P up<br />
<br />
[Install]<br />
WantedBy= master@%i.service<br />
WantedBy= sys-subsystem-net-devices-%p.device<br />
}}<br />
<br />
There is a "trick" which will be used here, in the naming of the slave service template unit files. Two environment variables are to be passed to the slave unit files, the name of the network interface, and the name of the bonding interface. Notice that there are two particular environment variables passed into a systemd unit file, %p/%P and %i/%I, these being the strings before and after the "@" character in the name of a template unit file. Here, the bonding interface name is specified in that portion of the unit file name after the "@" character, and the network interface name is passed in that portion before the "@" character. This allows two network interface names to be specified arbitrarily on the command line, without modifying the unit files themselves.<br />
<br />
This "slave@.service" unit file will be ''hard'' linked to files having the same name as the network interfaces, such as "wlp2s0@.service" and "enp3s0@.service". Note that symbolic links cannot be used here, since systemd would then set %p/%P to the target file name "slave", instead of the desired network interface name.<br />
<br />
== マスター設定 ==<br />
<br />
{{hc|/etc/modprobe.d/bonding.conf|2=<br />
# The primary slave will be configured from the systemd master unit file.<br />
<br />
options bonding max_bonds=0 miimon=100 mode=active-backup fail_over_mac=active<br />
}}<br />
<br />
{{hc|/etc/systemd/system/master@.service|2=<br />
[Unit]<br />
Description= %I Interface Master<br />
Documentation= https://www.kernel.org/doc/Documentation/networking/bonding.txt<br />
<br />
Documentation= https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/<br />
Wants= network.target<br />
Before= network.target<br />
<br />
BindsTo= sys-subsystem-net-devices-%i.device<br />
<br />
[Service]<br />
# Environment= PRI=enp3s0<br />
# Environment= PRI=wlp2s0<br />
EnvironmentFile=-/etc/conf.d/network.conf<br />
<br />
Type= oneshot<br />
RemainAfterExit= yes<br />
<br />
# Apparently, "ip" is not synchronous/atomic, so allow some time.<br />
ExecStart=\<br />
-/usr/bin/sh -c ' case %I in \<br />
*br*) /usr/bin/ip link add name %I type bridge ;; \<br />
*) /usr/bin/ip link add name %I type bond ; \<br />
echo -n $%IPRIMARY > /sys/devices/virtual/net/%I/bonding/primary ;; \<br />
esac' ;\<br />
/usr/bin/ip link set %I up ;\<br />
/usr/bin/sleep 1<br />
<br />
ExecStop=\<br />
/usr/bin/ip link delete %I ;\<br />
/usr/bin/sleep 1<br />
<br />
[Install]<br />
RequiredBy= dhclient@%i.service<br />
RequiredBy= dhcp6c@%i.service<br />
RequiredBy= static@%i.service<br />
}}<br />
<br />
Of course, "Environment=" could be used here instead of the Environment file, if static network configuration is not used, and then the Environment file could be avoided. Settings from Environment files override settings made with "Environment=".<br />
<br />
This master service unit file supports creation of a bonding master or a bridging master network interface. The type of master interface created is determined by the name of the interface. A bridging master is created when the interface name includes the character string "br", and a bonding master is created otherwise.<br />
<br />
The RequiredBy dependencies are only here to activate the stop ordering of static or dynamic network configuration units during master stop and restart. The network configurations must be taken-down and that process completed before the slave interfaces are freed and the master interface is deleted.<br />
<br />
Enable/Install a bonding master unit or bridging master unit ''only'' when the master interface is also an IP interface for the host, which is to say, when there is a static or dynamic network configuration unit Enabled/Installed on that master interface. If the bonding master or bridging master is ''not'' also an IP interface, then the master service unit should not be Enabled/Installed, since it will be started manually, or will be started by the slave service units, on boot, or when a network device is plugged.<br />
<br />
== サービスユニットの有効化・無効化 ==<br />
<br />
コマンドラインにインターフェイスの名前を指定する必要があります。<br />
<br />
ユニットファイルを編集したら、以下のコマンドを実行してください:<br />
<br />
# systemctl daemon-reload<br />
<br />
そして、デバイスを全て接続して、利用可能なネットワークインターフェイスの名前を確認:<br />
<br />
# ip address<br />
<br />
各インターフェイスをスレーブ化するために、{{ic|slave@.service}} から {{ic|''interface_name''@.service}} にハードリンクを作成:<br />
<br />
# ln /etc/systemd/system/slave@.service /etc/systemd/system/''enp3s0''@.service<br />
# ln /etc/systemd/system/slave@.service /etc/systemd/system/''wlp2s0''@.service<br />
<br />
ネットワークに接続するのにサプリカントを必要とするネットワークインターフェイスデバイスを確認してください。基本的には無線インターフェイスです。そのようなインターフェイスに対して {{ic|supplicant@.service}} ユニットを起動・有効化してください:<br />
<br />
# systemctl --now enable supplicant@wlp2s0<br />
<br />
適切なインターフェイス名を指定してスレーブ・マスターユニットを有効化・インストールします。例えば "bond0" を使用する場合:<br />
<br />
# systemctl enable enp3s0@bond0 wlp2s0@bond0 master@bond0<br />
<br />
インターフェイス名を指定して、使用したいネットワーク設定のみ明示的に有効化・インストールします。"bond0" を使用する場合:<br />
<br />
# systemctl enable dhclient@bond0 dhcp6c@bond0 static@bond0<br />
<br />
最後に {{ic|master@bond0.service}} を使ってボンディングインターフェイス、DHCP と DHCPv6 クライアント、固定ネットワーク設定を有効にします:<br />
<br />
# systemctl start master@bond0<br />
<br />
システムの起動時などにスレーブデバイスが認識されるとマスターとサプリカントユニットは自動的に起動します。DHCP, DHCPv6, スレーブユニットは独立して起動できますが、マスターユニットも起動するため、通常は起動時に実行されます。<br />
<br />
== 結果の確認 ==<br />
<br />
Check the results:<br />
<br />
# journalctl -afn100<br />
$ ip a<br />
$ ps wax<br />
<br />
{{hc|$ systemctl list-units '*bond*' '*master*' '*supplicant*'|2=<br />
UNIT LOAD ACTIVE SUB DESCRIPTION<br />
sys-devices-virtual-net-bond0.device loaded active plugged /sys/devices/virtual/net/bond0<br />
sys-subsystem-net-devices-bond0.device loaded active plugged /sys/subsystem/net/devices/bond0<br />
dhclient@bond0.service loaded active running ISC dhclient on interface bond0<br />
dhcp6c@bond0.service loaded active running WIDE-DHCPv6 dhcp6c on interface bond0<br />
enp3s0@bond0.service loaded active exited enp3s0@bond0 Slave<br />
master@bond0.service loaded active exited bond0 Interface Master<br />
static@bond0.service loaded active exited Static Network Configuration on bond0<br />
supplicant@enp3s0.service loaded inactive dead wpa_supplicant on enp3s0<br />
supplicant@wlp2s0.service loaded active running wpa_supplicant on wlp2s0<br />
wlp2s0@bond0.service loaded active exited wlp2s0@bond0 Slave<br />
system-master.slice loaded active active system-master.slice<br />
system-supplicant.slice loaded active active system-supplicant.slice<br />
<br />
LOAD = Reflects whether the unit definition was properly loaded.<br />
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.<br />
SUB = The low-level unit activation state, values depend on unit type.<br />
<br />
12 loaded units listed.<br />
To show all installed unit files use 'systemctl list-unit-files'.<br />
}}<br />
<br />
Using the wired ethernet interface,<br />
<br />
{{hc|$ cat /proc/net/bonding/bond0|<br />
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)<br />
<br />
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)<br />
Primary Slave: enp3s0 (primary_reselect always)<br />
Currently Active Slave: enp3s0<br />
MII Status: up<br />
MII Polling Interval (ms): 100<br />
Up Delay (ms): 0<br />
Down Delay (ms): 0<br />
<br />
Slave Interface: wlp2s0<br />
MII Status: up<br />
Speed: Unknown<br />
Duplex: Unknown<br />
Link Failure Count: 0<br />
Permanent HW addr: 68:a3:c4:ac:63:d1<br />
Slave queue ID: 0<br />
<br />
Slave Interface: enp3s0<br />
MII Status: up<br />
Speed: 100 Mbps<br />
Duplex: full<br />
Link Failure Count: 0<br />
Permanent HW addr: e8:9a:8f:2a:9e:e1<br />
Slave queue ID: 0<br />
}}<br />
<br />
Using the wireless interface,<br />
<br />
{{hc|$ cat /proc/net/bonding/bond0|<br />
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)<br />
<br />
Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)<br />
Primary Slave: enp3s0 (primary_reselect always)<br />
Currently Active Slave: wlp2s0<br />
MII Status: up<br />
MII Polling Interval (ms): 100<br />
Up Delay (ms): 0<br />
Down Delay (ms): 0<br />
<br />
Slave Interface: wlp2s0<br />
MII Status: up<br />
Speed: Unknown<br />
Duplex: Unknown<br />
Link Failure Count: 0<br />
Permanent HW addr: 68:a3:c4:ac:63:d1<br />
Slave queue ID: 0<br />
<br />
Slave Interface: enp3s0<br />
MII Status: down<br />
Speed: Unknown<br />
Duplex: Unknown<br />
Link Failure Count: 0<br />
Permanent HW addr: e8:9a:8f:2a:9e:e1<br />
Slave queue ID: 0<br />
}}<br />
<br />
To tear-down the bonding interface and shutdown the master, slave, DHCP, and DHCPv6 units, simply run:<br />
<br />
# systemctl stop master@bond0<br />
<br />
The supplicant units can be stopped independently with<br />
<br />
# systemctl stop supplicant@''interface_name''<br />
<br />
This approach to bonded wireless networking leaves wpa_supplicant running continuously on whatever interfaces it is started. By running {{Pkg|htop}}, it can be seen that wpa_supplicant, and the DHCP and DHCPv6 client daemons, seem to behave well, and do not use any noticeable CPU time.<br />
<br />
Still, a hardware switch or [[rfkill]] can be used to actually disable the radio when desired.<br />
<br />
Notice that the various service units are quite independent except for the ordering dependencies that have been explicitly configured. So, for instance, a dhclient configured IPv4 address may be removed without disturbing any other network configuration or functionality with<br />
<br />
# systemctl stop dhclient@bond0.service<br />
<br />
Similarly, an address may be released and a new address acquired with<br />
<br />
# systemctl restart dhclient@bond0.service<br />
<br />
And a static address or default gateway may be changed by stopping the static service unit:<br />
<br />
# systemctl stop static@bond0.service<br />
<br />
editing the network.conf file, and then starting the static service unit again:<br />
<br />
# systemctl start static@bond0.service<br />
<br />
Also, wpa_supplicant could be temporarily disabled when only the wired interface is being used, and then started again later.<br />
<br />
This bonding interface will function properly even with only one interface available, for instance, when only a wired interface is being used. And then, simply inserting a configured wireless network card, this new wireless interface will be automatically added to the bonded interface pool, and wpa_supplicant started. Removing this wireless card again will remove the slave interface and stop wpa_supplicant.<br />
<br />
Check that the Ethernet cable is actually plugged-in when wired networking is preferred. And use, for instance, {{ic|wpa_cli status}} or {{ic|iwconfig}} to verify a connection to the correct Service Set Identifier/SSID when wireless networking is used.</div>Kusakata