一、理论题
1、请简述交换机的工作原理?
当交换机接收到数据帧时,首先根据源MAC地址进行学习,然后到MAC地址表中去寻找目标MAC地址,如果有则单播,如果没有则广播。
2、什么是vlan,划分vlan的方法有哪些?
vlan:虚拟局域网,用来做广播隔离,减少广播风暴,确保数据安全。
划分vlan的方法:
基于端口
基于MAC地址
基于协议
基于子网
基于策略
3、ACCESS与TRUNK有什么区别?
access:接入模式,连接终端设置,只允许一个vlan
trunk:干道模式,用来打标签,实现不同vlan间的通信,连接交换机等设备
4、VTP是什么?有哪些模式?这些模式之间有什么区别?
VTP:VTP是vlan中继协议,vlan同步技术,VTP是将所有的vlan信息打包并通过trunk链路进行传输使vlan同步。
三种模式:server、transparent、client模式
区别:
server模式:可以增改vlan信息,转发VTP信息,同步VTP,保存在NVRAM中
transparent模式:可以增改vlan信息,可以转发VTP信息,保存在NVRAM中,不能同步VTP
client模式:可以转发VTP信息,同步VTP,不能保存在NVRAM中,不可以增改vlan信息
5、什么是端口聚合?有什么作用?
端口聚合:将多个物理端口绑定为一个逻辑端口
作用:避免单点故障,增加带宽,链路备份
6、什么是HSRP和VRRP,有什么区别?
HSRP:热备份路由协议,思科私有
VRRP:虚拟网关路由协议,公有
7、静态路由怎么配置,请将命令格式写出来?
R1(config)#ip route 目标IP地址 目标子网掩码 下一跳地址
8、RIPv1与RIPv2的区别是什么?
RIPv1 RIPv2
在路由更新过程中不携带子网掩码 在路由更新过程中携带子网掩码
不提供认证 提供明文认证和MD5认证
不支持VLSM和CIDR 支持VLSM和CIDR
采用广播更新 采用组播更新(224.0.0.9)更新
有类别路由协议 无类别路由协议
9、RIP路由协议解决环路的机制有哪些?
(1) 定义最大跳数(15跳)
(2) 水平分割
(3) 路由毒化和毒性逆转
(4) 抑制计时器
(5) 触发更新
10、什么ACL?标准ACL与扩展ACL的应用规则是什么?
ACL:访问控制列表,包过滤技术
应用列表:
标准ACL:检查源地址,通常允许或拒绝的是完整的协议。应用在离目标最近的端口,方向为out。
扩展ACL:检查源地址和目标地址,通常允许或拒绝的是某个特定协议。应用在源最近的端口,方向为in。
二、操作题
根据拓朴图完成下列相关任务
1、地址规划
2、为每个设备配置设备名
Router>en
Router#conf
Router(config)#hostname R1(路由器)
Switch>en
Switch#conf
Switch(config)#hostname MS1(图左的三层交换机)
Switch>en
Switch#conf
Switch(config)#hostname MS2(图右的三层交换机)
3、配置链路聚合,增加MS1、MS2、SW1三个设备的传带宽和链路冗余。
基本配置:
给二层交换机划分vlan:
Switch(config)#vlan 10
Switch(config-vlan)#name xs
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name cws
Switch(config-vlan)#vlan 30
Switch(config-vlan)#name jxq
Switch(config-vlan)#vlan 100
Switch(config-vlan)#name fwq
给三层交换机划分vlan:
MS1(config)#vlan 10
MS1(config-vlan)#name xs
MS1(config-vlan)#vlan 20
MS1(config-vlan)#name cws
MS1(config-vlan)#vlan 30
MS1(config-vlan)#name jxq
MS1(config-vlan)#vlan 100
MS1(config-vlan)#name fwq
MS2(config)#vlan 10
MS2(config-vlan)#name xs
MS2(config-vlan)#vlan 20
MS2(config-vlan)#name cws
MS2(config-vlan)#vlan 30
MS2(config-vlan)#name jxq
MS2(config-vlan)#vlan 100
MS2(config-vlan)#name fwq
将服务器和PC机加入交换机对应的vlan:
Switch(config)#int f0/1
Switch(config-if)#switchport mo access
Switch(config-if)#switchport access vlan 100
Switch(config-if)#exit
Switch(config)#int f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 100
Switch(config-if)#exit
Switch(config)#int f0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 100
Switch(config-if)#exit
Switch(config)#int f0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#int f0/5
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#int f0/6
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30
给三层交换机vlan添加ip地址:
MS1(config)#int vlan 10
MS1(config-if)#ip add 192.168.10.254 255.255.255.0
MS1(config-if)#exit
MS1(config)#int vlan 20
MS1(config-if)#ip add 192.168.20.254 255.255.255.0
MS1(config-if)#exit
MS1(config)#int vlan 30
MS1(config-if)#ip add 192.168.30.254 255.255.255.0
MS1(config-if)#exit
MS1(config)#int vlan 100
MS1(config-if)#ip add 192.168.100.254 255.255.255.0
MS1(config)#int f0/1
MS1(config-if)#no switchport
MS1(config-if)#ip add 192.168.0.10 255.255.255.252
MS2(config)#int vlan 10
MS2(config-if)#ip add 192.168.10.253 255.255.255.0
MS2(config-if)#exit
MS2(config)#int vlan 20
MS2(config-if)#ip add 192.168.20.253 255.255.255.0
MS2(config-if)#exit
MS2(config)#int vlan 30
MS2(config-if)#ip add 192.168.30.253 255.255.255.0
MS2(config-if)#exit
MS2(config)#int vlan 100
MS2(config-if)#ip add 192.168.100.253 255.255.255.0
MS2(config)#int f0/1
MS2(config-if)#no switchport
MS2(config-if)#ip add 192.168.0.14 255.255.255.252
交换机之间设置为trunk模式:
MS1(config)#int f0/19
MS1(config-if)#switchport trunk encapsulation dot1q
MS1(config-if)#switchport mode trunk
MS1(config-if)#exit
MS1(config)#int f0/23
MS1(config-if)#switchport trunk encapsulation dot1q
MS1(config-if)#switchport mode trunk
Switch(config)#int f0/21
Switch(config-if)#switchport mode trunk
开启三层交换机路由功能:
MS1(config)#ip routing
MS2(config)#ip routing
给PC机和服务器设置IP地址:
PC0 ping PC1、PC2、服务器都能ping通
开启路由器端口并设置IP地址:
R1(config)#int f0/0
R1(config-if)#no shutdown
R1(config-if)#ip add 192.168.0.9 255.255.255.252
R1(config-if)#exit
R1(config)#int f0/1
R1(config-if)#no shutdown
R1(config-if)#ip add 192.168.0.13 255.255.255.252
给两个三层交换机设置链路聚合:
MS1(config)#int port-channel 1
MS1(config-if)#no switchport
MS1(config-if)#ip add 192.168.0.17 255.255.255.252
MS1(config-if)#exit
MS1(config)#int range f0/19-20
MS1(config-if-range)#switchport trunk encapsulation dot1q
MS1(config-if-range)#switchport mode trunk
MS1(config-if-range)#channel-group 1 mode on
MS2(config)#int port-channel 1
MS2(config-if)#no switchport
MS2(config-if)#ip add 192.168.0.18 255.255.255.252
MS2(config-if)#exit
MS2(config)#int range f0/19-20
MS2(config-if-range)#switchport trunk encapsulation dot1q
MS2(config-if-range)#switchport mode trunk
MS2(config-if-range)#channel-group 1 mode on
MS1(config)#int port-channel 2
MS1(config-if)#no switchport
MS1(config-if)#ip add 192.168.0.1 255.255.255.252
MS1(config-if)#exit
MS1(config)#int range f0/23-24
MS1(config-if-range)#switchport trunk encapsulation dot1q
MS1(config-if-range)#switchport mode trunk
MS1(config-if-range)#channel-group 2 mode on
MS2(config)#int port-channel 3
MS2(config-if)#no switchport
MS2(config-if)#ip add 192.168.0.5 255.255.255.252
MS2(config-if)#exit
MS2(config)#int range f0/21-22
MS2(config-if-range)#switchport trunk encapsulation dot1q
MS2(config-if-range)#switchport mode trunk
MS2(config-if-range)#channel-group 3 mode on
给二层交换机设置链路聚合:
1. 检查IP地址
#show interfaces brief
2. 检查聚合端口
#show running-config
#show spanning-tree(要显示pol1 pol3)
#show etherchannel port-channel
#show interfaces trunk
4、配置生成树协议,使vlan10、vlan100的主根桥为MS1,备份根桥为MS2。(3分)
PVST的配置:
MS1(config)#spanning-tree vlan 10 priority 4096
MS1(config)#spanning-tree vlan 100 priority 4096
MS1(config)#spanning-tree vlan 20 priority 8192
MS1(config)#spanning-tree vlan 30 priority 8192
MS2(config)#spanning-tree vlan 10 priority 8192
MS2(config)#spanning-tree vlan 100 priority 8192
MS2(config)#spanning-tree vlan 20 priority 4096
MS2(config)#spanning-tree vlan 30 priority 4096
MSW1(config)#int vlan 10
MSW1(config)#standby 10 ip 192.168.10.250(设置虚拟ip)
MSW1(config)#standby 10 preempt(开启强制模式)
MSW1(config)#standb 10 track f0/22(跟踪端口,连接的端口都可以跟踪)(原本应该断开的链路)
MSW1(config)#standby 10 priority 101(数字越大,优先级越高,断开端口优先级默认降10)
MSW1(config)#standby 10 timers 3 10(hello时间3秒,保持时间10秒)
MSW1(config)#show standby
MSW2(config)#int vlan 10
MSW2(config)#standby 10 ip 192.168.10.250(设置虚拟ip)
MSW2(config)#standby 10 preempt(开启强制模式)
MSW2(config)#standb 10 track f0/19
MSW2(config)#standby 10 timers 3 10(超过10秒)
MSW1(config)#show standby
修改三层交换vlan的ip 192.168.10/20.250
一端断了另一端还能用
检查生成树协议的配置
#show version 查看MAC地址(基本MAC地址)
#show spanning-tree 查看MAC地址
Switch#show spanning-tree
ALtn BLK阻塞端口(应该显示为pol几(因为做了端口聚合))
5、配置生成树协议,使vlan20、vlan30的主根桥为MS2,备份根桥为MS1。
6、配置HSRP实现网关冗余实现MS1为vlan10、vlan100的活动网关,MS2为vlan10、vlan100的备份网关;MS2为vlan20、vlan30的活动网关,MS1为vlan20、vlan20的备份网关;配置上行线路为跟踪端口。(10分)
检查HSRP的配置
#show standby
7、配置RIP路由协议实现全网通信(10分)
两个三层交换机和路由器都要设置RIP
设置为版本2,no auto-summary
检查RIP的配置,并查看路由表,测试通信
#show running-config
#show ip route
#show ip route rip
8、配置DHCP使vlan10、vlan20、vlan30能自动获取IP地址。
两个三层交换机作中继路由器,在三层交换机的网关地址做(vlan)
检查DHCP配置:dhcp地址池–DHCP中继的配置–客户端使用(最好使用dhcp命令来检查)ipconfig /release ipconfig /renew
#show running-config
ip helper
9、配置WEB/DNS服务器,使所有客户端都能使用www.zlt.com访问学校网站。
HTTP
DNS
DNS/WEB服务的检查
10、配置FTP服务器,使用用户名:admin密码:admin访问FTP服务器。
dir
quit
11、为服务区电脑配置端口安全,违例处理模式为丢包。
给端口指定MAC地址(防止ARP欺骗、泛洪攻击)
端口安全的检查
#show running-config 找到服务器对应的三个端口
12、配置ACL实现以下要求:
(1)学生宿舍与教学区不能访问财务室网段。
标准ACL,应用在离目标最近的端口,方向为out
两个三层交换机的vlan10、vlan30
#show ip access-lists
MSW1拒绝10、拒绝30、允许其他
MSW2拒绝10、拒绝30、允许其他
#show running-config
(2)学生宿舍不能访问FTP服务器。
扩展ACL,应用在离源最近的端口。方向为in
#show running-config
vlan 100
in