Community discussions

MikroTik App
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

NAT question ( is it a bug ?)

Thu Nov 24, 2011 11:25 am

Hi to all,
I would to have a NAT 1:1 in my network.

I configured on my RouterOS 5.8 a public interface with 10 ip address and I would to redirect traffic to host in my lan.

I added all 10 ip addresses on public interface of router and used this configuration natting:

ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=dst-nat to-addresses=192.168.0.1

ip firewall nat add chain=srcnat src-address=192.168.0.2 action=src-nat to-addresses="IP PUBLIC 2"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 2" action=dst-nat to-addresses=192.168.0.2

etc ....

in this way I configured NAT 1:1 between each public ip address to a local lan ip address...
The question is: when the routeros try to communicate to the internet which ip address it will use???
Last edited by leon84 on Mon Nov 28, 2011 11:55 am, edited 1 time in total.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Thu Nov 24, 2011 11:32 am

maybe with src natting and destination natting to localhost ????
 
User avatar
JP_Wireless
Member Candidate
Member Candidate
Posts: 276
Joined: Thu Dec 13, 2007 4:31 pm
Location: Lagos Nigeria
Contact:

Re: NAT question

Thu Nov 24, 2011 11:35 am

Do your public ip's all have internet access? What configuration do you have on your ip/route?
 
User avatar
Intrepid
newbie
Posts: 38
Joined: Sat Feb 12, 2011 1:20 am

Re: NAT question

Thu Nov 24, 2011 11:42 am

 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Thu Nov 24, 2011 2:58 pm

Yes all ip public have internet access.
Do your public ip's all have internet access? What configuration do you have on your ip/route?
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Thu Nov 24, 2011 3:00 pm

I think, maybe, the solution for me is:

ip firewall nat add chain=srcnat src-address=127.0.0.1 action=src-nat to-addresses="IP PUBLIC PREFERRED"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC PREFERRED" action=dst-nat to-addresses=127.0.0.1

Do you think it is correct?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: NAT question

Thu Nov 24, 2011 4:15 pm

/ip firewall nat add chain=srcnat dst-adress-type=local action=src-nat to-address=1.1.1.1
No need for destination NAT - after all, traffic is to the router itself.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Thu Nov 24, 2011 4:21 pm

mmm... I need destination natting only if I would to redirect my public preferred address to router itself right?

In particular:
If I want only that router os can communicate with internet I use only source nat.
But If I would to connect via winbox trought Internet then I must enable destination natting too ... right?
/ip firewall nat add chain=srcnat dst-adress-type=local action=src-nat to-address=1.1.1.1
No need for destination NAT - after all, traffic is to the router itself.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: NAT question

Thu Nov 24, 2011 4:33 pm

No. You have it completely backwards.

You use whichever IP address isn't destination NATed to an inside host. The router can listen on ALL IP addresses configured on its interfaces, but will sometimes - when you configure destination NAT - send that traffic to somewhere else rather than listen to it. So your problem isn't what destination NAT rule to apply, but your problem is NOT to apply destination NAT at all for traffic that is destined to the router directly. It's already going to the router because the destination IP address is one configured on a router interface, after all.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Thu Nov 24, 2011 5:31 pm

Oh thanks it's correct ... thanks a lot
No. You have it completely backwards.
You use whichever IP address isn't destination NATed to an inside host. The router can listen on ALL IP addresses configured on its interfaces, but will sometimes - when you configure destination NAT - send that traffic to somewhere else rather than listen to it. So your problem isn't what destination NAT rule to apply, but your problem is NOT to apply destination NAT at all for traffic that is destined to the router directly. It's already going to the router because the destination IP address is one configured on a router interface, after all.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Fri Nov 25, 2011 1:40 pm

I have a new problem ....

I would always do a NAT 1:1 but I would also providing a firewall then I use this configuration:

ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=dst-nat to-addresses=192.168.0.1

this is the firewall :

79 chain=forward action=accept connection-state=established protocol=tcp
dst-address=192.168.0.1 dst-port=!1-1024

80 chain=forward action=accept connection-state=related protocol=tcp
dst-address=192.168.0.1 dst-port=!1-1024

81 chain=forward action=accept protocol=udp dst-address=192.168.0.1
dst-port=!1-1024

82 chain=forward action=accept src-address=192.168.0.1

82 chain=forward action=drop

Is it impossibile for 192.168.0.1 to access the internet for a telnet to a remote host specified with an ip address and not name.

