There are two important things to note in this example.
First, when the packet travels from outside to inside, translation occurs first, and then the routing table is checked for the destination. When the packet is travels from inside to outside, the routing table is checked for the destination first, and then translation occurs.
Second, it's important to note which part of the IP packet gets translated when using each of the commands above. The following table contains a guideline:
Command Action
ip nat outside source list
ip nat outisde source static ( converts Outside global to Outside Local)
translates the source of the IP packets that are traveling outside to inside
translates the destination of the IP packets that are traveling inside to outside
ip nat inside source list
ip nat outisde source static ( converts Inside local to Inside global)
translates the source of IP packets that are traveling inside to outside
translates the destination of the IP packets that are traveling outside to inside
What the above guidelines indicate is that there is more than one way to translate a packet. Depending on your specific needs, you should determine how to define the NAT interfaces (inside or outside) and what routes the routing table should contain before or after translation. Keep in mind that the portion of the packet that will be translated depends upon the direction the packet is traveling, and how you configured NAT.
R1 ========== R2
172.16.1.1 172.16.1.2
R1
ip nat outside source static udp 172.16.1.2 520 224.0.0.9 520 extendable
R2
ip nat outside source static udp 172.16.1.1 520 224.0.0.9 520 extendable
ip nat outisde source static ( converts Outside global to Outside Local)
R1#sh ip nat tran
Pro Inside global Inside local Outside local Outside global
udp --- --- 224.0.0.9:520 172.16.1.2:520
udp 172.16.1.1:520 172.16.1.1:520 224.0.0.9:520 172.16.1.2:520
R1#
Mar 1 00:50:54.147: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (172.16.1.1)
*Mar 1 00:50:54.147: RIP: build update entries
*Mar 1 00:50:54.147: 1.1.1.1/32 via 0.0.0.0, metric 1, tag 0
*Mar 1 00:50:54.151: NAT: i: udp (172.16.1.1, 520) -> (224.0.0.9, 520) [0]
*Mar 1 00:50:54.151: NAT: s=172.16.1.1, d=224.0.0.9->172.16.1.2 [0]
R1#
*Mar 1 00:50:58.503: NAT*: o: udp (172.16.1.2, 520) -> (172.16.1.1, 520) [0]
*Mar 1 00:50:58.503: NAT*: s=172.16.1.2->224.0.0.9, d=172.16.1.1 [0