Ubuntu/KVM 桥接接口 IP 分配

Ubuntu/KVM 桥接接口 IP 分配

我有一台运行 KVM/libvirt 的 Ubuntu 12.04 LTS 机器。它有两个物理以太网接口。我已将 eth0 专用为主要接口,并为我的虚拟机在 eth1 上配置桥接。KVM 主机 /etc/network/interfaces 如下所示:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.0.5.5
    netmask 255.255.255.0
    gateway 10.0.5.254
    dns-nameservers 10.0.5.1

# The secondary network interface
auto br0
iface br0 inet static
    address 10.0.5.6
    netmask 255.255.255.0
    gateway 10.0.5.254
    bridge_ports eth1
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

我的 KVM 客户机在 10.0.5.0/24 网络上有 IP 地址。一切正常。

我的问题是:如果我想将网络地址更改为完全不同的网络,我是否只需在客户操作系统中更改它,然后将我的 eth1 接口插入另一个网络...还是需要在主机上重新配置桥接接口?如果是这样,怎么做?我试图了解 br0 虚拟接口上的 IP 分配的作用。

答案1

br0 接口上的 IP 分配是为了让主机系统可以在该接口上通信。由于您为主机使用单独的网卡,因此您可以安全地关闭 IP 地址。如何在 Ubuntu 上实现这一点/etc/network/interfaces,我不知道,但我在 Centos 上做过。

相关内容