2013年5月31日 星期五

NAT -- Static NAT

NAT -- Static NAT


//--------------------------------------------------------//

R1#
R1#
!
interface FastEthernet0/0
 ip address 192.168.1.254 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 10.1.1.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!

ip nat inside source static 192.168.1.10 10.1.1.10
ip nat inside source static 192.168.1.11 10.1.1.11

!
//--------------------------------------------------------//
R2#
R2#
!
interface FastEthernet0/1
 ip address 10.1.1.2 255.255.255.0
 duplex auto
 speed auto
!
//--------------------------------------------------------//



R1#sh ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
icmp 10.1.1.10:56254   192.168.1.10:56254 10.1.1.2:56254     10.1.1.2:56254
icmp 10.1.1.10:56766   192.168.1.10:56766 10.1.1.2:56766     10.1.1.2:56766
icmp 10.1.1.10:57022   192.168.1.10:57022 10.1.1.2:57022     10.1.1.2:57022
icmp 10.1.1.10:57278   192.168.1.10:57278 10.1.1.2:57278     10.1.1.2:57278
icmp 10.1.1.10:57534   192.168.1.10:57534 10.1.1.2:57534     10.1.1.2:57534
icmp 10.1.1.10:58558   192.168.1.10:58558 10.1.1.2:58558     10.1.1.2:58558
icmp 10.1.1.10:58814   192.168.1.10:58814 10.1.1.2:58814     10.1.1.2:58814
icmp 10.1.1.10:59070   192.168.1.10:59070 10.1.1.2:59070     10.1.1.2:59070
icmp 10.1.1.10:59326   192.168.1.10:59326 10.1.1.2:59326     10.1.1.2:59326
icmp 10.1.1.10:59582   192.168.1.10:59582 10.1.1.2:59582     10.1.1.2:59582
--- 10.1.1.10          192.168.1.10       ---                ---
icmp 10.1.1.11:63422   192.168.1.11:63422 10.1.1.2:63422     10.1.1.2:63422
icmp 10.1.1.11:63934   192.168.1.11:63934 10.1.1.2:63934     10.1.1.2:63934
icmp 10.1.1.11:64190   192.168.1.11:64190 10.1.1.2:64190     10.1.1.2:64190
icmp 10.1.1.11:64446   192.168.1.11:64446 10.1.1.2:64446     10.1.1.2:64446
icmp 10.1.1.11:64702   192.168.1.11:64702 10.1.1.2:64702     10.1.1.2:64702
--- 10.1.1.11          192.168.1.11       ---                ---
--- 10.1.1.12          192.168.1.12       ---                ---
R1#






NAT -- PAT (Port Address Translation) Labs

NAT Lab (PAT , Port Address Translation)

//--------------------------------------------------//

R1#
R1#

interface FastEthernet0/0
no sh
 ip address 192.168.1.254 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
no sh
 ip address 10.1.1.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto


ip nat pool pat-test 10.1.1.8 10.1.1.8 netmask 255.255.255.0
ip nat inside source list 10 pool pat-test overload
!
access-list 10 permit 192.168.1.0 0.0.0.255
!

//--------------------------------------------------//

R2#
R2#
interface FastEthernet0/1
 ip address 10.1.1.2 255.255.255.0
 duplex auto
 speed auto
!
//--------------------------------------------------//

R1#sh ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
icmp 10.1.1.8:20614    192.168.1.10:20614 10.1.1.2:20614     10.1.1.2:20614
icmp 10.1.1.8:20870    192.168.1.10:20870 10.1.1.2:20870     10.1.1.2:20870
icmp 10.1.1.8:21126    192.168.1.10:21126 10.1.1.2:21126     10.1.1.2:21126
icmp 10.1.1.8:21382    192.168.1.10:21382 10.1.1.2:21382     10.1.1.2:21382
icmp 10.1.1.8:21638    192.168.1.10:21638 10.1.1.2:21638     10.1.1.2:21638
icmp 10.1.1.8:16774    192.168.1.11:16774 10.1.1.2:16774     10.1.1.2:16774
icmp 10.1.1.8:17286    192.168.1.11:17286 10.1.1.2:17286     10.1.1.2:17286
icmp 10.1.1.8:17542    192.168.1.11:17542 10.1.1.2:17542     10.1.1.2:17542
icmp 10.1.1.8:17798    192.168.1.11:17798 10.1.1.2:17798     10.1.1.2:17798
icmp 10.1.1.8:18054    192.168.1.11:18054 10.1.1.2:18054     10.1.1.2:18054
R1#]




NAT -- Dynamic NAT pool


Dynamic NAT Lab for CCNA exam




//-----------------------------------------------------//
R1#
R1#
interface FastEthernet0/0
no sh
 ip address 192.168.1.254 255.255.255.0
 ip nat inside
!
interface FastEthernet0/1
no sh
 ip address 100.1.1.1 255.255.255.0
 ip nat outside
!
ip nat pool dynat 100.1.1.5 100.1.1.6 netmask 255.255.255.0
ip nat inside source list 10 pool dynat
access-list 10 permit 192.168.1.0 0.0.0.255
//-----------------------------------------------------//
R2#
R2#
interface FastEthernet0/1
no sh
 ip address 100.1.1.2 255.255.255.0
//-----------------------------------------------------//



dynat#ping 100.1.1.2 source fa0/0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.1.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.254
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/32 ms
dynat#


dynat#sh ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
icmp 100.1.1.5:0       192.168.1.254:0    100.1.1.2:0        100.1.1.2:0
icmp 100.1.1.5:1       192.168.1.254:1    100.1.1.2:1        100.1.1.2:1
icmp 100.1.1.5:2       192.168.1.254:2    100.1.1.2:2        100.1.1.2:2
--- 100.1.1.5          192.168.1.254      ---                ---
dynat#