2

我有 2 条连接到 Internet 的 WAN 线路:一条连接到ether1接口上,另一条连接到ether2接口上,使用 Mikrotik 路由器。

ether3连接到局域网。

每条线路都有Valid IP(静态IP)并使用PPPoE连接:

  • WAN 1 有217.219.xx.xx,正在连接pppoe1-WAN
  • WAN 2 已89.165.xx.xx连接pppoe1-WAN2

在路由中,pppoe1-WAN1距离为1pppoe1-WAN2距离2

当 WAN1 被禁用时,我可以使用 89.165.xx.xx 从办公室外连接到路由器,但当启用 WAN1 时,我无法连接到 89.165.xx.xx。

谁能帮我解决这个问题?

4

2 回答 2

4

您的解决方案在mangle设置中 - 使用以下行添加 mangle 操作:

/ip firewall mangle
add action=mark-connection chain=input comment=WAN1 in-interface=\
    pppoe-Wan1 new-connection-mark=MWAN1
add action=mark-routing chain=output connection-mark=MWAN1 new-routing-mark=\
    RWAN1 passthrough=no
add action=mark-connection chain=forward comment=WAN1PF connection-state=new \
    in-interface=pppoe-Wan1 new-connection-mark=PFMWAN1
add action=mark-routing chain=prerouting connection-mark=PFMWAN1 \
    in-interface=ehter3 new-routing-mark=RWAN1
add action=mark-connection chain=input comment=WAN2 in-interface=pppoe-WAN2 \
    new-connection-mark=MWAN2
add action=mark-routing chain=output connection-mark=MWAN2 new-routing-mark=\
    RWAN2 passthrough=no
add action=mark-connection chain=forward comment=WAN2PF connection-state=new \
    in-interface=pppoe-WAN2 new-connection-mark=PFMWAN2
add action=mark-routing chain=prerouting connection-mark=PFMWAN2 \
    in-interface=ehter3 new-routing-mark=RWAN2

然后在设置中添加此路由route

/ip route
add distance=1 gateway=pppoe-WAN2 routing-mark=RWAN2
add distance=1 gateway=pppoe-WAN1 routing-mark=RWAN1
于 2014-09-25T14:09:37.970 回答
0

这非常好,对于具有类似 IP 地址的网关,192.168.xxx.xxx最好在此规则上将“gateway=pppoe-WAN1”替换为“gateway=192.168.xxx.xxx”:

add distance=1 gateway=pppoe-WAN1 routing-mark=RWAN1
于 2017-07-06T20:21:00.087 回答