![RouterOS 7: Configure el servidor Wireguard para admitir conexiones mediante diferentes IP de acceso WAN](https://rvso.com/image/789296/RouterOS%207%3A%20Configure%20el%20servidor%20Wireguard%20para%20admitir%20conexiones%20mediante%20diferentes%20IP%20de%20acceso%20WAN.png)
Enrutador RouterOS 7 con dos puertos WAN, WAN2 y WAN3 (puedo acceder a Winbox con ambas IP WAN sin ningún problema) y configurar un servicio Wireguard (WG). Puedo conectarme exitosamente a WG por la IP WAN3, pero no por la IP WAN2, aquí está mi configuración:
/interface ethernet
set [ find default-name=ether3 ] comment="wan2" disable-running-check=no
set [ find default-name=ether4 ] comment="wan3" disable-running-check=no
/interface wireguard
add listen-port=13231 mtu=1420 name=wireguard1
/interface wireguard peers
add allowed-address=0.0.0.0/0 interface=wireguard1 public-key="7dUlL*****axiT0="
/ip address
add address=8.1.1.169/26 comment="wan2" interface=ether3 network=8.1.1.128
add address=9.1.1.149/25 comment="wan3" interface=ether4 network=9.1.1.128
add address=10.15.8.1/24 interface=wireguard1 network=10.15.8.0
/ip firewall nat
add action=masquerade chain=srcnat comment="wan2" out-interface=ether3
add action=masquerade chain=srcnat comment="wan3" out-interface=ether4
/ip firewall mangle
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=8.1.1.128/26 in-interface=ether3 new-connection-mark=wan2conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=9.1.1.128/25 in-interface=ether4 new-connection-mark=wan3conn passthrough=yes
add action=mark-routing chain=output connection-mark=wan2conn new-routing-mark=vrf2 passthrough=no
add action=mark-routing chain=output connection-mark=wan3conn new-routing-mark=main passthrough=no
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=8.1.1.129 pref-src="" routing-table=vrf2 scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=9.1.1.145 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=10
Probé la captura de paquetes y los resultados fueron como:
1 5.132 ether3 wgclientip:50923 8.1.1.169:13231 udp 190 0
2 5.132 ether4 9.1.1.149:13231 wgclientip:50923 udp 134 0
¿El paquete 2 debería pasar por eth3, pero en su lugar por eth4? Agradezco cualquier ayuda.