Community discussions

MikroTik App
 
captainproton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sat Jan 12, 2008 3:01 pm

IP-mapping

Sun Oct 12, 2008 1:39 pm

Hi,

I am using 1:1 IP mapping to map a real IP subnet to a private subnet.

private public
10.30.30.1-127 <--> x.x.x.1-127

That works fine and without problems.
Usually, when a user has 10.30.30.40 as private IP, he is mapped to x.x.x.40.
That was my intention. But sometimes it happens that he gets x.x.x.41.


Is it possible to "force-map" 40 to 40, 45 to 45, 46 to 46 and so on?
or
Is there a log, that tells me when a certain private IP as mapped to a certain public IP?



KR
 
User avatar
ashish
Long time Member
Long time Member
Posts: 546
Joined: Mon Feb 12, 2007 5:50 am
Location: Virginia, USA.

Re: IP-mapping

Mon Oct 13, 2008 6:19 am

instead of Many-to-Many you can use One-to-One MAP, In that case you have to configure seperate rules for each mapping
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: IP-mapping

Mon Oct 13, 2008 8:32 pm

are you using SAME or NETMAP action ?

Sam
 
captainproton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sat Jan 12, 2008 3:01 pm

Re: IP-mapping

Wed Oct 15, 2008 7:49 pm

ashish:
I thought about this solution, but adding 127 rules manually keept me from doing this so far. :-)

changeip:
i am using "netmap" action. is that correct?
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: IP-mapping

Wed Oct 15, 2008 8:02 pm

yes, NETMAP is the one you want. Can you post an export of your nat chain ?

/ip firewall nat export

(then just paste that rule here so we can see)

Sam
 
captainproton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sat Jan 12, 2008 3:01 pm

Re: IP-mapping

Thu Oct 16, 2008 7:30 pm

add action=netmap chain=dstnat comment="" disabled=no dst-address=85.x.x.1-85.x.x.127 \
to-addresses=10.30.30.1-10.30.30.127 to-ports=0-65535
add action=netmap chain=srcnat comment="" disabled=no src-address=10.30.30.1-10.30.30.127 \
to-addresses=85.x.x.1-85.x.x.127 to-ports=0-65535

(i have added some x-es in the post here for security)
 
shielder
Member Candidate
Member Candidate
Posts: 221
Joined: Wed Feb 09, 2005 7:09 pm
Location: Indonesia

Re: IP-mapping

Sat Oct 18, 2008 6:16 pm

you wish to map 128 ip to 128 client? i think you need to do 128 rules. if you do this config, the router would choose by itself and it's random
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: IP-mapping

Sat Oct 18, 2008 10:55 pm

shilder, thats what netmap is for, 128 identical rules is a PIA.

Try this:

add action=netmap chain=dstnat comment="" disabled=no dst-address=85.x.x.0/25 \
to-addresses=10.30.30.0/25 to-ports=0-65535

Sam

Who is online

Users browsing this forum: No registered users and 31 guests