实验使用的工具:小凡模拟器
实验一:
ATEN—第四章 阶段综合实验_三层交换
一、更改设备名,激活端口、设置为Trunk
3L-SW1
Router>
Router>enable
Router#config terminal
Router(config)#hostname 3L-sw1-jing
3L-sw1-jing(config)#interface range f0/1 -2 , f0/11 -12
3L-sw1-jing(config-if-range)#switchport mode trunk
3L-sw1-jing(config-if-range)#no shutdown
3L-sw1-jing(config-if-range)#end
3L-SW2
Router>enable
Router#config terminal
Router(config)#hostname 3L-sw2-jing
3L-sw2-jing(config)#interface range f0/1 -2 , f0/11 -12
3L-sw2-jing(config-if-range)#switchport mode trunk
3L-sw2-jing(config-if-range)#no shutdown
3L-sw2-jing(config-if-range)#end
2L-SW3
Router>
Router>enable
Router#config terminal
Router(config)#hostname 2L-sw3-jin
2L-sw3-jin(config)#interface range f0/11 -12
2L-sw3-jin(config-if-range)#switchport mode trunk
2L-sw3-jin(config-if-range)#interface range f0/11 -12 , f0/1 -2
2L-sw3-jin(config-if-range)#no shutdown
2L-sw3-jin(config-if-range)#end
2L-SW4
Router>
Router>enable
Router#config terminal
Router(config)#hostname 2L-sw4-jin
2L-sw4-jin(config)#interface range f0/11 -12
2L-sw4-jin(config-if-range)#switchport mode trunk
2L-sw4-jin(config-if-range)#interface range f0/11 -12 , f0/1 -2
2L-sw4-jin(config-if-range)#no shutdown
2L-sw4-jin(config-if-range)#end
二、配置VTP,创建vlan,并在2L-SW上将端口加入相应的vlan中
3L-SW1
3L-sw1-jin#
3L-sw1-jin#vlan database
3L-sw1-jin(vlan)#vtp domain t208
3L-sw1-jin(vlan)#vlan 2 name jishubu
3L-sw1-jin(vlan)#vlan 3 name renshibu
3L-sw1-jin(vlan)#vlan 4 name caiwubu
3L-sw1-jin(vlan)#vlan 5 name shichangbu
3L-sw1-jin(vlan)#exit
3L-sw1-jin#show vtp status
3L-sw1-jin#show vlan-s
3L-SW2
3L-sw2-jin#show vtp status
3L-sw2-jin#show vlan-s
2L-SW3
2L-sw3-jin#show vtp status
2L-sw3-jin#show vlan-s
2L-sw3-jin#config terminal
2L-sw3-jin(config)#interface f0/1
2L-sw3-jin(config-if)#switchport access vlan 2
2L-sw3-jin(config-if)#interface f0/2
2L-sw3-jin(config-if)#switchport access vlan 3
2L-sw3-jin(config-if)#end
2L-sw3-jin#show vlan-s
2L-SW4
2L-sw4-jin#show vtp status
2L-sw4-jin#show vlan-s
2L-sw4-jin#config terminal
2L-sw4-jin(config)#interface f0/1
2L-sw4-jin(config-if)#switchport access vlan 4
2L-sw4-jin(config-if)#interface f0/2
2L-sw4-jin(config-if)#switchport access vlan 5
2L-sw4-jin(config-if)#end
2L-sw4-jin#show vlan-s
三、在3L-sw两个三层交换机上分别对vlan配置ip
3L-SW1
3L-sw1-jin#config terminal
3L-sw1-jin(config)#ip routing
3L-sw1-jin(config)#interface vlan 2
3L-sw1-jin(config-if)#ip address 20.0.0.1 255.0.0.0
3L-sw1-jin(config-if)#no shutdown
3L-sw1-jin(config-if)#interface vlan 3
3L-sw1-jin(config-if)#ip address 30.0.0.1 255.0.0.0
3L-sw1-jin(config-if)#no shutdown
3L-sw1-jin(config-if)#interface vlan 4
3L-sw1-jin(config-if)#ip address 40.0.0.1 255.0.0.0
3L-sw1-jin(config-if)#no shutdown
3L-sw1-jin(config-if)#interface vlan 5
3L-sw1-jin(config-if)#ip address 50.0.0.1 255.0.0.0
3L-sw1-jin(config-if)#no shutdown
3L-sw1-jin(config-if)#end
3L-sw1-jin#show ip interface brief
3L-SW2
3L-sw2-jin#config terminal
3L-sw2-jin(config)#ip routing
3L-sw2-jin(config)#interface vlan 2
3L-sw2-jin(config-if)#ip address 20.0.0.2 255.0.0.0
3L-sw2-jin(config-if)#no shutdown
3L-sw2-jin(config-if)#interface vlan 3
3L-sw2-jin(config-if)#ip address 30.0.0.2 255.0.0.0
3L-sw2-jin(config-if)#no shutdown
3L-sw2-jin(config-if)#interface vlan 4
3L-sw2-jin(config-if)#ip address 40.0.0.2 255.0.0.0
3L-sw2-jin(config-if)#no shutdown
3L-sw2-jin(config-if)#interface vlan 5
3L-sw2-jin(config-if)#ip address 50.0.0.2 255.0.0.0
3L-sw2-jin(config-if)#no shutdown
3L-sw2-jin(config-if)#end
3L-sw2-jin#show ip interface brief
四、在3L-SW两个交换机上配置以太网通道(EthernetChannel)
3L-SW1
3L-sw1-jin#config terminal
3L-sw1-jin(config)#interfac range f0/1 -2
3L-sw1-jin(config-if-range)#channel-group 1 mode on
3L-sw1-jin(config-if-range)#end
3L-sw1-jin#show etherchannel 1 summary
3L-SW2
3L-sw2-jin#config terminal
3L-sw2-jin(config)#interface range f0/1 -2
3L-sw2-jin(config-if-range)#channel-group 1 mode on
3L-sw2-jin(config-if-range)#end
3L-sw2-jin#show etherchannel 1 summary
五、在3L-SW两个交换机上配置根网桥,vlan2 -3——3L-SW1为根网桥
   vlan4 -5——3L-SW2为根网桥
      ;并互为备用根网桥