Why ?
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Fri Nov 25, 2011 4:07 pm

I did an other test.
I used a packet sniffer betwenn remote server and mikrotik router os and:

- When I run "Telnet remote server" on 192.168.0.1 the remote server reply correctly. I see packets with source port 23 and ip address of remote host destinated to IP PUBLIC 1.
- in public interface of router os with torch tool I see the remote host that send packet with source port 23 to my IP PUBLIC 1.

I think the problem is that this packet are not forwarded to 192.168.0.1 ... Why ????
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Fri Nov 25, 2011 10:00 pm

I attach you a layout of network.
Please, consider, 172.16.0.0/24 public ip addresses.

I disabled firewall on router os and now I have only this configuration:

ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="172.16.0.1"
ip firewall nat add chain=dstnat dst-address="172.16.0.1" action=dst-nat to-addresses=192.168.0.1

ip firewall nat add chain=srcnat src-address=192.168.0.2 action=src-nat to-addresses="172.16.0.5"
ip firewall nat add chain=dstnat dst-address="172.16.0.5" action=dst-nat to-addresses=192.168.0.2

etc ....

then I inserted between router os public interface and ISP router a packet sniffer and :
1) when I run "telnet to remote host on 192.168.0.1" I see on sniffer :
172.16.0.1 -> remote host
and
remote host -> 172.16.0.1
2) on public interface of router of I see:
remote host -> 172.16.0.1

Then, I think that the source natting run correctly because 192.168.0.1 go to the internet always with 172.16.0.1 and the remote host receive correctly packets but when it reply this packets arrive to public interface of router os but not to 192.168.0.1 ... THIS IS THE PROBLEM .... on 192.168.0.1 there isn't any firewall ... Consider that before of mikrotik router I used without problem linux debian with iptables :

iptables -t nat -A POSTROUTING -s 192.168.0.1 -j SNAT --to-source 172.16.0.1
iptables -t nat -A PREROUTING -d 172.16.0.1 -j DNAT --to-dest 192.168.0.1

Can you help me please???
You do not have the required permissions to view the files attached to this post.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question

Mon Nov 28, 2011 11:32 am

I did other tests ... I think the problem is router os BUG.
I explain you ...

I solved the problem simply activating one ip address on public interface ... and this'isnt normal.
For example.
If I activate ONLY 172.16.0.1/24 the src nat and destination nat run correctly ...
If I activate ONLY 172.16.0.5/24 the src nat and destination nat run correctly ...

Is it possible bug ????
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: NAT question ( is it a bug ?)

Mon Nov 28, 2011 2:52 pm

It is exceedingly unlikely you found a bug in the Linux NAT implementation. It's far more likely your router is subtly misconfigured.

Go back to the configuration you want to run. Then post it - so far you've only been showing snippets. That would include the output of "/ip address print detail", "/ip route print detail", "/interface print detail", "/ip firewall export", and a network diagram.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Mon Nov 28, 2011 6:26 pm

This is the configuration. The firewall is disabled... I only posted nat table ...
The network in ip route are unrecheable beacause I disattached the router ... and another think ... I replaced my ip public with 172.16.0.0/24 ...

I would to remember you that if I active only one ip address for example 172.16.0.5 the nat, source and destination, run correctly... I have problem if add another ip to the same interface...
/ip address print detail


 1   address=172.16.0.1/24 network=172.16.0.0 interface=ether9 actual-interface=ether9 

 2   address=172.16.0.5/24 network=172.16.0.0 interface=ether9 actual-interface=ether9 

 3   address=172.16.0.10/24 network=172.16.0.0 interface=ether9 actual-interface=ether9 

 4   address=172.16.0.15/24 network=172.16.0.0 interface=ether9 actual-interface=ether9 




/ip route print detail 

0   S  dst-address=0.0.0.0/0 gateway=172.16.0.254 gateway-status=172.16.0.254 unreachable distance=1 scope=30 target-scope=10 

 1 ADC  dst-address=172.16.0.0/24 pref-src=172.16.0.1 gateway=ether9 gateway-status=ether9 unreachable distance=0 scope=200 

 3 ADC  dst-address=192.168.0.0/16 pref-src=192.168.255.254 gateway=ether8 gateway-status=ether8 unreachable distance=0 scope=200 


