Community discussions

MikroTik App
 
PrimeYeti
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Wed Mar 01, 2023 1:46 pm

Masquerade with Multiple IPs

Fri Feb 23, 2024 11:41 am

Wasn't sure about this and not in a position to test myself.

Out of interest, if I have 3 different IPs on a WAN interface and I apply a src-nat, masquerade, out=WAN interface rule, would traffic just be masqueraded as the first IP I applied to the interface? Or is there a system that the router uses to decide?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12651
Joined: Thu Mar 03, 2016 10:23 pm

Re: Masquerade with Multiple IPs

Fri Feb 23, 2024 2:04 pm

Masquerade does slight magic when deciding which IP address to use for SRC-NAT and gracefully handles changes. But I don't think it handles multiple IP addresses on egress interface in any particular way, so it probably simply uses one (possibly the first one configured).
Last edited by mkx on Fri Feb 23, 2024 3:08 pm, edited 1 time in total.
 
Mesquite
Member
Member
Posts: 420
Joined: Tue Jan 23, 2024 9:16 pm

Re: Masquerade with Multiple IPs

Fri Feb 23, 2024 2:24 pm

Interesting question.......... Maybe try out-interface-list=WAN? Although your should have covered it, if it was to every work.
 
PrimeYeti
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 65
Joined: Wed Mar 01, 2023 1:46 pm

Re: Masquerade with Multiple IPs

Fri Feb 23, 2024 3:32 pm

Thanks for the replies! That's fair, I don't really need it to work it just came up while I was working on something else and I realised I've never really thought about it. I always just assumed it just did the first address configured on the interface.

Who is online

Users browsing this forum: Bing [Bot], gfunkdave, jaclaz, pesegodinski, timotei, Usbuild and 35 guests