我有一个带有4个公共IP的服务器,我有这个配置,我想将接口eth0与KVM连接起来:
因此,我有3个IP (A.B.C.144,A.B.C.145,A.B.C.146)和另一个与我想连接的主IP的接口(188.165.X.Y)。
# 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所有东西(eth0,eth0:0: eth0:1,eth0:2)都正常工作,除了桥(br0)。但是,如果我做了:
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发布于 2012-06-26 16:08:59
如果你真的想把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。
https://unix.stackexchange.com/questions/41680
复制相似问题