
パブリック IP が 4 つあるサーバーがあります。このサーバーを次のように構成し、KVM で使用するためにインターフェイス eth0 をブリッジしたいと考えています。
つまり、3つのIP(ABC144、ABC145、ABC146)と、ブリッジしたいメインIP(188.165.XY)を持つ別のインターフェースがあります。
/etc/ネットワーク/インターフェース:
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 188.165.X.Y
netmask 255.255.255.0
network 188.165.255.0
broadcast 188.165.255.255
gateway 188.165.255.254
# KVM Bridge
auto br0
iface br0 inet static
address 188.165.X.Y
netmask 255.255.255.0
network 188.165.255.0
broadcast 188.165.255.255
gateway 188.165.255.254
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
auto eth0:0
iface eth0:0 inet static
address A.B.C.145
netmask 255.255.255.255
auto eth0:1
iface eth0:1 inet static
address A.B.C.146
netmask 255.255.255.255
auto eth0:2
iface eth0:2 inet static
address A.B.C.147
netmask 255.255.255.255
ブリッジ (br0) を除いてすべて (eth0、eth0:0: eth0:1、eth0:2) は正常に動作しています。ただし、次の操作を行うと:
ifup br0
接続が失われ、br0 なしで構成を復元する必要があります。
どうすればいいですか?
@Ulrich 構成の場合:
device eth0 entered promiscuous mode
e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
ADDRCONF(NETDEV_UP): eth0: link is not ready
ADDRCONF(NETDEV_UP): br0: link is not ready
e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
e1000e 0000:00:19.0: eth0: 10/100 speed: disabling TSO
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
br0: port 1(eth0) entering forwarding state
br0: port 1(eth0) entering forwarding state
ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
答え1
本当に eth0 を kvm ゲストとブリッジしたい場合は、ブリッジ経由でのみ設定する必要があります。例:
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 188.165.X.Y
netmask 255.255.255.0
network 188.165.255.0
broadcast 188.165.255.255
gateway 188.165.255.254
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
ブリッジせずにルーターを作成するだけの場合 (これはネットワーク設定によって異なります)、ポートのないブリッジを作成し/etc/network/interface
、適切なルーティング エントリを作成する必要があります。libvirt は正しいブリッジを作成できますが、ブリッジには追加の IP が必要です。