实验要求:
1、聚合链路采用trunk链路
2、配置S1交换机为STP的服务器,其余交换机为VTP的客户端
3、在S22上配置端口安全性,最大安全地址数量为1,违例处理方式为protect
4、在路由器R上增加一个环回口,代表外网
5、为了更好地理解静态路由及VLAN的工作原理,要求VLAN 2和VLAN 3用二层交换数据
6、从S1交换机所有子网到达vlan 4必须经过trunk链路聚合
7、从S1交换机所有子网到达VLAN 5必须经过路由器R
8、用tracert跟踪路径,并说明之
-
配置PC
配置IP地址、子网掩码、网关
-
配置S22
Switch> en Switch# configure terminal Switch(config)# vlan 2 Switch(config-vlan)# ex Switch(config)# vlan 3 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 Switch(config-if)# ex Switch(config)# interface F0/3 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 3
-
配置S33
Switch> en Switch# configure terminal Switch(config)# vlan 2 Switch(config-vlan)# ex Switch(config)# vlan 3 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 Switch(config-if)# ex Switch(config)# interface F0/3 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 3
-
配置S44
Switch> en Switch# configure terminal Switch(config)# vlan 4 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 4
-
配置S55
Switch> en Switch# configure terminal Switch(config)# vlan 5 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 5
-
配置S1
Switch> en Switch# configure terminal Switch(config)# ip routing Switch(config)# vlan 2 Switch(config-vlan)# ex Switch(config)# vlan 3 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# no switchport Switch(config-if)# ip address 192.168.11.2 255.255.255.0 Switch(config-if)# no shutdown Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface range F0/3-4 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if-range)# channel-protocol lacp Switch(config-if-range)# channel-group 1 mode active Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if)# no shutdown Switch(config)# interface vlan 1 Switch(config-if)# ip address 192.168.1.1 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 2 Switch(config-if)# ip address 192.168.2.1 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 3 Switch(config-if)# ip address 192.168.3.1 255.255.255.0 Switch(config-if)# ex Switch(config)# vtp mode server Switch(config)# vtp domain cisco Switch(config)# vtp password 12345
-
配置S2
Switch> en Switch# configure terminal Switch(config)# ip routing Switch(config)# vlan 4 Switch(config-vlan)# ex Switch(config)# vlan 5 Switch(config-vlan)# ex Switch(config)# interface F0/1 Switch(config-if)# no switchport Switch(config-if)# ip address 192.168.22.2 255.255.255.0 Switch(config-if)# no shutdown Switch(config-if)# ex Switch(config)# interface F0/2 Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/3 Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface F0/4 Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk Switch(config-if)# ex Switch(config)# interface range F0/5-6 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if-range)# channel-protocol lacp Switch(config-if-range)# channel-group 1 mode active Switch(config-if-range)# no shutdown Switch(config-if-range)# ex Switch(config)# interface port-channel 1 Switch(config-if-range)# switchport trunk encapsulation dot1q Switch(config-if-range)# switchport mode trunk Switch(config-if)# no shutdown Switch(config)# interface vlan 1 Switch(config-if)# ip address 192.168.1.254 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 2 Switch(config-if)# ip address 192.168.2.254 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 3 Switch(config-if)# ip address 192.168.3.254 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 4 Switch(config-if)# ip address 192.168.4.1 255.255.255.0 Switch(config-if)# ex Switch(config)# interface vlan 5 Switch(config-if)# ip address 192.168.5.1 255.255.255.0 Switch(config-if)# ex Switch(config)# vtp mode client Switch(config)# vtp domain cisco Switch(config)# vtp password 12345
-
配置路由器
Router> en Router# configure terminal Router(config)# interface G0/0 Router(config-if)# ip address 192.168.11.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)#ex Router(config)# interface G0/1 Router(config-if)# ip address 192.168.22.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)#ex Router(config)# interface loopback0 Router(config-if)# ip address 1.1.1.1 255.255.255.0 Router(config-if)# no shutdown
-
配置S22的端口安全
Switch> en Switch# configure terminal Switch(config)# interface F0/2 Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security maximum 1 Switch(config-if)# switchport port-security violation protect Switch(config-if)# ex Switch(config)# interface F0/3 Switch(config-if)# switchport port-security Switch(config-if)# switchport port-security maximum 1 Switch(config-if)# switchport port-security violation protect
以上把各个设备的基本端口配置完成,下面开始配置符合题意的路由
-
实现题目6的路由
//S1 Switch> en Switch# configure terminal Switch(config)# ip route 192.168.4.0 255.255.255.0 vlan 1 //S2 Switch> en Switch# configure terminal Switch(config)# ip route 192.168.2.0 255.255.255.0 vlan 1 Switch(config)# ip route 192.168.3.0 255.255.255.0 vlan 1
-
实现题目7和全网互通
//S1 Switch> en Switch# configure terminal Switch(config)# ip route 0.0.0.0 0.0.0.0 192.168.11.1 //S2 Switch> en Switch# configure terminal Switch(config)# ip route 0.0.0.0 0.0.0.0 192.168.22.1 //Router Router> en Router# configure terminal Router(config)# ip route 192.168.2.0 192.168.22.2 Router(config)# ip route 192.168.3.0 192.168.22.2 Router(config)# ip route 192.168.4.0 192.168.11.2 Router(config)# ip route 192.168.4.0 192.168.11.2
-
实验验证
用PC0 tracert 各个PC测试互通