R1:
interface FastEthernet0/0
ip address 13.1.1.1 255.255.255.0
ip nat outside
!
interface FastEthernet0/1
ip address 12.1.1.1 255.255.255.0
ip nat outside
!
ip nat inside source static 12.1.1.2 2.2.2.2
ip nat inside source static 13.1.1.3 3.3.3.3
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
!
ip route 3.3.3.0 255.255.255.0 12.1.1.1
R3:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/1
ip address 13.1.1.3 255.255.255.0
!
ip route 2.2.2.0 255.255.255.0 13.1.1.1
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 2.2.2.2 12.1.1.2 --- ---
--- 3.3.3.3 13.1.1.3 --- ---
R2#ping 3.3.3.3 source lo0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 2.2.2.2:3 12.1.1.2:3 13.1.1.3:3 13.1.1.3:3
--- 2.2.2.2 12.1.1.2 --- ---
icmp 3.3.3.3:3 13.1.1.3:3 2.2.2.2:3 2.2.2.2:3
--- 3.3.3.3 13.1.1.3 --- ---
ip nat inside source static Inside local IP address Inside global IP address
ip nat outside source static Outside global IP address Outside local IP address
實例1.最近用戶反應QQ經常掉線。經檢查QQ掉線時、百度之類網站都能上。
剛開始以爲是病毒、switch、防護牆......
最終,將nat地址池擴大後,問題排除。