2 wan routing

2 wan interface

1 wan 111.111.111.2/30
gateway 111.111.111.1

2 wan 222.222.222.2/30
gateway 222.222.222.1

1 wan routed 333.333.333.0/24

at 2 wan routed 444.444.444.0/24

ip route print

DST-ADDRESS PREF-SRC GATEWAY DISTANCE

0 AS 0.0.0.0 / 0 111.111.111.2 111.111.111.1 1
1 AS 0.0.0.0 / 0 222.222.222.2 222.222.222.1 1

check the route from the Internet to 333.333.333.100
tracert 333.333.333.100
Tracing route to 333.333.333.100
with a maximum of 30 hops:

8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 333.333.333.100



check the route from the Internet to 444.444.444.100
tracert 444.444.444.100
Tracing route to 444.444.444.100
with a maximum of 30 hops:

8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 444.444.444.100

but should

8 15 ms 19 ms 19 ms 222.222.222.2
9 16 ms 20 ms 19 ms 444.444.444.100

Change weight
ip route print

DST-ADDRESS PREF-SRC GATEWAY DISTANCE

0 AS 0.0.0.0 / 0 111.111.111.2 111.111.111.1 2
1 AS 0.0.0.0 / 0 222.222.222.2 222.222.222.1 1

check the route from the Internet to 444.444.444.100
tracert 444.444.444.100
Tracing route to 444.444.444.100
with a maximum of 30 hops:

8 15 ms 19 ms 19 ms 222.222.222.2
9 16 ms 20 ms 19 ms 444.444.444.100

everything as it should be

I set up routing to PREF-SRC consistent route?

2 wan интерфейса

1 wan 111.111.111.2/30
gateway 111.111.111.1

2 wan 222.222.222.2/30
gateway 222.222.222.1

на 1 wan маршрутизируется 333.333.333.0/24

на 2 wan маршрутизируется 444.444.444.0/24

ip route print

DST-ADDRESS PREF-SRC GATEWAY DISTANCE

0 A S 0.0.0.0/0 111.111.111.2 111.111.111.1 1
1 A S 0.0.0.0/0 222.222.222.2 222.222.222.1 1

проверяю маршрут из интернета на 333.333.333.100
tracert 333.333.333.100
Трассировка маршрута к 333.333.333.100
с максимальным числом прыжков 30:

8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 333.333.333.100



проверяю маршрут из интернета на 444.444.444.100
tracert 444.444.444.100
Трассировка маршрута к 444.444.444.100
с максимальным числом прыжков 30:

8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 444.444.444.100

а должно быть

8 15 ms 19 ms 19 ms 222.222.222.2
9 16 ms 20 ms 19 ms 444.444.444.100

меняю вес
ip route print

DST-ADDRESS PREF-SRC GATEWAY DISTANCE

0 A S 0.0.0.0/0 111.111.111.2 111.111.111.1 2
1 A S 0.0.0.0/0 222.222.222.2 222.222.222.1 1

проверяю маршрут из интернета на 444.444.444.100
tracert 444.444.444.100
Трассировка маршрута к 444.444.444.100
с максимальным числом прыжков 30:

8 15 ms 19 ms 19 ms 222.222.222.2
9 16 ms 20 ms 19 ms 444.444.444.100

все как и должно быть

как мне настроить маршрутизацию чтобы PREF-SRC соответствовал маршруту?

uh?

hi,

from the output here :

check the route from the Internet to 333.333.333.100
tracert 333.333.333.100
Tracing route to 333.333.333.100
with a maximum of 30 hops:

8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 333.333.333.100



check the route from the Internet to 444.444.444.100
tracert 444.444.444.100
Tracing route to 444.444.444.100
with a maximum of 30 hops:
8 15 ms 19 ms 19 ms 111.111.111.2
9 16 ms 20 ms 19 ms 444.444.444.100

but should

8 15 ms 19 ms 19 ms 222.222.222.2
9 16 ms 20 ms 19 ms 444.444.444.100

since you have 2 default route from those 2 WAN (forming load balanced gateway) - i think you need a policy-based routing (PBR) to redirect any traffic to 444.444.444.0/24 to be exit/enter using the WAN #2.

the documentation on mikrotik PBR is here : http://www.mikrotik.com/testdocs/ros/3.0/ip/route.php

HTH.

Unfortunaly it does not work fully

in this case
8 * * *
9 16 ms 20 ms 19 ms 444.444.444.100

but the gateway is not defined when tracing
and go to the mikrotik can not through webmin
also do not know how this will affect the account of the traffic netflow

How else can send packets to the correct route?

in addition to PBR, add src-NAT rule to masquerade router’s traffic with output-interface=wan2

in local process routing decision, wan1 is selected as default route (w/o routing-mark), with pref-src=IP_of_wan1. after routing adjustment, default gateway is changed to wan2, but src-ip remains the same

but I have no gray IP
only the real IP

sure. but as far as I understand, you need to masquerade one public IP with another one for second uplink