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

使用MikroTik跨楼宇桥接不同网段网络的配置咨询

MikroTik跨楼宇桥接不同网段网络的配置咨询

嘿,我懂你现在的需求——你已经用同网段IP搭好了跨楼的VPLS桥接,能让两边网段的设备互通,但想把MikroTik无线链路的IP换成独立的不同网段,对吧?其实核心就是把无线点对点链路的IP和两边的业务网段分开,同时保证VPLS和桥接的逻辑正常跑就行,给你调整后的配置思路和脚本:

核心思路

把无线链路的IP放到一个单独的专用网段(比如用192.168.100.0/30这种点对点小网段,只需要2个可用IP,很省地址),两边的MikroTik分别用这个网段里的IP,只要链路能ping通,就能正常建立LDP和VPLS隧道,最终通过桥接把两边的业务网段(你的10.0.0.x网段)打通,实现全网段设备互通。

具体配置(分两端)

1. 楼宇A的MikroTik(AP模式端)

# 配置无线为AP模式,确保SSID和频段和站点端一致
interface wireless set MyWLan1 disabled=no ssid=MySiddyID band=5ghz-onlyn mode=ap-bridge
# 给无线接口配置专用链路IP
ip address add address=192.168.100.1/30 interface=MyWLan1
# 启用LDP,LSR-ID用当前链路IP即可
mpls ldp set enabled=yes lsr-id=192.168.100.1 transport-address=192.168.100.1
# 给无线接口启用LDP
mpls ldp interface add interface=MyWLan1
# 创建VPLS隧道,远端peer填楼宇B的链路IP,vpls-id两端必须完全一致
interface vpls add name=vpls1 remote-peer=192.168.100.2 vpls-id=2:2 disabled=no
# 创建桥接,把本地以太网(连接业务网段)和VPLS接口桥接
interface bridge add name=MyBridge1
interface bridge port add bridge=MyBridge1 interface=ether1
interface bridge port add bridge=MyBridge1 interface=vpls1

2. 楼宇B的MikroTik(Station模式端,基于你提供的脚本修改)

# 配置无线为站点模式,匹配AP端的SSID和频段
interface wireless set MyWLan1 disabled=no ssid=MySiddyID band=5ghz-onlyn mode=station
# 给无线接口配置专用链路IP的另一端
ip address add address=192.168.100.2/30 interface=MyWLan1
# 启用LDP,LSR-ID用当前链路IP
mpls ldp set enabled=yes lsr-id=192.168.100.2 transport-address=192.168.100.2
# 给无线接口启用LDP
mpls ldp interface add interface=MyWLan1
# 创建VPLS隧道,远端peer填楼宇A的链路IP,vpls-id和AP端一致
interface vpls add name=vpls1 remote-peer=192.168.100.1 vpls-id=2:2 disabled=no
# 创建桥接,把本地以太网和VPLS接口桥接
interface bridge add name=MyBridge1
interface bridge port add bridge=MyBridge1 interface=ether1
interface bridge port add bridge=MyBridge1 interface=vpls1

关键注意事项

  • 先确认无线链路连通性:在楼宇B的设备上ping 192.168.100.1,能通再往下走
  • 检查LDP邻居状态:用命令mpls ldp neighbor print,能看到对方的IP和状态为established就正常
  • VPLS状态验证:用interface vpls print,remote-peer状态应为connected
  • 业务网段互通:两边业务网段的设备(比如10.0.0.1和10.0.0.2)应该能互相ping通,就像在同一个局域网里一样
  • 避免DHCP冲突:如果两边业务网段有DHCP服务器,要么只留一个,要么做好DHCP中继,防止广播冲突

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.20 09:57:58