Community discussions

MikroTik App
 
chris8896
just joined
Topic Author
Posts: 1
Joined: Tue Apr 23, 2024 5:50 am

how to switch different ISP with Wireguard

Tue Apr 23, 2024 6:30 am

Hi

I have a 5009 what is work very nice with wireguard VPN.But I have a qurest that is I have ISP1 ISP2 ISP3.
Route to 0.0.0.0/0 distance below
ISP1 distance 1
ISP2 distance 2
ISP3 distance 3
I also have a 450x4 on the other just have a ISP, do have any mangle law.
but when I chang 450x4 wireguard peer endpoint is ISP3 IP, wireguard peer current endpoint address still show ISP1 IP.
I want all traffic 5009 to 450x4 by ISP3,not ISP1
how can i do it?
 
rplant
Member
Member
Posts: 325
Joined: Fri Sep 29, 2017 11:42 am

Re: how to switch different ISP with Wireguard

Tue Apr 23, 2024 10:20 am

The following are a couple of options.


/ip firewall nat
chain=dstnat dst-address-type=local in-interface=ISP3 protocol=udp dst-port=wg-port action=dst-nat to-addresses=ip.of.ISP.1

OR

/routing rule
add action=lookup comment="min-prefix=0, all except 0.0.0.0/0" disabled=no min-prefix=0 table=main
add action=lookup comment="return path for wg/openvpn via Wan3" disabled=no src-address=ip.of.ISP.3 table=useISP3

/ip route
add comment="Use ISP3" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=gateway.ip.of.ISP.3 routing-table=useISP3

Who is online

Users browsing this forum: abbio90, anav, Google [Bot], natman and 31 guests