网络配置(桥接)proxmox

use*_*549 4 networking configuration bridge proxmox kvm-virtualization

我昨天买了一个 proxmox 许可证。一切正常,只是网络配置非常复杂。我的网络配置:

84.200.50.186 -> hostsystem ip
84.200.50.186 -> VM ip
255.255.255.248 -> netmask
84.200.50.185 -> gateway


auto eth0
iface eth0 inet static
        address 84.200.50.186
        netmask 255.255.255.248
        gateway 84.200.50.185


auto vmbr0
iface vmbr0 inet static
       address  84.200.50.187
       netmask  255.255.255.248
       gateway  84.200.50.185
       bridge_ports eth0
       bridge_stp off
       bridge_fd 0
Run Code Online (Sandbox Code Playgroud)

ip 可以 ping 但虚拟机没有连接到互联网。

有任何想法吗?:-(

Mat*_*Mat 6

你的网络配置有问题。主机只需要它自己的 IP 地址,并且您必须在其一侧配置 VM 的网络,而不是在主机上配置。

vmbr0 是主机到 eth0 的网桥,所以 eth0 没有任何配置。需要在 vmbr0 接口上设置主机的 ip 地址。如果要桥接虚拟机,则需要将其桥接到 vmbr0。

假设84.200.50.187是VM的IP地址,修改主机的网络配置如下:

auto lo
iface lo inet loopback

iface eth0 inet manual

auto vmbr0
iface vmbr0 inet static
    address 84.200.50.186
    netmask 255.255.255.248
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    gateway 84.200.50.185
Run Code Online (Sandbox Code Playgroud)

在虚拟机端,配置网络如下:

  • IP 地址:84.200.50.187
  • 网络掩码:255.255.255.248
  • 网关:84.200.50.185

它应该工作。