STP (spanning Tree Protocol,生成树)就是把一个环形的结构改变成一个树形的结构,STP协议就是用来将物理上存在环路的网络,通过一种算法,在逻辑上,阻塞一些端口,来生成一个逻辑结构。
HSRP(host standby routing protocol,热备路由协议)是思科私有的一种技术,它确保了当地边缘设备或接入设备出现故障时,用户通信能迅速并透明地恢复,以此为ip网络提供冗余性。
VTP是一种信息协议,它使用第二层帧,在交换机之间传递VLAN信息,被称为VTP通告。
EIGRP(Enhanced Interior Gateway Routing Protocol ) 增强内部网管关由线路协议, Cisco公司的私有协议, EIGRP结合了链路状态和距离矢量型路由选择协议的Cisco专用协议,采用弥散修正算法(DUAL)来实现快速收敛,可以不发送定期的路由更新信息以减少带宽的占用,支持Appletalk、IP、Novell和NetWare等多种网络层协议。
新建实验拓扑图
在R1上输入命令:
R1:
en
vlan database
vtp domain dragon
vtp password 123456
vtp server
vlan 10
vlan 11
vlan 12
vlan 13
vlan 14
exit
configure terminal
interface range fastEthernet1/0 - 3
switchport mode trunk
no shutdown
interface range fastEthernet1/14 - 15
switchport mode trunk
channel-group 1 mode on
exit
spanning-tree vlan 10 root primary
spanning-tree vlan 10 priority 4096
spanning-tree vlan 11 root primary
spanning-tree vlan 11 priority 4096
spanning-tree vlan 12 root secondary
spanning-tree vlan 13 root secondary
interface vlan 10
ip address 192.168.10.1 255.255.255.0
no shutdown
standby 10 ip 192.168.10.10
standby 10 priority 200
standby 10 preempt
standby 10 track f1/13 100
interface vlan 11
ip address 192.168.11.1 255.255.255.0
no shutdown
standby 11 ip 192.168.11.11
standby 11 priority 200
standby 11 preempt
standby 11 track f1/13 100
interface vlan 12
ip address 192.168.12.1 255.255.255.0
no shutdown
standby 12 ip 192.168.12.12
standby 12 priority 150
interface vlan 13
ip address 192.168.13.1 255.255.255.0
no shutdown
standby 13 ip 192.168.13.13
standby 13 priorit 150
exit
interface f1/13
no switchport
ip address 10.0.0.2 255.255.255.252
no shutdown
exit
router eigrp 1
network 10.0.0.0
network 192.168.10.0
network 192.168.11.0
network 192.168.12.0
network 192.168.13.0
end
在R2上输入命令
R2:
en
vlan database
vtp domain dragon
vtp password 123456
vtp server
vlan 10
vlan 11
vlan 12
vlan 13
vlan 14
exit
configure terminal
interface range fastEthernet1/14 - 15
switchport mode trunk
channel-group 1 mode on
exit
spanning-tree vlan 12 root primary
spanning-tree vlan 12 priority 4096
spanning-tree vlan 13 root primary
spanning-tree vlan 13 priority 4096
spanning-tree vlan 10 root secondary
spanning-tree vlan 11 root secondary
interface vlan 10
ip address 192.168.10.2 255.255.255.0
no shutdown
standby 10 ip 192.168.10.10
standby 10 priority 150
interface vlan 11
ip address 192.168.11.2 255.255.255.0
no shutdown
standby 11 ip 192.168.11.11
standby 11 priority 150
interface vlan 12
ip address 192.168.12.2 255.255.255.0
no shutdown
standby 12 ip 192.168.12.12
standby 12 priority 200
standby 12 preempt
standby 12 track f1/3 100
interface vlan 13
ip address 192.168.13.3 255.255.255.0
no shutdown
standby 13 ip 192.168.13.13
standby 13 priority 200
standby 13 preempt
standby 13 track f1/3 100
exit
interface f1/3
no switchport
ip address 10.0.0.6 255.255.255.252
no shutdown
exit
router eigrp 1
network 10.0.0.4
network 192.168.10.0
network 192.168.11.0
network 192.168.12.0
network 192.168.13.0
end
R7
en
configure terminal
interface fastEthernet1/13
no switchport
ip address 10.0.0.1 255.255.255.252
no shutdown
interface fastEthernet1/3
no switchport
no shutdown
interface fastEthernet1/7
no switchport
ip address 20.0.0.1 255.255.255.252
no shutdown
exit
router eigrp 1
network 10.0.0.0
network 10.0.0.4
network 20.0.0.0
End
R3:
en
vlan database
vtp client
vtp domain dragon
vtp password 123456
exit
configure terminal
int f1/1
switchport mode trunk
int f1/11
switchport mode trunk
exit
spanning-tree vlan 10
spanning-tree vlan 11
spanning-tree vlan 12
spanning-tree vlan 13
int f1/3
switchport access vlan 10
end
R4-5配置与R3大致相同,只需要更改一下端口号和接受的VLAN即可。
通过命令“show standby brief”查看R1和R2成hsrp,可以看到
通过命令“show spanning-tree brief”查看到R1,R2, R3的生成树,可以看到R2的f1/11被阻塞了端口
通过命令”show vtp status和show VLAN-swiport”查看R3的vtp管理情况。
从顶部pc1(ip:20.0.0.2)ping通底部pc2(ip:192.168.10.100)