Community discussions

MikroTik App
 
adamzolo
just joined
Topic Author
Posts: 7
Joined: Sun May 03, 2020 8:16 pm
Location: Ukraine, Dnipro

RouterOS 7.5 Mangle rules

Tue Jan 17, 2023 11:03 am

Hello, I have a problem after upgrading to OS7.5. I have 2 WANs on my router and I want to force multiple networks to connect to WAN2 while WAN1 is used as the primary.
At first I ran into the problem that in the new version of the OS it is impossible to add table routing by creating a mangle rule. Routing table must be created in advance in the menu Routing - Tables.
I created some Mangle rules like

Image

Image

Created a new route for mangle rules.

Image

And when I turn on the rules, I encounter a DNS error on the computer, which I forcibly send to WAN2
In version RouterOS6.4, these rules worked correctly for me and DNS was taken from the Mikrotik itself.
But in 7.5 this does not happen.
Until I manually specify the WAN2 DNS on the computer that I forcibly redirect to WAN2, the sites do not work.
And the local address specified by the computer becomes inaccessible from the same subnet to other computers.
As if the port is directly redirected to WAN2.
Like VLAN.

How to use mangle rules correctly in this scheme and tell him to use DNS Mikrotik?

DNS at me are specified manually.
My mikrotik is a local DNS server.
Allow remote request enabled
Image

I tried to add DNS WAN2 manually as an additional one - it did not solve the problem.
Be grateful for advice.
Thanks in advance.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19322
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: RouterOS 7.5 Mangle rules  [SOLVED]

Tue Jan 17, 2023 2:56 pm

Try the easier route ( pun intended) no mangling!!!!

Wan1 Route distance=X ( primary )
Wan2 Route distance=X+1 (Secondary )

Have four subnets A,B,C,D where B and C must go to WAN2
Also subnet B must be able to access subnet D and NOT get routed out wan 2 for everything.............

/routing table add fib name=useWAN2
/ip route
add dst-address=0.0.0.0/0 gwy=ISP2 gateway IP routing-table=useWAN2
/routing rules
add src-address=subnetC action=lookup table=useWAN2
add dst-address=subnetD src-address=subnetB action=lookup table=main
add src-address=subnetB action=lookup table=useWAN2


Note: if you never want subnets B,C to use WAN1 in case WAN2 goes down then
change action to action=lookup-only-in-table
 
adamzolo
just joined
Topic Author
Posts: 7
Joined: Sun May 03, 2020 8:16 pm
Location: Ukraine, Dnipro

Re: RouterOS 7.5 Mangle rules

Tue Jan 17, 2023 4:46 pm

Try the easier route ( pun intended) no mangling!!!!

Wan1 Route distance=X ( primary )
Wan2 Route distance=X+1 (Secondary )

Have four subnets A,B,C,D where B and C must go to WAN2
Also subnet B must be able to access subnet D and NOT get routed out wan 2 for everything.............

/routing table add fib name=useWAN2
/ip route
add dst-address=0.0.0.0/0 gwy=ISP2 gateway IP routing-table=useWAN2
/routing rules
add src-address=subnetC action=lookup table=useWAN2
add dst-address=subnetD src-address=subnetB action=lookup table=main
add src-address=subnetB action=lookup table=useWAN2


Note: if you never want subnets B,C to use WAN1 in case WAN2 goes down then
change action to action=lookup-only-in-table


It's solve my problem.
Thank you!

Who is online

Users browsing this forum: MarkusT, unam83 and 94 guests