Community discussions

MikroTik App
 
YasserAhmad
newbie
Topic Author
Posts: 33
Joined: Mon Jul 17, 2017 9:41 pm

Force local Ip to use specific WAN

Thu Oct 29, 2020 6:49 pm

Hi
I have two WAN connections on my router board RB1036, the configuration is failover.
what I need is to force spceific IP to use the second connection whatever the circumstances are.
that IP is consuming more than 100MB/s. whenever I use these configurations below, the client (that forced to use the second connection) is suffering a lot from latency and slow internet speed.
/ip firewall mangle add chain=prerouting  src-address=192.168.1.10 \
dst-address=!192.168.1.0/24 action=mark-routing new-routing-mark=wan2

/ip firewall nat add chain=srcnat routing-mark=wan2 action=src-nat \
to-addresses=2.2.2.20

/ip route add dst-address=0.0.0.0/0 gateway=2.2.2.2 routing-mark=wan2
the second connection is fine I thought at the beggening that there was an issue with it.
is there any better idea to force routing without internet problems?

thnaks in advance
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 5929
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Force local Ip to use specific WAN  [SOLVED]

Sun Nov 01, 2020 4:41 pm

Besides the two routes created for your two ISPs........ (that use the main table), create one just for the specific IP that adds routing mark to the rule. No mangling required.
NORMAL ROUTE isp 1
NORMAL ROUTE isp 2
COPY of Route isp2 routing-mark=forceuser

Then go to the tab marked rules (just to the left of VRF)
Route Rule: src-address=192.168.1.10 action=lookup-only-in-table table=forceuser
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
MTUNA Certified, by the Ascerbic Llama!

Who is online

Users browsing this forum: No registered users and 24 guests