NAT的小实验

实验目的:测试NAT通信
实验设备:2台路由器、1台核心交换机、1台2层交换机、3台电脑。
实验拓扑:
NAT的小实验
实验配置:
具体看图
路由器2(配置NAT的路由器)配置:
Router#show running-config
Building configuration...

Current configuration : 1167 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
enable password 123@123
!
username 123 privilege 15 password 0 123@123
!
spanning-tree mode pvst
!
interface FastEthernet0/0
ip address 192.168.3.1 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.1.2 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/1/0
switchport access vlan 4
switchport mode access
!
interface FastEthernet0/1/1
switchport mode access
!
interface FastEthernet0/1/2
switchport mode access
!
interface FastEthernet0/1/3
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
interface Vlan4
ip address 10.10.10.1 255.255.255.0
!
ip nat inside source static 172.168.1.1 192.168.3.1
ip classless
ip route 192.168.1.0 255.255.255.0 192.168.1.1
ip route 192.168.4.0 255.255.255.0 192.168.3.2
ip route 172.168.1.0 255.255.255.0 192.168.1.1
ip route 192.168.2.0 255.255.255.0 192.168.1.1
!
line con 0
!
line aux 0
!
line vty 0 4
login local
!
end
实验测试:
PC0 ping 4.2
NAT的小实验
PC2 PING 4.2
NAT的小实验

192.168.4.2 ping 192.168.2.1 与172.168.1.1
NAT的小实验
结果:可以ping通未映射的地址,没办法ping通已映射的地址(NAT的安全性,忘记的看下NAT的优缺点)。
综上所述 NAT成功
另想起再一次证明 NAT成功,在NAT路由器上做了Telnet远程管理(已做),测试下外部是否可以telnet到路由器。
NAT的小实验
证明:做了NAT的外部地址是无法telnet到外部接口的,但是可以Telnet到其他接口。
好了实验完毕。勿喷。

猜你喜欢

转载自blog.51cto.com/12581350/2160137