3L-SW1
3L-sw1-jin#config terminal
3L-sw1-jin(config)#spanning-tree vlan 2 root primary
3L-sw1-jin(config)#spanning-tree vlan 3 root primary
3L-sw1-jin(config)#spanning-tree vlan 4 root secondary
3L-sw1-jin(config)#spanning-tree vlan 5 root secondary
3L-sw1-jin(config)#exit
3L-sw1-jin#show spanning-tree brief
3L-SW2
3L-sw2-jin#config terminal
3L-sw2-jin(config)#spanning-tree vlan 4 root primary
3L-sw2-jin(config)#spanning-tree vlan 5 root secondary
3L-sw2-jin(config)#spanning-tree vlan 5 root primary
3L-sw2-jin(config)#spanning-tree vlan 2 root secondary
3L-sw2-jin(config)#spanning-tree vlan 3 root secondary
3L-sw2-jin(config)#exit
3L-sw2-jin#show spanning-tree brief
六、在2L-SW两个交换机上分别配置上行速链路和速端口
2L-SW3
2L-sw3-jin#config terminal
2L-sw3-jin(config)#spanning-tree uplinkfast
2L-sw3-jin(config)#interface f0/12
2L-sw3-jin(config-if)#spanning-tree portfast
2L-sw3-jin(config-if)#end
2L-sw3-jin#show spanning-tree brief
2L-SW4
2L-sw4-jin#config terminal
2L-sw4-jin(config)#spanning-tree uplinkfast
2L-sw4-jin(config)#interface f0/12
2L-sw4-jin(config-if)#spanning-tree portfast
2L-sw4-jin(config-if)#end
2L-sw4-jin#show spanning-tree brief
七、使用show命令查看各个交换机上的配置
show vlan-s
show vtp status
show ip interface brief
show ip route
show interface trunk
show etherchannel 1 summary
show spanning-tree brief
八、配置PC的ip,验证
VPCS 1 >
VPCS 1 >show
VPCS 1 >ip 20.0.0.3 20.0.0.1 8
VPCS 1 >2
VPCS 2 >ip 30.0.0.3 30.0.0.1 8
VPCS 2 >3
VPCS 3 >ip 40.0.0.3 40.0.0.2 8
VPCS 3 >4
VPCS 4 >ip 50.0.0.3 50.0.0.2 8
VPCS 4 >show
VPCS 4 >ping 40.0.0.2
VPCS 4 >ping 40.0.0.3
VPCS 4 >ping 30.0.0.3
VPCS 4 >ping 20.0.0.3
实验完成!!
实验二:
ATEN—第四章 阶段综合实验_STP协议_02
一、更改设备名,激活端口、设置为trunk
2L-SW1
Router>
Router>enable
Router#config terminal
Router(config)#hostname 2L-sw1-jin
2L-sw1-jin(config)#interface range f0/0 , f0/15
2L-sw1-jin(config-if-range)#switchport mode trunk
2L-sw1-jin(config-if-range)#interface range f0/0 -3 , f0/15
2L-sw1-jin(config-if-range)#no shutdown
2L-sw1-jin(config-if-range)#end
2L-SW2
Router>
Router>enable
Router#config terminal
Router(config)#hostname 2L-sw2-jin
2L-sw2-jin(config)#interface range f0/15
2L-sw2-jin(config-if-range)#switchport mode trunk
2L-sw2-jin(config-if-range)#interface range f0/15 , f0/1 -3
2L-sw2-jin(config-if-range)#no shutdown
2L-sw2-jin(config-if-range)#end
2L-SW3
Router>
Router>enable
Router#config terminal
Router(config)#hostname 2L-sw3-jin
2L-sw3-jin(config)#interface range f0/0
2L-sw3-jin(config-if-range)#switchport mode trunk
2L-sw3-jin(config-if-range)#interface range f0/0 -2
2L-sw3-jin(config-if-range)#no shutdown
2L-sw3-jin(config-if-range)#end
3L-SW4
Router>
Router>enable
Router#config terminal
Router(config)#hostname 3L-sw4-jin
3L-sw4-jin(config)#interface f0/0
3L-sw4-jin(config-if)#switchport mode trunk
3L-sw4-jin(config-if)#no shutdown
3L-sw4-jin(config-if)#end
R1
Router>
Router>enable
Router#config terminal
Router(config)#hostname R1-jin
二、配置VTP,创建vlan,在2L-SW1、2上把端口加入相应的vlan中;在2L-SW3上创建vlan,并加入相应的端口;在3L-SW4上对2L-SW1、2上的vlan设置ip地址
    
