
最近、2 つのイーサネット ポートを備えた VM に Ubuntu 20.04 をインストールしました。この 2 つのイーサネット ポートを結合しようとしているのですが、正しい方法が見つかりません。たとえば、ネットプランなしで結合するという人もいれば、ネットプランを使用してブリッジで結合するという人もいます。
私はこの分野の初心者ですが、簡単なボンディングを行う方法はありますか?
アップデート:私はこの点に到達しました:
network:
version: 2
renderer: networkd
ethernets:
eth1:
dhcp4: false
eth2:
dhcp4: false
bonds:
bond0:
dhcp4: false
interfaces:
- eth1
- eth2
parameters:
mode: balance-rr
mii-monitor-interval: 100
bridges:
br0:
dhcp4: true
interfaces:
- bond0
また、 の IP を取得できません。 を使わずにbr0
のみを使用した場合も同じことが起こります。bond0
br0
ありがとう
答え1
スクリーンショットにあるように、3 つのイーサネットがあります。eth0, eth1, eth2
にeth0
は IP があるため、これには何らかの構成があります (つまり、 configifupdown
によって/etc/network/interfaces
)。
eth1, eth2
同じスイッチとネットワークに接続されていないことを願っています。これを機能させるには、さらに設定が必要です。
やなどの他のツールifupdown
が起動に使用されていないことを確認する必要があります。 これらのツールを netplan で使用しないでください。ifaces を無効にします。つまり、 forの行を削除し、それぞれに1 行だけ追加します。または、ファイルの名前を変更するか、削除します。eth1, eth2
bond0
br0
eth1, eth2
auto
eth1, eth2
iface eth1 inet manual
/etc/network/interfaces
名前を変更または削除する場合は、 netplan config に/etc/network/interfaces
config を追加する必要があります。eth0
たとえば、私の構成にはem1, em2
イーサネットがあります。bond0
これらは一緒にあり、br0
の先頭にありますbond0
。DHCPbr0
経由で IP を取得します。br0
このサーバー上の VM からネットワークにアクセスするために必要です。私の構成:
network:
version: 2
renderer: networkd
ethernets:
em1:
dhcp4: no
dhcp6: no
em2:
dhcp4: no
dhcp6: no
bonds:
bond0:
dhcp4: no
dhcp6: no
interfaces:
- em1
- em2
macaddress: "xx:xx:xx:xx:2b:62"
parameters:
mode: 802.3ad
lacp-rate: fast
mii-monitor-interval: 100
transmit-hash-policy: layer2+3
bridges:
br0:
dhcp4: yes
dhcp6: yes
macaddress: "xx:xx:xx:xx:2b:62"
interfaces:
- bond0
の部分を削除しbridges
て に設定dhcp4: yes, dhcp6: yes
できますbond0
。これも機能し、bond0
DHCP から IP を取得できるはずです。
また、動作する構成も作成しましたifupdown2
(古いバージョンではifupdown
ifaces の依存関係を処理できないためかもしれませんが、ifupdown2
処理できます)。
答え2
あなたの設定と私の設定に基づくと、次のようなものが機能すると思います:
network:
version: 2
renderer: networkd
ethernets:
eth1:
dhcp4: false
eth2:
dhcp4: false
bonds:
bond0:
dhcp4: false
interfaces:
- eth1
- eth2
parameters:
mode: balance-rr
mii-monitor-interval: 100
bridges:
br0:
dhcp4: true
gateway4: your.gate.way.addr
interfaces:
- bond0