/interface print detail

 0  R  name="ether10" type="ether" mtu=1500 l2mtu=1600 max-l2mtu=9116 

 1     name="ether9" type="ether" mtu=1500 l2mtu=1500 max-l2mtu=9116 

 2     name="ether7" type="ether" mtu=1500 l2mtu=1600 max-l2mtu=4080 

 3     name="ether8" type="ether" mtu=1500 l2mtu=1500 max-l2mtu=4080 

 4     name="ether6" type="ether" mtu=1500 l2mtu=1600 max-l2mtu=4080 

 5     name="ether5" type="ether" mtu=1500 l2mtu=1598 max-l2mtu=4078 

 6     name="ether4" type="ether" mtu=1500 l2mtu=1598 max-l2mtu=4078 

 7     name="ether3" type="ether" mtu=1500 l2mtu=1598 max-l2mtu=4078 

 8     name="ether2" type="ether" mtu=1500 l2mtu=1598 max-l2mtu=4078 

 9     name="ether1" type="ether" mtu=1500 l2mtu=1598 max-l2mtu=4078 


/ip firewall nat export

add action=src-nat chain=srcnat comment="192.168.0.1 (SOURCE NATTING)" disabled=no src-address=192.168.0.1 to-addresses=172.16.0.5
add action=dst-nat chain=dstnat comment="192.168.0.1 (DESTINATION NATTING)" disabled=no dst-address=172.16.0.5 to-addresses=192.168.0.1
add action=src-nat chain=srcnat comment="192.168.0.2 (SOURCE NATTING)" disabled=no src-address=192.168.0.2 to-addresses=172.16.0.10
add action=dst-nat chain=dstnat comment="192.168.0.2 (DESTINATION NATTING)" disabled=no dst-address=172.16.0.10 to-addresses=192.168.0.2
add action=src-nat chain=srcnat comment="192.168.0.3 (SOURCE NATTING)" disabled=no src-address=192.168.0.3 to-addresses=172.16.0.15
add action=dst-nat chain=dstnat comment="192.168.0.3 (DESTINATION NATTING)" disabled=no dst-address=172.16.0.15 to-addresses=192.168.0.3
add action=netmap chain=srcnat comment="ROUTER OS (SOURCE NAT)" disabled=no to-addresses=172.16.0.1


 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Mon Nov 28, 2011 8:36 pm

perhaps in source and destination natting is necessary to specify input and output interface?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: NAT question ( is it a bug ?)

Tue Nov 29, 2011 1:14 am

Nope - it certainly doesn't hurt, but it's not necessary as such.

I don't see anything wrong with what you pasted. It should work. That it doesn't mean that you either left something out, or edited it in such a way that it hides the problem.

Again, it is close to impossible you found a bug in how Linux handles NAT. You're not doing anything special, and if there was a related bug it would have already been reported by hundreds of thousands of people.

Try resetting the router to scratch and setting up two simple NAT rules and see if it works.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Tue Nov 29, 2011 12:43 pm

Hi fewi and hi to all,
this morning I resetted the router and I only addedd this one:

1) I added ip addresses to interfaces ...
2) I implemented source and destination natting without firewall
3) I added default route...

It's the same! It's incredible ....
In particular only some private ip can communicate with internet. For example:
192.168.0.1 and 192.168.0.2 run telnet correctly but 192.168.0.3 no. If I disable all interface public and enable only 172.16.0.15 public ip then 192.168.0.3 can communicate correctly ... if I add also 172.16.0.10 then 192.168.0.3 continue to communicate with 192.168.0.2 too while 192.168.0.1 is down... It's strange !!!!
I'm thinking ... Is there some problem in MTU configuration ??? I configured it to 1500 because the router is connected to ethernet intefaces only. Can the nic of server incompatible with mikrotik interface ???? I'm using all server dell, in particular dell 1750, 2950...

In the past I had this problem:
I implemented a mesh network with ospf ; each routeros was connected to another via wifi and have its local network private. The local network of each routers guested some devices but there is always one device type that is impossible to communicate with it... I solved this problem simply configuring local interface with arp-proxy ...
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Wed Nov 30, 2011 4:14 pm

Hi fewi,
I tried to use torch command.
If I run on 192.168.0.1 "telnet public_ip" I see in torch tool on public interface an entry with:

public_ip:23 -> 172.16.0.5:random_port

It's clare. The packet from 192.168.0.1 arrive to public_ip and this respond correctly. The packet SYN,ACK from public_ip to 172.16.0.5 enter in the router but the router don't redirect it to 192.168.0.1.
I want to remember that it happens only if I have different ip address to router public interface.
If I have only ip 172.16.0.5 on routeros public inteface without changing any configuration the source nat and destination nat run correctly...
This is very strange!
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Thu Dec 01, 2011 12:38 pm

