auh*_*orn 8 networking kvm interface network-bridge
我有一个 Ubuntu 服务器和一个使用 KVM 的 VM。计划是服务器和 VM 具有静态 IP 地址。我尝试结合一些可用的示例来更改 /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.50
netmask 255.255.255.0
gateway 192.168.0.1
auto br0
iface br0 inet static
address 192.168.0.51
network 192.168.0.0
netmask 255.255.255.0
gateway 192.168.0.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Run Code Online (Sandbox Code Playgroud)
如果我重新启动网络,eth0 没有 IP 地址,但 br0 有一个。这是解决方案的一部分,但不是我需要的,因为我无法再联系到主机。VM 已经配置为使用 br0,这部分“有点工作”......
任何帮助都非常感谢。
谢谢!
小智 6
你的ip应该在br0上,eth0不会有ip。像这样的事情:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
Run Code Online (Sandbox Code Playgroud)