02-18-2023 09:16 AM
What are the differences between static PAT and destination NAT?
Solved! Go to Solution.
02-20-2023
01:29 PM
- last edited on
02-20-2023
11:30 PM
by
Translator
Hello
@Sagar4 wrote:
If I have to allow NAT translation only via a particular destination port for any local host to access outside network, can it be performed via PAT
Yes it possible by defining a extended access-list for you internal lan hosts to a specific public ip address & destination port using dynamic PAT
example1:
ip access-list extended LAN-HOSTS
permit tcp 10.1.123.0 0.0.0.255 host 1.1.1.1 eq www
ip nat pool Public-IP 100.100.100.10 100.100.100.10 prefix-length 30
ip nat inside source list TST pool Public-IP
@Sagar4 wrote:
also configured NAT IP pool to make sure both destination ip address and port number doesn't match for multiple hosts?
Similar to example 1 however you specify a nat pool with a range of public-ip addressing so you lan hosts to match upon.
example2:
ip access-list extended LAN-HOST
permit tcp host 10.1.123.10 host 1.1.1.1 eq 80
permit tcp host 10.1.123.11 host 1.1.1.1 eq 80
permit tcp host 10.1.123.12 host 1.1.1.1 eq 80
permit tcp host 10.1.123.13 host 1.1.1.1 eq 80
permit tcp host 10.1.123.14 host 1.1.1.1 eq 80
etc....
ip nat pool Public-IP 100.100.100.10 100.100.100.20 prefix-length 30 type match-host
ip nat inside source list TST pool Public-IP
Using destination nat:
Could be used as when you wish for a specific public ip address to be reachable for your lan hosts via a internal ip address
Example 3:
ip nat outside source static 1.1.1.1 10.1.123.100 < host 1.1.1.1 will be reachable at 10.1.123.100 internally
Or for a quick load balancing of an internal server:
Example 4:
10.1.123.10/24 (svr1)
10.1.123.11/24 (svr2)
10.1.123.12/24 (svr3)
access-list 1 permit 100,100.100.10
ip nat pool inside-server 10.1.123.10 10.1.123.12 prefix-length 24 type rotary
ip nat inside destination 1 pool inside-server
02-18-2023 09:37 AM - edited 02-20-2023 01:56 PM
check
02-18-2023 09:51 AM
If I have to allow NAT translation only via a particular destination port for any local host to access outside network, can it be performed via PAT provided I have also configured NAT IP pool to make sure both destination ip address and port number doesn't match for multiple hosts?
02-18-2023 09:57 AM
can I see the config ?
02-18-2023 10:06 AM
I don't have configuration. My doubt was if PAT can allow single public IP address to be used by multiple devices for NAT translation, can router also perform NAT translation only via a specific destination port number for all local host to access outside network?
02-18-2023 10:13 AM - edited 02-20-2023 01:56 PM
Check
02-20-2023
08:46 AM
- last edited on
02-20-2023
11:25 PM
by
Translator
Can I get
mapping
command for both static pat and destination NAT so as to differentiate between the two?
02-20-2023 09:32 AM - edited 02-20-2023 01:50 PM
check
02-20-2023
01:29 PM
- last edited on
02-20-2023
11:30 PM
by
Translator
Hello
@Sagar4 wrote:
If I have to allow NAT translation only via a particular destination port for any local host to access outside network, can it be performed via PAT
Yes it possible by defining a extended access-list for you internal lan hosts to a specific public ip address & destination port using dynamic PAT
example1:
ip access-list extended LAN-HOSTS
permit tcp 10.1.123.0 0.0.0.255 host 1.1.1.1 eq www
ip nat pool Public-IP 100.100.100.10 100.100.100.10 prefix-length 30
ip nat inside source list TST pool Public-IP
@Sagar4 wrote:
also configured NAT IP pool to make sure both destination ip address and port number doesn't match for multiple hosts?
Similar to example 1 however you specify a nat pool with a range of public-ip addressing so you lan hosts to match upon.
example2:
ip access-list extended LAN-HOST
permit tcp host 10.1.123.10 host 1.1.1.1 eq 80
permit tcp host 10.1.123.11 host 1.1.1.1 eq 80
permit tcp host 10.1.123.12 host 1.1.1.1 eq 80
permit tcp host 10.1.123.13 host 1.1.1.1 eq 80
permit tcp host 10.1.123.14 host 1.1.1.1 eq 80
etc....
ip nat pool Public-IP 100.100.100.10 100.100.100.20 prefix-length 30 type match-host
ip nat inside source list TST pool Public-IP
Using destination nat:
Could be used as when you wish for a specific public ip address to be reachable for your lan hosts via a internal ip address
Example 3:
ip nat outside source static 1.1.1.1 10.1.123.100 < host 1.1.1.1 will be reachable at 10.1.123.100 internally
Or for a quick load balancing of an internal server:
Example 4:
10.1.123.10/24 (svr1)
10.1.123.11/24 (svr2)
10.1.123.12/24 (svr3)
access-list 1 permit 100,100.100.10
ip nat pool inside-server 10.1.123.10 10.1.123.12 prefix-length 24 type rotary
ip nat inside destination 1 pool inside-server
02-20-2023 01:52 PM
Thanks Paul. And one more thing, destination NAT just means mapping is done for outside hosts and source NAT means mapping is done for local hosts. Correct me I'm wrong.
02-20-2023
02:30 PM
- last edited on
02-20-2023
11:28 PM
by
Translator
Hello
@Sagar4 wrote:
Thanks Paul. And one more thing, destination NAT just means mapping is done for outside hosts and source NAT means mapping is done for local hosts. Correct me I'm wrong.
Its based on the destination traffic
Dnat - Destination address translation
Snat - Source address translation
The nat order of operation is different in domain nat (inside/outside)
Outside to Inside ( nat occurs first then routing is performed)
Inside to Outside (routing occurs first then nat)
In the first Dnat example, when the traffic for sourced from 1.1.1.1 it enters on the outside interface, So the rtr will first translate it to an internal address in this case 10.1.123.100 then a route lookup is performed and traffic is forwarded, as such when any return traffic for that NAT'D address will be forwarded to the outside interface then translated back to its original address
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide