コンテンツにスキップ

「Netctl でブリッジ接続」の版間の差分

提供: ArchWiki
削除された内容 追加された内容
ページの作成:「Category:ネットワーク en:Bridge with netctl {{Related articles start}} {{Related|ネットワークブリッジ}} {{Related articles end}} == インスト...」
 
同期
 
1行目: 1行目:
[[Category:ネットワーク]]
[[Category:ネットワークマネージャ]]
[[en:Bridge with netctl]]
[[en:Bridge with netctl]]
{{Related articles start}}
{{Related articles start}}
{{Related|netctl}}
{{Related|ネットワークブリッジ}}
{{Related|ネットワークブリッジ}}
{{Related articles end}}
{{Related articles end}}
7行目: 8行目:
== インストール ==
== インストール ==


[[公式リポジトリ]]から {{Pkg|netctl}} パッケージを[[インストール]]してください。
{{Pkg|netctl}} パッケージを[[インストール]]してください。


== 設定 ==
== 設定 ==
35行目: 36行目:
</nowiki>}}
</nowiki>}}
{{Tip|固定 IP を使う場合は、[[netctl]] の man ページを見て下さい。また、必要に応じて {{ic|/etc/resolv.conf}} を編集してください。}}
{{Tip|固定 IP を使う場合は、[[netctl]] の man ページを見て下さい。また、必要に応じて {{ic|/etc/resolv.conf}} を編集してください。}}

以下の例ではイーサネットデバイスの MAC アドレスをブリッジに割り当てます (参照: https://github.com/joukewitteveen/netctl/issues/111):

{{hc|/etc/netctl/bridge|<nowiki>
Description="Bridge eth0-tap0"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0 tap0)
IP=no
ExecUpPost="ip link set dev br0 address $(cat /sys/class/net/eth0/address); IP=dhcp; ip_set"
ExecDownPre="IP=dhcp"

## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes
</nowiki>}}


* {{ic|BindsToInterfaces}} オプションを編集することであらゆる組み合わせのネットワークデバイスでブリッジを作成できます。
* {{ic|BindsToInterfaces}} オプションを編集することであらゆる組み合わせのネットワークデバイスでブリッジを作成できます。

2018年6月10日 (日) 20:31時点における最新版

インストール

netctl パッケージをインストールしてください。

設定

  • /etc/netctl/examples/bridge/etc/netctl/bridge にコピー。
  • 以下の例では、br0 という名前のブリッジを作成して、実際の Ethernet アダプタ eth0 と (任意) tap デバイス tap0 を接続します。もちろん、br0, eth0, tap0 は必要に応じて編集してください。
/etc/netctl/bridge
Description="Example Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0 tap0)
IP=dhcp
  • 以下の例では br0 という名前の静的なブリッジを作成して、実際の Ethernet アダプタ eth0 を接続します。必要に応じて Interface, BindsToInterfaces, Address, Gateway を編集してください。
 /etc/netctl/bridge
Description="Example Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=static
Address='192.168.10.20/24'
Gateway='192.168.10.200'
## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes
ヒント 固定 IP を使う場合は、netctl の man ページを見て下さい。また、必要に応じて /etc/resolv.conf を編集してください。

以下の例ではイーサネットデバイスの MAC アドレスをブリッジに割り当てます (参照: https://github.com/joukewitteveen/netctl/issues/111):

/etc/netctl/bridge
Description="Bridge eth0-tap0"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0 tap0)
IP=no
ExecUpPost="ip link set dev br0 address $(cat /sys/class/net/eth0/address); IP=dhcp; ip_set"
ExecDownPre="IP=dhcp"

## Ignore (R)STP and immediately activate the bridge
SkipForwardingDelay=yes
  • BindsToInterfaces オプションを編集することであらゆる組み合わせのネットワークデバイスでブリッジを作成できます。
  • ブリッジにしたデバイス (例 eth0, tap0) で dhcpcd を有効にする場合は、dhcpcd@eth0.service停止・無効化してください。もしくは netctl のプロファイルに IP=no を設定してください。
  • 最後に、/etc/netctl/bridge起動・有効化してください。