计算机网络实验一:Packet Tracer 入门
Posted chihiroCC
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了计算机网络实验一:Packet Tracer 入门相关的知识,希望对你有一定的参考价值。
使用的软件:Cisco Packet Tracer
【基础知识】
(界面左上角)
逻辑工作区:主要工作区,在该区域里面完成网络设备的逻辑连接及配置。
物理工作区:该区域提供了办公地点(城市、办公室、工作间等)和设备的直观图,可以对它们进行相应配置。
(界面右下角)实施模式与模拟模式
【实验目的】
- 认识Packet Tracer 。
- 学习使用Packet Tracer进行拓扑的搭建。
- 学习使用Packet Tracer对设备进行配置,并进行简单的测试。
【实验步骤】
一、拖放设备和布置线缆
1. 拖放两台1841路由器,并把一台的Display Name和Hostname改为Local,另一台改为ISP
1.1拖放路由器
1.2 config->GLOBAL->Settings
2. 关闭路由器电源,把WIC-2T(串口*2)模块分别添加到两台路由器,然后重新打开电源;
3. 在本地局域网拖一台2950-24交换机;
4. 在本地局域网拖两台PC,分别命名为学号A和学号B;
5. 在ISP网络拖一台服务器,命名为cisco;
6. 连线
用直通线(Straight-through)分别连接1A和1B的FastEthernet口到交换机的f0/1和f0/2口;用直通线连接Local的f0/0到交换机的f0/24;
用交叉线(Cross-over)连接ISP的f0/0口到cisco的FastEthernet口;
用串行线(Serial)DCE一端连接ISP的s0/0/0,另一端(DTE)连接Local的s0/0/0。
二、用GUI界面配置设备
本地局域网(192.168.1.0/24) | ||
1A | FastEthernet | 192.168.1.1 |
1B | FastEthernet | 192.168.1.2 |
Local | F0/0 | 192.168.1.254 |
ISP网络(192.168.2.0/24) | ||
Cisco | FastEthernet | 192.168.2.253 |
ISP | F0/0 | 192.168.2.254 |
点到点WAN(192.168.3.0/24) | ||
ISP | S0/0/0 | 192.168.3.1 |
Local | S0/0/0 | 192.168.3.2 |
1.按照上表配置各个设备各端口的IP地址:在Config->INTERFACE找到相应端口,选择Static IP配置模式,配置IP address和子网掩码,同时应该注意使端口置为“On”;
2. 配置ISP的Serial0/0/0端口的clock rate为64000(因为它为DCE端);
3. 配置ISP上的静态路由:把192.168.1.0(网络号)/255.255.255.0(子网掩码)/192.168.3.2(下一跳)添加:
Config->ROUTING->Static
4. 配置Local上的默认路由:把0.0.0.0/0.0.0.0/192.168.3.1添加。
Config->ROUTING->Static
5. 在Config->GLOBAL->Settings下配置学生A和学生B的Gateway为192.168.1.254(即Local),DNS Server为192.168.2.253(即cisco);
6. 下配置cisco的Gateway为192.168.2.254(即ISP);
Config->GLOBAL->Settings
7. 配置cisco上的DNS服务:Service置为On,把cisco.com和192.168.2.253添加。
Config->SERVICES->DNS
8. 配置cisco上的HTTP服务:Service置为On。(注意,HTTP服务和DNS服务不一定要在同一台服务器实现)。
Config->SERVICES->HTTP
三、在实施模式下测试ping、HTTP和DNS
1. 在1A打开命令行(Desktop->Command Prompt),输入“ping 192.168.2.253”,看是否能够连通;
2. 打开1A的浏览器(Desktop->Web Browser),输入cisco.com,如果成功,会返回主页。
四、用模拟模式测试ping、HTTP和DNS
1. 在右下角,把Realtime模式切换为Simulation模式,会弹出一个Simulation Panel的对话框;
2. 编辑协议过滤器,只查看ICMP事件:
3. 在1A上打开命令行,输入“ping 192.168.2.253”,此时在逻辑工作区可以看到1A上多了一个信封 ;
5. 编辑协议过滤器,只查看DNS和HTTP事件。
6. 打开1A的浏览器,输入cisco.com,和刚才一样观察信封移动的过程和里面内容的变化。注意DNS和HTTP的配合。
作为一个小白我说说自己在做实验中遇到的问题吧!
1.开关忘记设成on
2.在配置路由器Local和ISP时,WIC—2T分别只配置了一个,导致没有相应的接口
3.ping时未连通:因为重新为路由器进行了配置,导致其接口地址忘记填写,补齐后即连通。
~欢迎批评指正,侵权即删~
Packet Tracer 5.2实验(十四) 网络地址转换NAT配置
Packet Tracer 5.2实验(十四) 网络地址转换NAT配置
一、实验目标
理解NAT网络地址转换的原理及功能;
掌握静态NAT的配置,实现局域网访问互联网;
二、实验背景
公司欲发布WWW服务,现要求将内网Web服务器IP地址映射为全局IP地址,实现外部网络可访问公司内部Web服务器。
三、技术原理
网络地址转换NAT(Network Address Translation),被广泛应用于各种类型Internet接入方式和各种类型的网络中。原因很简单,NAT不仅完美解决了IP地址不足的问题,而 且还能够有效地避免来自网络外部的攻击,隐藏并保护网络内部的计算机。
默认情况下,内部IP地址是无法被路由到外网的,内部主机10.1.1.1要与外部internet通信,IP包到达NAT路由器时,IP包头的 源地址10.1.1.1被替换成一个合法的外网IP,并在NAT转换表中保存这条记录。当外部主机发送一个应答到内网时,NAT路由器收到后,查看当前 NAT转换表,用10.1.1.1替换掉这个外网地址。
NAT将网络划分为内部网络和外部网络两部分,局域网主机利用NAT访问网络时,是将局域网内部的本地地址转换为全局地址(互联网合法的IP地址)后转发数据包。
NAT分为两种类型:NAT(网络地址转换)和NAPT(网络端口地址转换IP地址对应一个全局地址)。
静态NAT:实现内部地址与外部地址一对一的映射。现实中,一般都用于服务器;
动态NAT:定义一个地址池,自动映射,也是一对一的。现实中,用得比较少;
NAPT:使用不同的端口来映射多个内网IP地址到一个指定的外网IP地址,多对一。
四、实验步骤
实验拓扑
1、R1为公司出口路由器,其与外部路由之间通过V.35电缆串口连接,DCE端连接在R2上,配置其时钟频率为64000;
2、配置PC机、服务器及路由器接口IP地址;
3、在各路由器上配置静态路由协议,让PC间能相互ping通;
4、在R1上配置静态NAT;
5、在R1上定义内外部网络接口;
6、验证主机之间的互通性。
R1:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#int fa0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#int s2/0
R1(config-if)#ip add 222.0.1.1 255.255.255.0
R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R1(config-if)#
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R1(config-if)#
R1(config-if)#
R1(config-if)#exit
R1(config)#ip route 222.0.2.0 255.255.255.0 222.0.1.2 //配置到222.0.2.0网段的静态路由
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 222.0.1.0/24 is directly connected, Serial2/0
S 222.0.2.0/24 [1/0] via 222.0.1.2
R1#
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#?
arp Set arp type (arpa, probe, snap) or timeout
bandwidth Set bandwidth informational parameter
cdp CDP interface subcommands
crypto Encryption/Decryption commands
custom-queue-list Assign a custom queue list to an interface
delay Specify interface throughput delay
description Interface specific description
duplex Configure duplex operation.
exit Exit from interface configuration mode
fair-queue Enable Fair Queuing on an Interface
hold-queue Set hold queue depth
ip Interface Internet Protocol config commands
mac-address Manually set interface MAC address
mtu Set the interface Maximum Transmission Unit (MTU)
no Negate a command or set its defaults
priority-group Assign a priority group to an interface
service-policy Configure QoS Service Policy
shutdown Shutdown the selected interface
speed Configure speed operation.
tx-ring-limit Configure PA level transmit ring limit
zone-member Apply zone name
R1(config-if)#ip ?
access-group Specify access control for packets
address Set the IP address of an interface
hello-interval Configures IP-EIGRP hello interval
helper-address Specify a destination address for UDP broadcasts
inspect Apply inspect name
ips Create IPS rule
mtu Set IP Maximum Transmission Unit
nat NAT interface commands
ospf OSPF interface commands
split-horizon Perform split horizon
summary-address Perform address summarization
virtual-reassembly Virtual Reassembly
R1(config-if)#ip nat ?
inside Inside interface for address translation
outside Outside interface for address translation
R1(config-if)#ip nat inside ?
<cr>
R1(config-if)#ip nat inside
R1(config-if)#exit
R1(config)#int s2/0
R1(config-if)#ip nat outside ?
<cr>
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#
R1#
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip ?
access-list Named access-list
default-network Flags networks as candidates for default routes
dhcp Configure DHCP server and relay parameters
domain IP DNS Resolver
domain-lookup Enable IP Domain Name System hostname translation
domain-name Define the default domain name
forward-protocol Controls forwarding of physical and directed IP broadcasts
host Add an entry to the ip hostname table
name-server Specify address of name server to use
nat NAT configuration commands
route Establish static routes
tcp Global TCP parameters
R1(config)#ip nat ?
inside Inside address translation
outside Outside address translation
pool Define pool of addresses
R1(config)#ip nat inside ?
source Source address translation
R1(config)#ip nat inside source ?
list Specify access list describing local addresses
static Specify static local->global mapping
R1(config)#ip nat inside source static ?
A.B.C.D Inside local IP address
tcp Transmission Control Protocol
udp User Datagram Protocol
R1(config)#ip nat inside source static 192.168.1.2 ?
A.B.C.D Inside global IP address
R1(config)#ip nat inside source static 192.168.1.2 222.0.1.3 ?
<cr>
R1(config)#ip nat inside source static 192.168.1.2 222.0.1.3 //配置内网到外网的静态NAT映射
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#show ip nat ?
statistics Translation statistics
translations Translation entries
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 222.0.1.3 192.168.1.2 --- ---
R1#
R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 222.0.1.3 192.168.1.2 --- ---
tcp 222.0.1.3:80 192.168.1.2:80 222.0.2.2:1025 222.0.2.2:1025
R1#
R1#show running-config
Building configuration...
Current configuration : 753 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
...
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
shutdown
!
interface Serial2/0
ip address 222.0.1.1 255.255.255.0
ip nat outside
!
interface Serial3/0
no ip address
shutdown
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
no ip address
shutdown
!
ip nat inside source static 192.168.1.2 222.0.1.3
ip classless
ip route 222.0.2.0 255.255.255.0 222.0.1.2
!
...
!
line con 0
line vty 0 4
login
!
!
!
end
R1#
R2:
Router> Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 R2(config)#int fa0/0 R2(config-if)#ip add 222.0.2.1 255.255.255.0 R2(config-if)#no shut %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#exit R2(config)#int s2/0 R2(config-if)#ip add 222.0.1.2 255.255.255.0 R2(config-if)#no shut %LINK-5-CHANGED: Interface Serial2/0, changed state to up R2(config-if)#clock rate 64000 R2(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up R2(config-if)# R2(config-if)# R2(config-if)#exit R2(config)#ip route 192.168.1.0 255.255.255.0 222.0.1.1 R2(config)#end R2# %SYS-5-CONFIG_I: Configured from console by console R2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set S 192.168.1.0/24 [1/0] via 222.0.1.1 C 222.0.1.0/24 is directly connected, Serial2/0 C 222.0.2.0/24 is directly connected, FastEthernet0/0 R2#
PC1:
Packet Tracer PC Command Line 1.0 PC>ipconfig IP Address......................: 222.0.2.2 Subnet Mask.....................: 255.255.255.0 Default Gateway.................: 222.0.2.1 PC>ping 192.168.1.2 Pinging 192.168.1.2 with 32 bytes of data: Request timed out. Reply from 192.168.1.2: bytes=32 time=19ms TTL=126 Reply from 192.168.1.2: bytes=32 time=17ms TTL=126 Reply from 192.168.1.2: bytes=32 time=15ms TTL=126 Ping statistics for 192.168.1.2: Packets: Sent = 4, Received = 3, Lost = 1 (25% loss), Approximate round trip times in milli-seconds: Minimum = 15ms, Maximum = 19ms, Average = 17ms PC>
PC1-WEB:
以上是关于计算机网络实验一:Packet Tracer 入门的主要内容,如果未能解决你的问题,请参考以下文章
Packet Tracer 5.2实验(十五) 网络端口地址转换NAPT配置
计算机网络实验(思科模拟器Cisco Packet Tracer)——无线路由和防火墙配置
第二次实验报告:使用Packet Tracer分析应用层协议
第二次实验报告:使用Packet Tracer分析应用层协议