Thứ Ba, 16 tháng 8, 2011

Nat dong voi multiple pool su dung Roue-map

Configure R1 dung ACL
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.0.0.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.0.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
no ip http server
no ip http secure-server
!
ip route 172.16.2.0 255.255.255.0 10.0.0.2
ip route 172.16.3.0 255.255.255.0 10.0.0.3
!
ip nat pool pool102 203.162.2.1 203.162.2.6 prefix-length 29
ip nat pool pool103 203.162.3.1 203.162.3.6 prefix-length 29
ip nat inside source list 102 pool pool102
ip nat inside source list 103 pool pool103
!
access-list 102 permit ip 192.168.0.0 0.0.0.255 172.16.2.0 0.0.0.255
access-list 103 permit ip 192.168.0.0 0.0.0.255 172.16.3.0 0.0.0.255
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
Configure dung Route-Map


!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.0.0.1 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.0.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
no ip http server
no ip http secure-server
!
ip route 172.16.2.0 255.255.255.0 10.0.0.2
ip route 172.16.3.0 255.255.255.0 10.0.0.3
!
ip nat pool pool102 203.162.2.1 203.162.2.6 prefix-length 29
ip nat pool pool103 203.162.3.1 203.162.3.6 prefix-length 29
ip nat inside source route-map map102 pool pool102
ip nat inside source route-map map103 pool pool103
!
access-list 102 permit ip 192.168.0.0 0.0.0.255 172.16.2.0 0.0.0.255
access-list 103 permit ip 192.168.0.0 0.0.0.255 172.16.3.0 0.0.0.255
!
route-map map103 permit 10
 match ip address 103
!
route-map map102 permit 10
 match ip address 102
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
Configure R2
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.0.0.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.16.2.2 255.255.255.0
 duplex auto
 speed auto
!
ip http server
no ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.0.0.1
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
Configure R3


!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 10.0.0.3 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 172.16.3.3 255.255.255.0
 duplex auto
 speed auto
!
ip http server
no ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.0.0.1
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
!
!
end
--------------The end-------------------