2

Really confused regarding source NAT and Destination NAT in Cisco ASA. I have a NVR in IP 10.10.20.20 and locally it is opened via http://10.10.20.20. Remotely, i want this to be accessed via my public IP 201.202.203.204:8080. So what i understand is, i have to port forward this port in this public ip. Is it not destination nat? What i use here is auto NAT: Object network obj-10.10.20.20 host 10.10.20.20 nat(inside,outside) static interface service tcp 80 8080

And with Manual NAT: We create objects. Object network obj-10.10.20.20 host 10.10.20.20

similarly, for ports: object service port-80 service tcp source eq 80

object service port-8080 service tcp source eq 8080

So, NAT command would be like: nat(inside,outside) source static obj-10.10.20.20 interface service port-80 port-8080

And access rule would be: access-list access-list-name extended permit tcp any host 10.10.20.20 eq http

Is it not that port-8080 should have been the destination port? After all, we are opening the ports 8080 for remote users. Please clearify when it becomes source port and when it becomes the destination port. Thank you in advance.

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 7 '17 at 21:01
3

When you configure a static PAT rule with (inside,outside), this actually creates a persistent connection in your NAT table that is bidirectional between the two specified interfaces. You can see this with show xlate. This makes it so you don't need to create two NAT rules for a static PAT rule. With one rule handling inbound traffic to the outside interface and the other handling inbound traffic to the inside interface. You can create a unidirectional static NAT rule by adding the unidirectional statement at the end of you NAT statement to override this behavior.

With the ASA 8.3+ NAT syntax, we use all real IP addresses and ports. I just think of it as the NAT translation happens before your inbound ACL is applied.

Josh

1

Those definitions are taken from junos book

Destination NAT enables the translation of one destination address to another, a destination address and port to another destination address and port, or a group of destination addresses to another group of equal size.

Source NAT is the translation of source IP addresses and TCP/UDP ports in the headers of IP flows. It is most commonly used for the translation of private IP address space to public globally routable address space.

Br

  • Yet "source" and "destination" are relative to the sender and in TCP connection both endpoints are senders and receivers alike. To make things worse the Cisco docs talk about real and mapped things and while the order of parameters to source is first "real", then "mapped", for destination it is first "mapped", then "real". And of course what is mapped and what is real is not fixed, it is defined by what you put in the parentheses right after nat. This makes it very hard to understand the nat command. – user1129682 Feb 7 '17 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.