如何为多个 VLAN 运行服务?

如何为多个 VLAN 运行服务?

我在 192.168.254.1 上托管了一台正在运行的服务器,该服务器具有一些 VLAN,每个 VLAN 都可以通过 192.168.(TAG).1 进行访问。我尝试在物理连接到第一台计算机的第二台计算机上运行一项服务,并通过在 192.168.(TAG).1 上为每个 VLAN 运行该服务,使该服务可用于所有 VLAN。

第二台计算机运行 Alpine Linux,VLAN 包添加并具有如下物理接口的接口配置

auto eth0
iface eth0 inet static
    address 192.168.254.2
    netmask 255.255.255.0
    gateway 192.168.254.1

auto eth1
iface eth1 inet static
    address 192.168.254.2
    netmask 255.255.255.0
    gateway 192.168.254.1

对于网络上的每个 VLAN,如下所示

auto eth1.(TAG)
iface eth1.(TAG) inet static
    address 192.168.(TAG).2
    netmask 255.255.255.0
    gateway 192.168.(TAG).1

但该服务只有 IP 为 192.168.254.2 的服务器计算机才能访问。

当尝试从第二台计算机 ping 192.168.254.1 时,只有从 eth0 ping 时才有响应。

我可以做些什么来运行这项服务?

相关内容