Community discussions

MikroTik App
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

one ip use specific gateway

Wed Mar 30, 2022 8:54 pm

Hello,
I have two wan' 192.192.168.1.254(box) and 192.168.88.1(lte).
I would like the ip of my lan 192.168.2.3 to only use wan 1 (192.168.1.254)
chain=prerouting action=mark-routing new-routing-mark=to-SERVER passthrough=yes src-address=192.168.2.3 log=no log-prefix=""
I do mark routing but each time I have the following error
PR_CONNECT_RESET_ERROR
Échec de la connexion sécurisée

Une erreur est survenue pendant une connexion à www.youtube.com. PR_CONNECT_RESET_ERROR

La page que vous essayez de consulter ne peut pas être affichée car l’authenticité des données reçues ne peut être vérifiée.
Veuillez contacter les propriétaires du site web pour les informer de ce problème.
when I do a tracert on 8.8.8.8 the path is the correct one
Détermination de l’itinéraire vers dns.google [8.8.8.8]
avec un maximum de 30 sauts :

1 <1 ms <1 ms <1 ms 192.168.2.1
2 <1 ms <1 ms <1 ms 192.168.1.254
3 39 ms 38 ms 38 ms 194.149.169.212
4 37 ms 38 ms 38 ms 194.149.166.58
5 39 ms 37 ms 39 ms 72.14.221.62

what is my mistake

thank you
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19099
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: one ip use specific gateway

Wed Mar 30, 2022 9:05 pm

Would need to see your config for a complete assessment but..........

If using vers7,...........
Need an additional route

/ip route
dst-address=0.0.0.0/0 gwy=wan1-gatewayIP useWAN1

/routing table add name=useWAN1 fib

/routing rule add src-address=192.168.2.3/32 action=lookup-only-in-table table=useWAN1
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

Re: one ip use specific gateway

Wed Mar 30, 2022 10:08 pm

hi

routing for 192.168.2.3

0000/0 gateway 192.168.1.254 roiting mark to -server
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

Re: one ip use specific gateway

Wed Mar 30, 2022 10:16 pm

hi
thank you work fine.
i don t know , i can use rule for this and not mangle table.
More easy

:D :D :D
Last edited by olivier56 on Wed Mar 30, 2022 10:20 pm, edited 2 times in total.
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

Re: one ip use specific gateway

Wed Mar 30, 2022 10:19 pm

what is "If using vers7,.."
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19099
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: one ip use specific gateway

Wed Mar 30, 2022 11:22 pm

Well the rule structure has changed between version 6 series firmware and version 7 series firmware.
The solution provided is geared towards the newer version 7 firmware.
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

Re: one ip use specific gateway

Sun Apr 03, 2022 12:48 pm

hi

sorry i upgrade to 7.15

make your code and now not good.

i do something wrong maybe
br
Last edited by olivier56 on Sun Apr 03, 2022 1:40 pm, edited 1 time in total.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19099
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: one ip use specific gateway

Sun Apr 03, 2022 1:31 pm

Without seeing your config dont know.......
If you had wanted it for vers6, you only needed to ask LOL.
/export file=anynameyouwish

Also print the IP routes page details.
 
olivier56
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Wed Aug 15, 2018 8:26 pm

Re: one ip use specific gateway

Sun Apr 03, 2022 1:42 pm

hi

sorry is my fault.

i have two ethernet in my serveur after upgrade 2019 to 2022 i forgot to switch off 2 ethernet.

work fine now.

:lol: :lol: :lol: :lol:
 
User avatar
peracchi
just joined
Posts: 11
Joined: Sat Apr 09, 2022 11:30 pm
Location: RS, Brazil

Re: one ip use specific gateway

Sat Apr 09, 2022 11:41 pm


/ip route
dst-address=0.0.0.0/0 gwy=wan1-gatewayIP useWAN1

/routing table add name=useWAN1 fib

/routing rule add src-address=192.168.2.3/32 action=lookup-only-in-table table=useWAN1

Hi, newbie here, trying to use your suggestion but maybe there is something wrong with first command that I still do not figure out.

Using RouterOS v7.2 .
 
User avatar
peracchi
just joined
Posts: 11
Joined: Sat Apr 09, 2022 11:30 pm
Location: RS, Brazil

Re: one ip use specific gateway

Sun Apr 10, 2022 12:07 am

After some trials, I think I found the right commands:
/routing table add fib name=ISP1
/routing rule add action=lookup-only-in-table src-address=10.22.22.33/32 table=ISP1
/ip route add dst-address=0.0.0.0/0 gateway=172.217.162.206 routing-table=ISP1

8)

Who is online

Users browsing this forum: cmmike, kolinsmk, PBondurant and 51 guests