2L-SW1
2L-sw1-jin#vlan database
2L-sw1-jin(vlan)#vtp domain t208
2L-sw1-jin(vlan)#vlan 2 name jishubu
2L-sw1-jin(vlan)#vlan 3 name renshibu
2L-sw1-jin(vlan)#exit
2L-sw1-jin#show vtp status
2L-sw1-jin#show vlan-s
2L-sw1-jin#config terminal
2L-sw1-jin(config)#interface range f0/1 -2
2L-sw1-jin(config-if-range)#switchport access vlan 2
2L-sw1-jin(config-if-range)#interface f0/3
2L-sw1-jin(config-if)#switchport access vlan 3
2L-sw1-jin(config-if)#end
2L-sw1-jin#show vlan-s
2L-SW2
2L-sw2-jin#show vtp status
2L-sw2-jin#show vlan-s
2L-sw2-jin#config terminal
2L-sw2-jin(config)#interface range f0/1 -2
2L-sw2-jin(config-if-range)#switchport access vlan 3
2L-sw2-jin(config-if-range)#interface f0/3
2L-sw2-jin(config-if)#switchport access vlan 2
2L-sw2-jin(config-if)#end
2L-sw2-jin#show vlan-s
2L-SW3
2L-sw3-jin#show vlan-s
2L-sw3-jin#vlan database
2L-sw3-jin(vlan)#vlan 2
2L-sw3-jin(vlan)#vlan 3
2L-sw3-jin(vlan)#exit
2L-sw3-jin#show vlan-s
2L-sw3-jin#config terminal
2L-sw3-jin(config)#interface f0/1
2L-sw3-jin(config-if)#switchport access vlan 2
2L-sw3-jin(config-if)#interface f0/2
2L-sw3-jin(config-if)#switchport access vlan 3
2L-sw3-jin(config-if)#end
2L-sw3-jin#show vlan-s
3L-SW4
3L-sw4-jin#show vtp status
3L-sw4-jin#show vlan-s
3L-sw4-jin#config terminal
3L-sw4-jin(config)#ip routing
3L-sw4-jin(config)#interface vlan 2
3L-sw4-jin(config-if)#ip address 20.0.0.1 255.0.0.0
3L-sw4-jin(config-if)#no shutdown
3L-sw4-jin(config-if)#interface vlan 3
3L-sw4-jin(config-if)#ip address 30.0.0.1 255.0.0.0
3L-sw4-jin(config-if)#no shutdown
3L-sw4-jin(config-if)#end
3L-sw4-jin#show ip interface brief
三、在3L-SW4上启用路由接口,在R1上配置单臂路由,再分别配置静态路由。
3L-SW4
3L-sw4-jin#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
3L-sw4-jin(config)#interface f0/1
3L-sw4-jin(config-if)#no switchport
3L-sw4-jin(config-if)#ip address 10.0.0.1 255.0.0.0
3L-sw4-jin(config-if)#no shutdown
3L-sw4-jin(config-if)#end
3L-sw4-jin#config terminal
3L-sw4-jin(config)#ip route 40.0.0.0 255.0.0.0 10.0.0.2
3L-sw4-jin(config)#ip route 50.0.0.0 255.0.0.0 10.0.0.2
3L-sw4-jin(config)#exit
3L-sw4-jin#show ip route
R1
R1-jin>enable
R1-jin#config terminal
R1-jin(config)#interface f0/0
R1-jin(config-if)#no shutdown
R1-jin(config-if)#interface f0/0.1
R1-jin(config-subif)#encapsulation dot1q 2
R1-jin(config-subif)#ip address 40.0.0.1 255.0.0.0
R1-jin(config-subif)#no shutdown
R1-jin(config-subif)#interface f0/0.2
R1-jin(config-subif)#encapsulation dot1q 3
R1-jin(config-subif)#ip address 50.0.0.1 255.0.0.0
R1-jin(config-subif)#no shutdown
R1-jin(config-subif)#exit
R1-jin(config)#interface f1/0
R1-jin(config-if)#ip address 10.0.0.2 255.0.0.0
R1-jin(config-if)#no shutdown
R1-jin(config-if)#exit
R1-jin(config)#ip route 20.0.0.0 255.0.0.0 10.0.0.1
R1-jin(config)#ip route 30.0.0.0 255.0.0.0 10.0.0.1
R1-jin(config)#exit
R1-jin#show ip route
四、配置PC,验证:实现全网通信
VPCS 1 >
VPCS 1 >show
VPCS 1 >ip 20.0.0.2 20.0.0.1 8
VPCS 1 >2
VPCS 2 >ip 20.0.0.3 20.0.0.1 8
VPCS 2 >3
VPCS 3 >ip 30.0.0.2 30.0.0.1 8
VPCS 3 >4
VPCS 4 >ip 30.0.0.3 30.0.0.1 8
VPCS 4 >5
VPCS 5 >ip 30.0.0.4 30.0.0.1 8
VPCS 5 >6
VPCS 6 >ip 20.0.0.4 20.0.0.1 8
VPCS 6 >7
VPCS 7 >ip 40.0.0.2 40.0.0.1 8
VPCS 7 >8
VPCS 8 >ip 50.0.0.2 50.0.0.1 8
VPCS 8 >show
NAME   IP/CIDR              GATEWAY
PC1    20.0.0.2/8           20.0.0.1
PC2    20.0.0.3/8           20.0.0.1
PC3    30.0.0.2/8           30.0.0.1
PC4    30.0.0.3/8           30.0.0.1
PC5    30.0.0.4/8           30.0.0.1
PC6    20.0.0.4/8           20.0.0.1
PC7    40.0.0.2/8           40.0.0.1
PC8    50.0.0.2/8           50.0.0.1
PC9    0.0.0.0/0            0.0.0.0
VPCS 8 >ping 40.0.0.2
40.0.0.2 icmp_seq=1 timeout ——超时
40.0.0.2 icmp_seq=2 time=62.000 ms ——连通ok!
40.0.0.2 icmp_seq=3 time=63.000 ms
40.0.0.2 icmp_seq=4 time=62.000 ms
40.0.0.2 icmp_seq=5 time=63.000 ms
VPCS 8 >ping 30.0.0.2
VPCS 8 >ping 30.0.0.3
VPCS 8 >ping 30.0.0.4
VPCS 8 >ping 20.0.0.2
VPCS 8 >ping 20.0.0.3
VPCS 8 >ping 20.0.0.4
VPCS 8 >7
VPCS 7 >ping 30.0.0.2
VPCS 7 >ping 30.0.0.3
VPCS 7 >ping 20.0.0.4
VPCS 7 >1
VPCS 1 >ping 20.0.0.4
VPCS 1 >ping 30.0.0.4
VPCS 1 >3
VPCS 3 >ping 30.0.0.4