2010年8月14日

NAT-Lab實作


Router_A的設定
紅色字體為ACL的設定
Router_A#show run
Building configuration...
Current configuration : 754 bytes
!
version 12.4
no service password-encryption
!
hostname Router_A
!
ip ssh version 1
!
interface FastEthernet0/0
ip address 61.1.1.5 255.255.255.252
ip nat outside
duplex auto
speed auto
!

interface FastEthernet0/1
ip address 10.1.4.1 255.255.255.252
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
router rip
version 2
network 10.0.0.0
!
ip nat pool TTT 61.1.1.5 61.1.1.5 netmask 255.255.255.252
ip nat inside source list 1 pool TTT overload

ip classless
ip route 0.0.0.0 0.0.0.0 61.1.1.6
!
!
access-list 1 permit 10.1.0.0 0.0.255.255
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
!
!
end

從PC_0去Ping PC_1後,查看NAT的轉換狀態
Router_A#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 61.1.1.5:41 10.1.8.2:41 61.1.1.10:41 61.1.1.10:41
icmp 61.1.1.5:42 10.1.8.2:42 61.1.1.10:42 61.1.1.10:42
icmp 61.1.1.5:43 10.1.8.2:43 61.1.1.10:43 61.1.1.10:43
icmp 61.1.1.5:44 10.1.8.2:44 61.1.1.10:44 61.1.1.10:44

查看NAT的組態資料
Router_A#show ip nat statistics
Total translations: 0 (0 static, 0 dynamic, 0 extended)
Outside Interfaces: FastEthernet0/0
Inside Interfaces: FastEthernet0/1
Hits: 42 Misses: 44
Expired translations: 44
Dynamic mappings:
-- Inside Source
access-list 1 pool TTT refCount 0
pool TTT: netmask 255.255.255.252
start 61.1.1.5 end 61.1.1.5
type generic, total addresses 1 , allocated 0 (0%), misses 0


三顆Router上的Routing設定(有設定Default Route)
Router_A#show ip route
Gateway of last resort is 61.1.1.6 to network 0.0.0.0
10.0.0.0/30 is subnetted, 2 subnets
C 10.1.4.0 is directly connected, FastEthernet0/1
R 10.1.8.0 [120/1] via 10.1.4.2, 00:00:13, FastEthernet0/1
61.0.0.0/30 is subnetted, 1 subnets
C 61.1.1.4 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 61.1.1.6

Router_B#show ip route
61.0.0.0/30 is subnetted, 2 subnets
C 61.1.1.4 is directly connected, FastEthernet0/0
C 61.1.1.8 is directly connected, FastEthernet0/1

Router_C#show ip route
Gateway of last resort is 10.1.4.1 to network 0.0.0.0
10.0.0.0/30 is subnetted, 2 subnets
C 10.1.4.0 is directly connected, FastEthernet0/1
C 10.1.8.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 10.1.4.1

0 回應:

Copyright © 2009 New Life in Taipei All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.