You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

创建KVM网桥br0后主机无法被局域网外访问的问题求助

创建KVM网桥br0后主机无法被局域网外访问的问题求助

各位大佬,我碰到个棘手的问题想请教下!

我在KVM宿主机上通过/etc/network/interfaces配置了网桥br0,现在虚拟机已经能正常访问互联网了,但宿主机只能被局域网内的设备访问,外部机器根本连不上。比如用SSH连接时会直接报错:

ssh: connect to host port 22: No route to host

因为虚拟机要安装服务器类软件,必须用网桥实现网络直通,所以没办法改用NAT模式。

下面是我的/etc/network/interfaces文件完整内容:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
        address 192.168.1.26
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.1.255
        gateway 192.168.0.1
        bridge_ports enp4s0
        bridge_stp off

有没有大佬能帮忙分析下问题出在哪?怎么才能让外部机器正常访问我的宿主机呢?

备注:内容来源于stack exchange,提问作者user2282915

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 12:54:40