Page 1 of 1

IP-mapping

Posted: Sun Oct 12, 2008 1:39 pm
by captainproton
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

Re: IP-mapping

Posted: Mon Oct 13, 2008 6:19 am
by ashish
instead of Many-to-Many you can use One-to-One MAP, In that case you have to configure seperate rules for each mapping

Re: IP-mapping

Posted: Mon Oct 13, 2008 8:32 pm
by changeip
are you using SAME or NETMAP action ?

Sam

Re: IP-mapping

Posted: Wed Oct 15, 2008 7:49 pm
by captainproton
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?

Re: IP-mapping

Posted: Wed Oct 15, 2008 8:02 pm
by changeip
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

Re: IP-mapping

Posted: Thu Oct 16, 2008 7:30 pm
by captainproton
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)

Re: IP-mapping

Posted: Sat Oct 18, 2008 6:16 pm
by shielder
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

Re: IP-mapping

Posted: Sat Oct 18, 2008 10:55 pm
by changeip
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