Community discussions

MikroTik App
 
hettonkgb
just joined
Topic Author
Posts: 4
Joined: Fri Jun 04, 2021 3:29 am

Assigning a specific ip to use another WAN

Fri Aug 12, 2022 5:25 pm

Hello!

I've started to dig in to my Router RB1100AHx2 wich has been used to try to gain some knowledge in networking wich is very intreressting!

My goal right now is to be able to assign a specific internal ip adress to another WAN adress.

For explanation, I have 2 cords running from my mikrotik router to my fiberswitch, I've made 2 WAN interfaces (WAN1 & WAN2)
My internal ip adress pool (192.168.88.1-254) is connecting to internet trough WAN1, Is it possible to make for example ip adress 192.168.88.50 connect to internet trough WAN2 interface? And how can i achieve this? I've serched but due to my lack of knowledge i haven't been able to figure it out.

If anyone would like to explain this to me i would greatly apreciate it!
Thanks in advance!
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19099
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Assigning a specific ip to use another WAN  [SOLVED]

Fri Aug 12, 2022 8:39 pm

Sure,
default route or manual entered routes are required for both wans and they should already be on the router.
add dst-address=0.0.0.0/0 gateway=ISP1 table=main distance=5 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=ISP2 table=main distance=10

That is likely what you have in one form or the other and this ensures ALL traffic will go to WAN1.
If WAN1 is not available traffic gets sent to to WAN2 and the router keeps checking if WAN1 is up yet and will switch traffic back when it does.
What dictates this behaviour is setting the distances.

1. Now..........
Create a new table for the router to look at for available routes.
/routing table add name=useWAN2 fib

2. Next...........
Create another instance of the route for ISP2, but the third route is modified as such
add dst-address=0.0.0.0/0 gateway=ISP2 table=useWAN2 distance=10

3. Finally, to 'force' the user out WAN2, create a routing rule............
/routing rule add src-address=192.168.88.50/32 action=lookup-only-in-table table=useWAN2
 
hettonkgb
just joined
Topic Author
Posts: 4
Joined: Fri Jun 04, 2021 3:29 am

Re: Assigning a specific ip to use another WAN

Fri Aug 12, 2022 11:01 pm

Sure,
default route or manual entered routes are required for both wans and they should already be on the router.
add dst-address=0.0.0.0/0 gateway=ISP1 table=main distance=5 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=ISP2 table=main distance=10

That is likely what you have in one form or the other and this ensures ALL traffic will go to WAN1.
If WAN1 is not available traffic gets sent to to WAN2 and the router keeps checking if WAN1 is up yet and will switch traffic back when it does.
What dictates this behaviour is setting the distances.

1. Now..........
Create a new table for the router to look at for available routes.
/routing table add name=useWAN2 fib

2. Next...........
Create another instance of the route for ISP2, but the third route is modified as such
add dst-address=0.0.0.0/0 gateway=ISP2 table=useWAN2 distance=10

3. Finally, to 'force' the user out WAN2, create a routing rule............
/routing rule add src-address=192.168.88.50/32 action=lookup-only-in-table table=useWAN2
Thank you for this, Learning more each day!
Have a great weekend!

Who is online

Users browsing this forum: cdblue, CJWW, sybadi, Valerio5000 and 43 guests