背景介绍:下图是模拟某学校网络拓扑结构.在该学校网络接入层采用S2126,接入层交换机划分了办公网VLAN20和学生网VLAN30,VLAN20和VLAN30通过汇聚层交换机S3550与路由器A相连,另3550上有一个Vlan40存放一台网管机。路由器A与B通过路由协议获取路由信息后,办公网可以访问B路由器后的WEBserver 。
实验要求:
1、 配置全网四台设备,使四台设备均能远程管理,为了安全起见,特权密码不能明文显示。
2、 S3550与S2126两台设备创建相应的VLAN,S2126VLAN20包含1-5及7端口,S2126VLAN30包含10-15端口。S3550VLAN30包含16-19端口,VLAN40包含22端口。
3、 S3550与S2126两台设备F0/23与F0/24接口作为TRUNK端口,建立TRUNK链路。
4、 S3550与S2126两台设备运行快速生成树协议,S2126作为根交换机。
5、 在S3550上做相应配置,使得所有VLAN间可以互相访问,并且和RA可以互通。
6、 在S2126上设置F0/5端口为安全端口,该端口下最大地址个数为5,设置违例方式为shutdown。
7、 运用RIPV2路由协议配置全网路由。
详细配置答案:
S2126的配置:
配置远程管理:
S2126>enable
S2126#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
S2126(config)#enable secret level 15 0 star
0d:2h:2m:53s @5-CONFIG:Configured from outband
S2126(config)#enable secret level 15 0 star
0d:2h:2m:59s @5-CONFIG:Configured from outband
S2126(config)#int vlan1
0d:2h:3m:8s @5-CONFIG:Configured from outband
S2126(config-if)#ip add 1.1.1.2 255.255.255.0
0d:2h:3m:18s @5-CONFIG:Configured from outband
S2126(config-if)#no shutdown
0d:2h:3m:25s @5-CONFIG:Configured from outband
S2126(config-if)#exit
0d:2h:5m:12s @5-CONFIG:Configured from outband
S2126#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
S2126(config)#enable secret level 15 0 star
0d:2h:2m:53s @5-CONFIG:Configured from outband
S2126(config)#enable secret level 15 0 star
0d:2h:2m:59s @5-CONFIG:Configured from outband
S2126(config)#int vlan1
0d:2h:3m:8s @5-CONFIG:Configured from outband
S2126(config-if)#ip add 1.1.1.2 255.255.255.0
0d:2h:3m:18s @5-CONFIG:Configured from outband
S2126(config-if)#no shutdown
0d:2h:3m:25s @5-CONFIG:Configured from outband
S2126(config-if)#exit
0d:2h:5m:12s @5-CONFIG:Configured from outband
S2126VLAN20包含1-5,7端口,S2126VLAN30包含10-15端口:
S2126(config)#vlan 20
0d:2h:5m:20s @5-CONFIG:Configured from outband
S2126(config-vlan)#exit
0d:2h:7m:21s @5-CONFIG:Configured from outband
S2126(config)#interface range fa 0/1-5,0/7
0d:2h:7m:40s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport access vlan 20
0d:2h:7m:57s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:8m:9s @5-CONFIG:Configured from outband
S2126(config)#vlan 30
0d:2h:8m:13s @5-CONFIG:Configured from outband
S2126(config-vlan)#exit
0d:2h:8m:15s @5-CONFIG:Configured from outband
S2126(config)#interface range fa 0/10-15
0d:2h:8m:43s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport access vlan 30
0d:2h:9m:10s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:9m:23s @5-CONFIG:Configured from outband
0d:2h:5m:20s @5-CONFIG:Configured from outband
S2126(config-vlan)#exit
0d:2h:7m:21s @5-CONFIG:Configured from outband
S2126(config)#interface range fa 0/1-5,0/7
0d:2h:7m:40s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport access vlan 20
0d:2h:7m:57s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:8m:9s @5-CONFIG:Configured from outband
S2126(config)#vlan 30
0d:2h:8m:13s @5-CONFIG:Configured from outband
S2126(config-vlan)#exit
0d:2h:8m:15s @5-CONFIG:Configured from outband
S2126(config)#interface range fa 0/10-15
0d:2h:8m:43s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport access vlan 30
0d:2h:9m:10s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:9m:23s @5-CONFIG:Configured from outband
S2126的F0/23与F0/24接口作为TRUNK端口,建立TRUNK链路:
S2126(config)#interface range fa 0/23-24
0d:2h:9m:55s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport mode trunk
0d:2h:10m:27s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:10m:48s @5-CONFIG:Configured from outband
0d:2h:9m:55s @5-CONFIG:Configured from outband
S2126(config-if-range)#switchport mode trunk
0d:2h:10m:27s @5-CONFIG:Configured from outband
S2126(config-if-range)#exit
0d:2h:10m:48s @5-CONFIG:Configured from outband
S2126运行快速生成树协议,S2126作为根交换机:
S2126(config)#spanning-tree
0d:2h:11m:5s @5-CONFIG:Configured from outband
S2126(config)#spanning-tree mode rstp
0d:2h:12m:5s @5-CONFIG:Configured from outband
S2126(config)#spanning-terr priority 4096
0d:2h:13m:4s @5-CONFIG:Configured from outband
0d:2h:11m:5s @5-CONFIG:Configured from outband
S2126(config)#spanning-tree mode rstp
0d:2h:12m:5s @5-CONFIG:Configured from outband
S2126(config)#spanning-terr priority 4096
0d:2h:13m:4s @5-CONFIG:Configured from outband
在S2126上设置f0/5端口为安全端口,安全地址最大为5,设置违例方式为shutdown:
S2126(config)#interface fa 0/8
0d:2h:14m:1s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-security
0d:2h:17m:35s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-secruity maximum 5
0d:2h:24m:51s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-security violation shutdown
0d:2h:25m:50s @5-CONFIG:Configured from outband
0d:2h:14m:1s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-security
0d:2h:17m:35s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-secruity maximum 5
0d:2h:24m:51s @5-CONFIG:Configured from outband
S2126(config-if)#switchport port-security violation shutdown
0d:2h:25m:50s @5-CONFIG:Configured from outband
S3550的配置:
配置远程管理:
s3550>enable
s3550#conf ter
s3550(config)#enable secret level 15 0 star
2008-06-06 15:30:01 @5-CONFIG:Configured from outband
s3550(config)#enable secret level 1 0 star
2008-06-06 15:30:21 @5-CONFIG:Configured from outband
s3550(config)#int vlan 1
2008-06-06 15:30:28 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 1.1.1.1 255.255.255.0
2008-06-06 15:30:41 @5-CONFIG:Configured from outband
s3550(config-if)#no shhutdown
2008-06-06 15:30:52 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:31:02 @5-CONFIG:Configured from outband
s3550#conf ter
s3550(config)#enable secret level 15 0 star
2008-06-06 15:30:01 @5-CONFIG:Configured from outband
s3550(config)#enable secret level 1 0 star
2008-06-06 15:30:21 @5-CONFIG:Configured from outband
s3550(config)#int vlan 1
2008-06-06 15:30:28 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 1.1.1.1 255.255.255.0
2008-06-06 15:30:41 @5-CONFIG:Configured from outband
s3550(config-if)#no shhutdown
2008-06-06 15:30:52 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:31:02 @5-CONFIG:Configured from outband
S3550创建相应的VLAN,VLAN30包含16-19端口,VLAN40包含22端口
s3550(config)#vlan 20
2008-06-06 15:32:09 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:11 @5-CONFIG:Configured from outband
s3550(config)#vlan 30
2008-06-06 15:32:15 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:18 @5-CONFIG:Configured from outband
s3550(config)#vlan 40
2008-06-06 15:32:23 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:26 @5-CONFIG:Configured from outband
s3550(config)#vlan 10
2008-06-06 15:32:31 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:57 @5-CONFIG:Configured from outband
s3550(config)#int vlan 10
2008-06-06 15:33:06 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 10.1.1.2 255.255.255.0
2008-06-06 15:33:17 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:33:22 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:33:35 @5-CONFIG:Configured from outband
s3550(config)#interface range fa 0/16-19
2008-06-06 15:33:58 @5-CONFIG:Configured from outband
s3550(config-if-range)#switchport access vlan 30
2008-06-06 15:34:18 @5-CONFIG:Configured from outband
s3550(config-if-range)#exit
2008-06-06 15:34:21 @5-CONFIG:Configured from outband
s3550(config)#interface fa 0/22
2008-06-06 15:34:33 @5-CONFIG:Configured from outband
s3550(config-if)#switchport access vlan 40
2008-06-06 15:34:49 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:34:52 @5-CONFIG:Configured from outband
2008-06-06 15:32:09 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:11 @5-CONFIG:Configured from outband
s3550(config)#vlan 30
2008-06-06 15:32:15 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:18 @5-CONFIG:Configured from outband
s3550(config)#vlan 40
2008-06-06 15:32:23 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:26 @5-CONFIG:Configured from outband
s3550(config)#vlan 10
2008-06-06 15:32:31 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:32:57 @5-CONFIG:Configured from outband
s3550(config)#int vlan 10
2008-06-06 15:33:06 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 10.1.1.2 255.255.255.0
2008-06-06 15:33:17 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:33:22 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:33:35 @5-CONFIG:Configured from outband
s3550(config)#interface range fa 0/16-19
2008-06-06 15:33:58 @5-CONFIG:Configured from outband
s3550(config-if-range)#switchport access vlan 30
2008-06-06 15:34:18 @5-CONFIG:Configured from outband
s3550(config-if-range)#exit
2008-06-06 15:34:21 @5-CONFIG:Configured from outband
s3550(config)#interface fa 0/22
2008-06-06 15:34:33 @5-CONFIG:Configured from outband
s3550(config-if)#switchport access vlan 40
2008-06-06 15:34:49 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:34:52 @5-CONFIG:Configured from outband
S3550的F0/23与F0/24接口作为TRUNK端口,建立TRUNK链路:
s3550(config)#interface range fa 0/23-24
2008-06-06 15:35:19 @5-CONFIG:Configured from outband
s3550(config-if-range)#switchport mode trunk
2008-06-06 15:35:44 @5-CONFIG:Configured from outband
s3550(config-if-range)#exit
2008-06-06 15:35:49 @5-CONFIG:Configured from outband
2008-06-06 15:35:19 @5-CONFIG:Configured from outband
s3550(config-if-range)#switchport mode trunk
2008-06-06 15:35:44 @5-CONFIG:Configured from outband
s3550(config-if-range)#exit
2008-06-06 15:35:49 @5-CONFIG:Configured from outband
S3550运行快速生成树协议:
s3550(config)#spanning-tree
2008-06-06 15:36:29 @5-CONFIG:Configured from outband
s3550(config)#spanning-tree
2008-06-06 15:37:12 @5-CONFIG:Configured from outband
s3550(config)#spanning-tree mode rstp
2008-06-06 15:37:28 @5-CONFIG:Configured from outband
2008-06-06 15:36:29 @5-CONFIG:Configured from outband
s3550(config)#spanning-tree
2008-06-06 15:37:12 @5-CONFIG:Configured from outband
s3550(config)#spanning-tree mode rstp
2008-06-06 15:37:28 @5-CONFIG:Configured from outband
在S3550上做相应配置,使所以vlan间可以相互通信:
s3550(config)#vlan 20
2008-06-06 15:38:06 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:38:10 @5-CONFIG:Configured from outband
s3550(config)#int vlan 20
2008-06-06 15:38:18 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.20.1 255.255.255.0
2008-06-06 15:38:40 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:38:45 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:38:48 @5-CONFIG:Configured from outband
s3550(config)#int vlan 30
2008-06-06 15:38:54 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.30.1 255.255.255.0
2008-06-06 15:39:06 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:39:10 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:39:13 @5-CONFIG:Configured from outband
s3550(config)#int vlan 40
2008-06-06 15:39:22 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.40.1 255.255.255.0
2008-06-06 15:39:33 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:39:49 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:40:23 @5-CONFIG:Configured from outband
2008-06-06 15:38:06 @5-CONFIG:Configured from outband
s3550(config-vlan)#exit
2008-06-06 15:38:10 @5-CONFIG:Configured from outband
s3550(config)#int vlan 20
2008-06-06 15:38:18 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.20.1 255.255.255.0
2008-06-06 15:38:40 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:38:45 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:38:48 @5-CONFIG:Configured from outband
s3550(config)#int vlan 30
2008-06-06 15:38:54 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.30.1 255.255.255.0
2008-06-06 15:39:06 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:39:10 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:39:13 @5-CONFIG:Configured from outband
s3550(config)#int vlan 40
2008-06-06 15:39:22 @5-CONFIG:Configured from outband
s3550(config-if)#ip add 192.168.40.1 255.255.255.0
2008-06-06 15:39:33 @5-CONFIG:Configured from outband
s3550(config-if)#no shutdown
2008-06-06 15:39:49 @5-CONFIG:Configured from outband
s3550(config-if)#exit
2008-06-06 15:40:23 @5-CONFIG:Configured from outband
Ra的配置:
配置远程管理:
Ra>enable
Ra#conf ter
Ra(config)#enable secret star
Ra(config)#line vty 0 4
Ra(config-line)#password star
Ra(config-line)#exit
Ra(config)#int f0
Ra(config-if)#ip add 10.1.1.1 255.255.255.0
Ra(config-if)#no shtutdown
Ra(config-if)#exit
Ra(config)#int s0
Ra(config-if)#ip add 192.168.1.1 255.255.255.0
Ra(config-if)#clock rate 64000
Ra(config-if)#no shutdown
Ra(config-if)#exit
Ra#conf ter
Ra(config)#enable secret star
Ra(config)#line vty 0 4
Ra(config-line)#password star
Ra(config-line)#exit
Ra(config)#int f0
Ra(config-if)#ip add 10.1.1.1 255.255.255.0
Ra(config-if)#no shtutdown
Ra(config-if)#exit
Ra(config)#int s0
Ra(config-if)#ip add 192.168.1.1 255.255.255.0
Ra(config-if)#clock rate 64000
Ra(config-if)#no shutdown
Ra(config-if)#exit
运用RIPV2路由协议配置全网路由
Ra(config)#router rip
Ra(config-router)#network 192.168.1.0
Ra(config-router)#network 10.1.1.0
Ra(config-router)#version 2
Ra(config-router)#no auto-summary
Ra(config-router)#network 192.168.1.0
Ra(config-router)#network 10.1.1.0
Ra(config-router)#version 2
Ra(config-router)#no auto-summary
^
Rb的配置:
配置远程管理:
Rb(config)#enable secret star
Rb(config)#line vty 0 4
Rb(config-line)#password star
Rb(config-line)#exit
Rb(config)#int f0
Rb(config-if)#ip add 172.16.1.1 255.255.255.0
Rb(config-if)#no shutdown
Rb(config-if)#exit
Rb(config)#int s0
Rb(config-if)#ip add 192.168.1.2 255.255.255.0
Rb(config-if)#no shutdown
Rb(config-if)#exit
Rb(config)#line vty 0 4
Rb(config-line)#password star
Rb(config-line)#exit
Rb(config)#int f0
Rb(config-if)#ip add 172.16.1.1 255.255.255.0
Rb(config-if)#no shutdown
Rb(config-if)#exit
Rb(config)#int s0
Rb(config-if)#ip add 192.168.1.2 255.255.255.0
Rb(config-if)#no shutdown
Rb(config-if)#exit
转载于:https://blog.51cto.com/pandeng426/147035