You are on page 1of 3

NAT Overload

M t
C ch cho php chuyn i tt c a ch IP thnh 01 a ch Global (a ch IP tht ),
c ch ny s gim s a ch IP tht. Cc a ch trong s c phn bit da trn port
number.
RouterA c cu hnh NAT v s t ng chuyn dch bt k a ch IP trong nao
(10.1.1.0) thnh 195.1.1.4
Cu hnh
RouterA
!
hostname RouterA
!
ip nat pool globalpool 195.1.1.1 195.1.1.1 netmask 255.255.255.0 <- nh ngha dy
a ch IP c NAT ra ngoi
ip nat inside source list 1 pool globalpool overload <- Cho php nhiu a ch bn
trong c chuym dch ra cng 01 a ch ngoi
!
interface Ethernet0
ip address 10.1.1.1 255.255.255.0 secondary
ip address 10.1.1.2 255.255.255.0 secondary
ip address 10.1.1.3 255.255.255.0 secondary
ip address 10.1.1.4 255.255.255.0 secondary
ip address 10.1.1.5 255.255.255.0
ip nat inside <- nh ngha cng trong
!
interface Serial0
ip address 195.1.1.4 255.255.255.0
ip nat outside <- nh ngha cng ngoi
!
no ip classless
ip route 152.1.1.1 255.255.255.255 Serial0
access-list 1 permit 10.1.1.0 0.0.0.255 <- nh ngha lp IP trong c php chuyn
dch ra ngoi. Ta c th nh ngha 1 hay nhiu IP
!
line con 0
line vty 0 4
login
!
end

RouterB
!
hostname RouterB
!
enable mt khu cisco
!
interface Ethernet0/0
ip address 152.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 195.1.1.10 255.255.255.0
clock rate 500000
!
line con 0
line aux 0
line vty 0 4
mt khu cisco
login
Kim tra
T Router A , thc hin lnh ping m rng n RouterB (195.1.1.3), source t 10.1.1.1
v 10.1.1.2. Kim tra chuyn dch bng lnh debug ip nat (c 2 a ch ny s c
chuyn dch thnh 195.1.1.1).
NAT: s=10.1.1.1->195.1.1.1, d=195.1.1.3 [5]
NAT: s=10.1.1.2->195.1.1.1, d=195.1.1.3 [10]
xem bng chuyn i NAT trn RouterA dng lnh show ip nat tranlation. Lu port
number sau mi a ch IP. S th t cc port ny l cha kha chuyn cc gi ng
v a ch IP inside local.
RouterA#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 195.1.1.1:9 10.1.1.2:4 195.1.1.3:4 195.1.1.3:9
icmp 195.1.1.1:8 10.1.1.2:3 195.1.1.3:3 195.1.1.3:8
icmp 195.1.1.1:7 10.1.1.2:2 195.1.1.3:2 195.1.1.3:7
icmp 195.1.1.1:6 10.1.1.2:1 195.1.1.3:1 195.1.1.3:6
icmp 195.1.1.1:5 10.1.1.2:0 195.1.1.3:0 195.1.1.3:5
icmp 195.1.1.1:4 10.1.1.1:4 195.1.1.3:4 195.1.1.3:4
icmp 195.1.1.1:3 10.1.1.1:3 195.1.1.3:3 195.1.1.3:3
icmp 195.1.1.1:2 10.1.1.1:2 195.1.1.3:2 195.1.1.3:2
icmp 195.1.1.1:1 10.1.1.1:1 195.1.1.3:1 195.1.1.3:1
icmp 195.1.1.1:0 10.1.1.1:0 195.1.1.3:0 195.1.1.3:0
->Mt s lnh kim tra khc

Show ip nat statistics : Hin th s phin ang chuyn dch v chuyn dch khi thc
hin NAT.
Show ip nat translations: Cc phin NAT ang din ra; Protocol of the packet translated;
inside global address , outside local address, outside global address v inside local
address.
Show ip nat translations verbose : ging lnh trn nhng chi tit hn
clear ip nat translation : Xa tt c cc phin NAT
clear ip nat statistics : xa tt c cc counters ca thng k NAT
debug ip nat : Xem tin trnh ca cc phin NAT
__________________
Theo: Viet Professionals Co. Ltd. VnPro

You might also like