Community discussions

MikroTik App
 
User avatar
davidolaj
just joined
Topic Author
Posts: 9
Joined: Sat Feb 24, 2024 4:13 pm

Public IP NAT Rule Issue

Sat Sep 21, 2024 11:36 pm

Hello,

I want to assign one of my WAN IPs (public IPs) to my User and I have configured my Router as below but still not working;

NAT Rule
------------
Chain: srcnat
src-address: 192.168.100.20 (private ip)

Action: netmap
To Addresses: 301.102.XX.20 (public ip)

Note! The 301.102.XX.20 already added to WAN-Ethernet in Address list.

The User WAN IP not change to the assigned Public IP.

How do I make the assigned Public IP work for the User?
 
Kanta
newbie
Posts: 35
Joined: Tue May 15, 2018 7:54 pm

Re: Public IP NAT Rule Issue

Sat Sep 21, 2024 11:39 pm

use action src-nat, not netmap.
 
User avatar
davidolaj
just joined
Topic Author
Posts: 9
Joined: Sat Feb 24, 2024 4:13 pm

Re: Public IP NAT Rule Issue

Sun Sep 22, 2024 12:01 am

Action changed to "src-nat" and still the same problem... user WAN IP not change to the 301.102.XX.20
 
Kanta
newbie
Posts: 35
Joined: Tue May 15, 2018 7:54 pm

Re: Public IP NAT Rule Issue

Sun Sep 22, 2024 12:05 am

ip 301.102.XX.20 is not a valid one, you can't change it to that. src-nat is the correct action, check the order of other nat rules and move the new one up on top.
 
User avatar
davidolaj
just joined
Topic Author
Posts: 9
Joined: Sat Feb 24, 2024 4:13 pm

Re: Public IP NAT Rule Issue

Sun Sep 22, 2024 12:22 am

IP 301.102.XX.20 is just a sample here... I'm using valid public IP.

Yes, I understand that the rule is correct but is not working on my router, I don't understand what could be the problem.

Even the action netmap should work, if not the problem.

MikroTk Guru Guys, please help out!!
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12836
Joined: Thu Mar 03, 2016 10:23 pm

Re: Public IP NAT Rule Issue

Sun Sep 22, 2024 9:27 am

What about order of NAT rules? They are evaluated from top to bottom, first one matching executes.
 
User avatar
davidolaj
just joined
Topic Author
Posts: 9
Joined: Sat Feb 24, 2024 4:13 pm

Re: Public IP NAT Rule Issue

Sun Sep 22, 2024 2:25 pm

What about order of NAT rules? They are evaluated from top to bottom, first one matching executes.
Attached images here are my settings...

The advertised network IP not route in the route list...
You do not have the required permissions to view the files attached to this post.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 12836
Joined: Thu Mar 03, 2016 10:23 pm

Re: Public IP NAT Rule Issue

Mon Sep 23, 2024 8:19 am

You have two rules in srcnat chain. The screenshots don't show all the gory details, but ... masquerade rule is higher than "normal" src-nat rule. If masquerade rule selection rules match the packets which src-nat rule is supposed to act on, then masquerade rule will do it's job and src-nat rule won't get evaluated (and executed).

If you're unsure about it, create text export of NAT section, and copy-paste them here (execute /ip/firewall/nat/export to show NAT rules only in full detail).
 
User avatar
davidolaj
just joined
Topic Author
Posts: 9
Joined: Sat Feb 24, 2024 4:13 pm

Re: Public IP NAT Rule Issue

Mon Sep 23, 2024 11:55 am

What about order of NAT rules? They are evaluated from top to bottom, first one matching executes.
I moved the src-nat rule to top and now working perfectly.

Thanks.

Who is online

Users browsing this forum: patrik99 and 17 guests