Community discussions

MikroTik App
 
essides
newbie
Topic Author
Posts: 48
Joined: Fri Mar 10, 2017 6:18 pm
Location: Spain

Routing using VRRP Interfaces

Thu Oct 21, 2021 10:24 am

Hi there,

My internet provider requests a IP per MAC, so I had to use VRRP Hack to achive it.
So I got my 6 public ip's in same range

x.x.x.246
x.x.x.247
x.x.x.248
...

Image

Provided gateway is : x.x.x.1
I create a firewall rule to masquerade those interfaces.

Image

At this point everything is OK, but problem is that gateway is same for all interfaces, 0.0.0.0/0 is reachable by last interface to be turned on.

Image

Then all internet traffic goes to this interface and always get same public IP,

How can I set routes to 0.0.0.0/0 if always gateways is reachable by last interface?

thanks you.
 
sindy
Forum Guru
Forum Guru
Posts: 10205
Joined: Mon Dec 04, 2017 9:19 pm

Re: Routing using VRRP Interfaces  [SOLVED]

Sun Oct 24, 2021 8:42 pm

If you insist that the packets will leave with the source MAC address of the respective VRRP interface, you have to use multiple routing tables, one per each VRRP interface, and in each of them, create a default route with gateway=ga.te.way.ip%vrrpN manually. So for two interfaces, it would look as follows:

/ip route
add gateway=ga.te.way.ip%vrrp1 routing-mark=via-vrrp1
add gateway=ga.te.way.ip%vrrp2 routing-mark=via-vrrp2


And you'd then assign these routing-mark values to packets being routed towards the internet using /ip firewall mangle rules or /ip route rule rules.

But if you don't need the source MAC addresses to match the source IP addresses, mere src-nat rules should be sufficient.
 
essides
newbie
Topic Author
Posts: 48
Joined: Fri Mar 10, 2017 6:18 pm
Location: Spain

Re: Routing using VRRP Interfaces

Mon Oct 25, 2021 11:41 am

it works!

Thanks you.
 
stevester
just joined
Posts: 8
Joined: Wed Feb 22, 2023 3:53 am

Re: Routing using VRRP Interfaces

Wed Feb 22, 2023 4:25 am

New to MikroTik but I have this same issue where the gateway is the same for all interfaces and 0.0.0.0/0 is only reachable by the last interface to be turned on.

Could you elaborate on this step here:
And you'd then assign these routing-mark values to packets being routed towards the internet using /ip firewall mangle rules or /ip route rule rules.
Just not sure how to set this up.

Thanks in advance.

Who is online

Users browsing this forum: bananaboy1101, Bing [Bot], dido1236, jamesperks, tinodj, xristostsilis and 82 guests