Hi fewi,
you must see this screenshot !!!!!
This morning I powered on routerboard 1200 and this is the surprise:

As you can see, I connected to RouterOs through ether10 that have ip address 10.245.5.239 while interface ether9 have a public ip address terminating with .100. When I run winbox for scanning mikrotik device It report me that interface ether10 that have a correct mac address (as you can see in ether10 interface gui) have ip address public terminating with .100 !!!!!

THIS IS ANOTHER STRANGE THINK ON THIS ROUTER ...
Have you any idea?
You do not have the required permissions to view the files attached to this post.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

NAT question ( is it a bug ?)

Thu Dec 01, 2011 1:36 pm

I can't help you.
 
wildbill442
Forum Guru
Forum Guru
Posts: 1055
Joined: Wed Dec 08, 2004 7:29 am
Location: Sacramento, CA

Re: NAT question ( is it a bug ?)

Thu Dec 01, 2011 7:46 pm

Destination NAT
If you want to link Public IP 10.5.8.200 address to Local one 192.168.0.109, you should use destination address translation feature of the MikroTik router. Also if you want allow Local server to talk with outside with given Public IP you should use source address translation, too.

Add Public IP to Public interface:

/ip address add address=10.5.8.200/32 interface=Public
Add rule allowing access to the internal server from external networks:

/ip firewall nat add chain=dstnat dst-address=10.5.8.200 action=dst-nat \
to-addresses=192.168.0.109
Add rule allowing the internal server to talk to the outer networks having its source address translated to 10.5.8.200:

/ip firewall nat add chain=srcnat src-address=192.168.0.109 action=src-nat \
to-addresses=10.5.8.200
The above was taken from the wiki - http://wiki.mikrotik.com/wiki/Manual:IP ... nation_NAT

As for the discrepancy listed in your previous post with the MAC/IP in winbox... I believe you said you enabled proxy-arp in one of your other posts... Proxy-ARP is not necessary.

Do another /system reset-configuration

Configure the LAN and add your WAN IP and setup your NAT.

All you need to modify is the

/ip address (add LAN and WAN IP addresses)
/ip firewall nat (add one to one nat under src-nat/dst-nat)
/ip route (for your default gateway)

Don't overcomplicate things get the bare minimum setup and tested then add whatever firewall rules, additional NAT, etc... you need after its setup and working with the basics.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Thu Dec 01, 2011 7:54 pm

Hi,
tomorrow I check the problem of winbox and arp-proxy and feedback you.
For the reset,
I have already executed the step that you reported ...
in the up of this thread you can see I only added ip address, nat rules without firewall and default route ...
You reported part of manual ... but if I configure one ip address on public interface the nat run correctly ... The problem is If I add more ip addresses...
Destination NAT
If you want to link Public IP 10.5.8.200 address to Local one 192.168.0.109, you should use destination address translation feature of the MikroTik router. Also if you want allow Local server to talk with outside with given Public IP you should use source address translation, too.

Add Public IP to Public interface:

/ip address add address=10.5.8.200/32 interface=Public
Add rule allowing access to the internal server from external networks:

/ip firewall nat add chain=dstnat dst-address=10.5.8.200 action=dst-nat \
to-addresses=192.168.0.109
Add rule allowing the internal server to talk to the outer networks having its source address translated to 10.5.8.200:

/ip firewall nat add chain=srcnat src-address=192.168.0.109 action=src-nat \
to-addresses=10.5.8.200
The above was taken from the wiki - http://wiki.mikrotik.com/wiki/Manual:IP ... nation_NAT

As for the discrepancy listed in your previous post with the MAC/IP in winbox... I believe you said you enabled proxy-arp in one of your other posts... Proxy-ARP is not necessary.

Do another /system reset-configuration

Configure the LAN and add your WAN IP and setup your NAT.

All you need to modify is the

/ip address (add LAN and WAN IP addresses)
/ip firewall nat (add one to one nat under src-nat/dst-nat)
/ip route (for your default gateway)

Don't overcomplicate things get the bare minimum setup and tested then add whatever firewall rules, additional NAT, etc... you need after its setup and working with the basics.
 
wildbill442
Forum Guru
Forum Guru
Posts: 1055
Joined: Wed Dec 08, 2004 7:29 am
Location: Sacramento, CA

