第1段:路由器R1的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service passWord-encryption ! hostname R1 ! ip subnet-zero ! interface Ethemet0 ip address 10.1.1.10 255.255.255.0 ip nat inside ! interface Serial0 ip address 198.1.1.1255.255.255.252 ip nat outside ! ip nat pool lab2 200.1.1.1 200.1.1.6 netmask 255.255.255.248 ip nat inside source list 1 pool lab2 ip classless ip route 0.0.0.0 0.0.0.0 Serial0 ip http server ! access-list 1 permit 10.1.1.0 0.0.0.255 ! line con 0 line aux 0 line vty 0 4 login ! end 第2段:路由器R2的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 ! ip subnet-zero no ip finger ! interface Loopback0 ip address 202.1.1.2 255.255.255.0 secondary ip address 202.1.1.3 255.255.255.0 secondary ip address 202.1.1.4 255.255.255.0 secondary ip address 202.1.1.1255.255.255.0 ! interface Serial0 ip address 198.1.1.2 255.255.255.252 clockrate 64000 ! ip classless ip route 200.1.1.0 255.255.255.248 Serial0 ip http server ! line con 0 line aux 0 line vty 0 4 password cisco login ! end 第3段:路由器R3的配置 version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R3 ! no logging console ! ip subnet-zero no ip routing ! interface Ethemet0 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 secondary ip address 10.1.1.6 255.255.255.0 secondary ip address 10.1.1.7 255.255.255.0 secondary ip address 10.1.1.1255.255.255.0 no ip route-cache no ip mroute-cache ! ip default-gateway 10.1.1.10 ip classless ip http server ! line con 0 transport input none line aux 0 line vty 0 4 password cisco login ! end
第1段:监测和查看NAT操作 R1#debug ip nat IP NAT debugging is on R1# Term_Server>3 [Resuming connection 1 to r3 ...] R3#ping PRotocol [ip]: Target IP address: 202.1.1.1 Repeat count [5]: Datagram size[100]: Timeout in seconds[2]: Extened commands[n]:y Source address or interface:10.1.1.1 Type of service[0]: Set DF bit in IP header?[no]: Validate reply data?[no]: Data pattern[0xABCD]: Loose,Strict,Record,Timestamp,Verbose[none]: Sweep range of sizes[n]: Type escape sequence to abort. Sending ,100-byte ICMP Echos to 202.1.1.1,timeout is 2 seconds: !!!!! SUCcess rate is 80 percent(4/5),round-trip min/avg/max=32/33/36 ms (重复上述指令,分别以源地址10.1.1.2、10.1.1.3、10.1.1.4、10.1.1.5和10.1.1.6对202.1.1.1-202.1.1.4进行ping测试。结果均为成功。测试记录此处从略。) R3#ping Protocol[ip]: Target IP address:202.1.1.4 Repeat count[5]: Datagram size[100]: Timeout in seconds[2]: Extended commands[n]:y Source address or interface:10.1.1.7 Type of serivce[0]: Set DF bit in IP header?[no]: Validate reply data?[no]: Data pattern[0xABCD]: Loose,Strict,Record,Timestamp,Verbose[none]: Sweep range of sizes[n]: Type escape sequence to abort. Sending 5,100-byte ICMP Echos to 202.1.1.4,timeout is 2 seconds: .U.U. Success rate is 0 percent(0/5) R3# Term_Server>1 [Resuming connection 1 to r1...]