实验一
一、实验名称:交换机和路由器的基本配置
二、实验学时:1
三、实验内容和目的:
理解和掌握交换机和路由器的工作原理;掌握交换机和路由器命令行各种操作模式的区别;能够使用各种帮助信息,以及用命令进行基本的配置。
四、实验原理:
利用交换机或路由器的命令行操作模式,在用户模式、特权模式、全局配置模式、端口模式下输入不同的命令,进行路由器或交换机的配置。
五、实验器材(设备、元器件)
计算机一台、cisco packet tracer instructor 软件
实验环境
七、实验步骤:
1.交换机的配置
(1)各操作模式的切换
(2)交换机命令行界面基本功能
(3)配置交换机的名称和每日提示信息
(4)配置接口状态
(5)查看交换机的系统配置信息
(6)保存配置
2.路由器配置
(1)配置路由器接口并查看接口配置
(2)显示路由表信息
八、实验数据及结果分析:
交换机配置文件
SW-1#show running-config
Building configuration…
Current configuration : 1204 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW-1
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
description “This is a Accessport.”
duplex half
speed 10
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
…………
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
banner motd ^C
Welcome to SW-1 ,if you are admin,you can config it.
if you are not admin,please EXIT!
^C
!
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
End
路由器配置文件
Router#show running-config
Building configuration…
Current configuration : 564 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
实验二
一、实验名称:虚拟局域网VLAN组网
二、实验学时:2
三、实验内容和目的:
握如何在交换机上划分基于端口的VLAN、如何给VLAN内添加端口,理解跨交换机之间VLAN的特点。
四、实验原理:
(1)使用VLAN实现隔离 (2)使用三层交换机实现VLAN间的互联互通
五、实验器材(设备、元器件)
计算机一台、cisco packet tracer instructor 软件
六、实验环境
七、实验步骤:
1.使用vlan实现隔离
第一步:配置两台交换机的主机名
第二步:在三层交换机上生成VLAN 并添加成员端口
第三步:在二层交换机上生成VLAN并添加成员端口
第四步:设置交换机之间的链路为Trunk
第五步:查看VLAN和Trunk的配置
第六步:验证配置
2.使用三层交换机实现VLAN间互联互通
第一步:在三层交换机上配置SVI端口
第二步:启动三层交换机路由转发
第三步:查看SVI端口的配置
第四步:更改网关
第五步:验证配置
八、实验数据及结果分析:
1.使用vlan实验隔离
交换机配置文件:L3-SW
Building configuration…
Current configuration : 1695 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname L3-SW
!
!
…………
!
!
spanning-tree mode pvst
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/11
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/12
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/13
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/14
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/15
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/16
!
…………!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
End
L2-SW
Building configuration…
Current configuration : 1320 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname L2-SW
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
!
…………
!
interface FastEthernet0/5
!
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/9
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/10
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/11
!
…………
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
:ping测试结果图
2.使用三层交换机实现VLAN间互联互通
交换机配置文件
Building configuration…
Current configuration : 1856 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname L3-SW
!
ip routing
!
spanning-tree mode pvst
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
…………
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/7
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/8
switchport access vlan 10
switchport mode access
!
…………
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
End
ping测试结果图
实验三
一、实验名称:静态路由
二、实验学时:2
三、实验内容和目的:
理解静态路由的工作原理,掌握如何配置静态路由。
四、实验原理:
路由器属于网络层设备,能够根据IP包头的信息,选择一条最佳路径,将数据包转发出去。实现不同网段的主机之间的互相访问。
路由器是根据路由表进行选路和转发的。而路由表里就是由一条条的路由信息组成。路由表的产生方式一般有3种,其中静态路由:在拓扑结构简单的网络中,网管员通过手工的方式配置本路由器未知网段的路由信息,从而实现不同网段之间的连接。
五、实验器材(设备、元器件)
计算机一台、cisco packet tracer instructor 软件
六、实验环境
七、实验步骤:
1.设备准备
2. 线路和网络端口连接
3.网络地址分配
4.对路由器进行静态路由配置
5.Ping测试
八、实验数据及结果分析:
一:路由表信息
Router0路由表
Router0缺省配置后路由表
Router1路由表
二:Ping测试
Pc0 ping pc 1 静态路由配置前
Pc0 ping pc1 静态路由配置后
Pc0 ping pc1 缺省路由配置后
三:各路由器配置文件
Router0:
Building configuration…
Current configuration : 850 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router0
!
no ip cef
no ipv6 cef
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
interface Serial1/0
ip address 202.155.18.1 255.255.255.252
clock rate 64000
!
interface Serial1/1
no ip address
shutdown
!
interface Serial1/2
no ip address
shutdown
!
interface Serial1/3
no ip address
shutdown
!
ip classless
ip route 192.168.5.0 255.255.255.0 202.115.18.2
ip route 192.168.9.0 255.255.255.0 202.115.18.2
ip route 0.0.0.0 0.0.0.0 202.155.18.2
!
ip flow-export version 9
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
End
Router1:
Building configuration…
Current configuration : 767 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router1
!!
no ip cef
no ipv6 cef
!
interface FastEthernet0/0
ip address 192.168.9.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.5.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 202.155.18.2 255.255.255.252
!
interface Serial1/1
no ip address
shutdown
!
interface Serial1/2
no ip address
shutdown
!
interface Serial1/3
no ip address
shutdown
!
ip classless
ip route 192.168.1.0 255.255.255.0 202.155.18.1
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
实验四
一、实验名称:动态路由协议OSPF
二、实验学时:3
三、实验内容和目的:
掌握在路由器上如何配置OSPF路由协议
四、实验原理:
OSPF路由协议一般用于同一个路由域内。在这里,路由域是指一个自治系统Autonomous System—AS。在AS中,所有的OSPF路由器都维护一个相同的描述这个AS结构的数据库,该数据库中存放的是路由域中相应链路的状态信息,OSPF路由器正是通过这个数据库计算出其OSPF路由表的。OSPF将链路状态广播数据包LSA(Link State Advertisement)传送给在某一区域内的所有路由器,这一点与距离矢量路由协议不同。运行距离矢量路由协议的路由器是将部分或全部的路由表传递给与其相邻的路由器。
五、实验器材(设备、元器件)
计算机一台、cisco packet tracer instructor 软件
六、实验环境:
七、实验步骤:
1、网络拓扑构建
2、配置静态路由(与后续的OSPF作对比)
3、配置动态路由OSPF
八、实验数据及结果分析:
静态路由 Ping 测试
1.pc3 ping pc0
2.Pc 0 到 pc 2 数据包跟踪
动态路由 ping 测试
1.pc3 ping pc0
2.Pc 0 到 pc 2 数据包跟踪
路由器运行信息
Router 0
Building configuration…
Current configuration : 910 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router0
!
no ip cef
no ipv6 cef
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial1/0
ip address 202.155.18.1 255.255.255.252
clock rate 64000
!
interface Serial1/1
ip address 202.155.18.5 255.255.255.252
clock rate 2000000
!
interface Serial1/2
no ip address
shutdown
!
interface Serial1/3
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
network 202.155.18.0 0.0.0.3 area 0
network 202.155.18.4 0.0.0.3 area 0
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
end
Router 1
Building configuration…
Current configuration : 943 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router1
!
!
!
no ip cef
no ipv6 cef
!
!
interface FastEthernet0/0
ip address 192.168.9.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.5.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 202.155.18.2 255.255.255.252
!
interface Serial1/1
ip address 202.155.18.9 255.255.255.252
clock rate 2000000
!
interface Serial1/2
no ip address
shutdown
!
interface Serial1/3
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 202.155.18.0 0.0.0.3 area 0
network 192.168.5.0 0.0.0.255 area 0
network 192.168.9.0 0.0.0.255 area 0
network 202.155.18.8 0.0.0.3 area 0
!
ip classless
!
ip flow-export version 9
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
end
Router2
Router2#show running-config
Building configuration…
Current configuration : 875 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router2
!
!
no ip cef
no ipv6 cef
!
!!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial1/0
ip address 202.155.18.6 255.255.255.252
!
interface Serial1/1
ip address 202.155.18.10 255.255.255.252
!
interface Serial1/2
no ip address
shutdown
!
interface Serial1/3
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 202.155.18.4 0.0.0.3 area 0
network 202.155.18.8 0.0.0.3 area 0
network 192.168.12.0 0.0.0.255 area 0
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end