Re: NAT question ( is it a bug ?)

Thu Dec 01, 2011 8:27 pm

OK I see that...

What is this for??
/ip firewall nat add action=netmap chain=srcnat comment="ROUTER OS (SOURCE NAT)" disabled=no to-addresses=172.16.0.1
It sounds like 172.16.0.1 is your management IP address.. Just assign this to the public interface there's no NAT settings required to point this at the router.

As for everything else it looks OK from what you've posted..... Here's how it should look:

/ip address
add address=192.168.0.1/24 interface=LAN
add address=172.16.0.1/27 interface=WAN
add address=172.16.0.2/27 interface=WAN
add address=172.16.0.3/27 interface=WAN

/ip firewall nat
add action=dst-nat chain=dstnat disabled=no dst-address=172.16.0.1 to-addresses=192.168.0.101
add action=dst-nat chain=dstnat disabled=no dst-address=172.16.0.2 to-addresses=192.168.0.102
add action=dst-nat chain=dstnat disabled=no dst-address=172.16.0.3 to-addresses=192.168.0.103
add action=src-nat chain=srcnat disabled=no src-address=192.168.0.101 to-addresses=172.16.0.1
add action=src-nat chain=srcnat disabled=no src-address=192.168.0.102 to-addresses=172.16.0.2
add action=src-nat chain=srcnat disabled=no src-address=192.168.0.103 to-addresses=172.16.0.3

/ip route
add dst-address=0.0.0.0/0 gateway=172.16.0.30 (default route)

If you have other hosts on the LAN other than the 1:1 NAT hosts then you'll need to add a masquerade rule in the src-nat chain.

Should be pretty straight forward.
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Fri Dec 02, 2011 12:33 am

Hi William,
the rule you quoted is for have the same ip address used by the router for its connections to internet. If I use masqureding function instead of src-nat and I have different ip public on the same interface which ip address it use? tge preferred source specified in route table? o it's random? I don't know and then I specified it with src-nat.

For the configuration ... it is the same that I'm using ... It's strange...
Tomorrow I post you about winbox problem...
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Fri Dec 02, 2011 9:09 am

Hi William I checked arp proxy. There isn't.
The arp mode for interface ether10 is "enabled".
I think that this routerboard have some hardware or firmware problem....
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Tue Dec 06, 2011 1:30 pm

Hi to all,
I think I solved the problem !!!!
As I tell you I would to use RB1200 to replace a debian server with iptables.
This morning I tell to me. If some src-nat run and other not run is it possible that is about arp cache????
Is it possible there is some server linux that have a timeout more long ? Then I cloned debian mac address on RB12000 and now all run correctly ....
 
User avatar
alexandro
just joined
Posts: 24
Joined: Mon Jun 06, 2011 11:03 am
Location: Lebanon
Contact:

Re: NAT question ( is it a bug ?)

Fri Dec 09, 2011 3:17 pm

Hi

ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=dst-nat to-addresses=192.168.0.1

This is your config


You should use this config ad everything will be ok:


ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=net-map to-addresses=192.168.0.1


:)
 
leon84
Member Candidate
Member Candidate
Topic Author
Posts: 201
Joined: Wed Dec 02, 2009 12:15 pm

Re: NAT question ( is it a bug ?)

Fri Dec 09, 2011 3:30 pm

Hi Alexandro. thanks for the answer. Why in desttination nat I must use netmap function and not simply dst-nat? And why you use netmap only in dst-nat? I tried netmap in both (src-nat and dst-nat) but not only in dnat. Next week i try your configuration and tell you. thanks a lot..
Hi

ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=dst-nat to-addresses=192.168.0.1

This is your config


You should use this config ad everything will be ok:


ip firewall nat add chain=srcnat src-address=192.168.0.1 action=src-nat to-addresses="IP PUBLIC 1"
ip firewall nat add chain=dstnat dst-address="IP PUBLIC 1" action=net-map to-addresses=192.168.0.1


:)
 
User avatar
alexandro
just joined
Posts: 24
Joined: Mon Jun 06, 2011 11:03 am
Location: Lebanon
Contact:

Re: NAT question ( is it a bug ?)

Sat Dec 10, 2011 11:58 am

Am using this configuration and everything is ok am using it to access my routers from my mobile phone and everything was working properly.
You Welcome .

Who is online

Users browsing this forum: adimihaix, CGGXANNX, regisc and 112 guests