VLANVTPHSRP综合实验(真机测试通过)

hrsp
如图所示:路由器为CISCO 2621XM
交换机SW1和SW2为CISCO 3550 EMI
交换机SW3和SW4为CISCO 2950

CISCO 2621XM通过fa0/1和eth1/0分别与SW1和SW2的fa0/13口相连。
SW1和SW2通过fa0/23和fa0/24相连。
其它连接请看图。

IP址址:CISCO 2621XM fa0/1 192.168.8.1/24
eth1/0 192.168.88.1/24
sw1 fa0/13 192.168.8.2/24
sw2 fa0/13 192.168.88.2/24
vlan 1 192.168.1.1/24
vlan 100 192.168.100.1/24
vlan 200 192.168.200.1/24
vlan 300 192.168.30.1/24
vlan 400 192.168.40.1/24
vlan 500 192.168.50.1/24
vlan 600 192.168.60.1/24
vlan 700 192.168.70.1/24

sw1为VTP SERVER,其它为CLIENT
SW1为vlan1.vlan100.vlan200.vlan300的主根桥,为vlan400.vlan500.vlan600.vlan700的备份根桥
SW2为vlan1.vlan100.vlan200.vlan300的备份根桥,为vlan400.vlan500.vlan600.vlan700的主根桥

r1配置如下:

service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r1
!
enable secret 5 $1$1SWM$uabGf6st2.fd1bIPd9h061
enable password cisco
!
ip subnet-zero
!
!
no ip domain-lookup
!
!
!
!
interface Loopback1
ip address 192.168.188.1 255.255.255.0
!
interface FastEthernet0/0 连ISP
ip address 27.17.X.X 255.255.255.248 用X.X代替实际IP
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1 连SW1
ip address 192.168.8.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Ethernet1/0 连SW2
ip address 192.168.88.1 255.255.255.0
ip nat inside
half-duplex
!
router eigrp 100
network 0.0.0.0
auto-summary
no eigrp log-neighbor-changes
!
ip nat inside source list 100 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 27.17.X.X 用X.X代替实际IP

ip http server
ip pim bidir-enable
!
!
access-list 100 permit ip 192.168.100.0 0.0.0.255 any
access-list 100 permit ip 192.168.8.0 0.0.0.255 any
access-list 100 permit ip 192.168.88.0 0.0.0.255 any
access-list 100 permit ip 192.168.1.0 0.0.0.255 any
access-list 100 permit ip 192.168.200.0 0.0.0.255 any
access-list 100 permit ip 192.168.30.0 0.0.0.255 any
access-list 100 permit ip 192.168.40.0 0.0.0.255 any
access-list 100 permit ip 192.168.50.0 0.0.0.255 any
access-list 100 permit ip 192.168.60.0 0.0.0.255 any
access-list 100 permit ip 192.168.70.0 0.0.0.255 any
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
password cisco
login

SW1配置:
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname sw1
!
!
ip subnet-zero
ip routing
!
no ip domain-lookup
!
!
spanning-tree mode pvst 起PVST
spanning-tree extend system-id
spanning-tree vlan 1,100,200,300 priority 24576 主根桥
spanning-tree vlan 400,500,600,700 priority 28672 备份根桥
!
!
!
!
!
interface Port-channel1 fa/23.24口起以太网通道
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/1
switchport mode dynamic desirable
!
interface FastEthernet0/2
switchport mode dynamic desirable
!
interface FastEthernet0/3
switchport mode dynamic desirable
!
interface FastEthernet0/4
switchport mode dynamic desirable
!
interface FastEthernet0/5
switchport mode dynamic desirable
!
interface FastEthernet0/6
switchport mode dynamic desirable
!
interface FastEthernet0/7
switchport mode dynamic desirable
!
interface FastEthernet0/8
switchport mode dynamic desirable
!
interface FastEthernet0/9
switchport mode dynamic desirable
!
interface FastEthernet0/10
switchport mode dynamic desirable
!
interface FastEthernet0/11
switchport mode dynamic desirable
!
interface FastEthernet0/12
switchport mode dynamic desirable
!
interface FastEthernet0/13 连r1
no switchport
ip address 192.168.8.2 255.255.255.0
shutdown
!
interface FastEthernet0/14
switchport mode dynamic desirable
!
interface FastEthernet0/15
switchport mode dynamic desirable
!
interface FastEthernet0/16
switchport mode dynamic desirable
!
interface FastEthernet0/17
switchport mode dynamic desirable
!
interface FastEthernet0/18
switchport mode dynamic desirable
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/20
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/21
switchport mode dynamic desirable
!
interface FastEthernet0/22
switchport mode dynamic desirable
!
interface FastEthernet0/23
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode desirable
channel-protocol pagp
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode desirable
channel-protocol pagp
!
interface GigabitEthernet0/1
switchport mode dynamic desirable
!
interface GigabitEthernet0/2
switchport mode dynamic desirable
!
interface Vlan1
ip address 192.168.1.1 255.255.255.0
no ip redirects
standby 1 ip 192.168.1.254
standby 1 priority 180
standby 1 preempt
standby 1 track FastEthernet0/13 50
!
interface Vlan100
ip address 192.168.100.1 255.255.255.0
no ip redirects
standby 100 ip 192.168.100.254
standby 100 priority 180
standby 100 preempt
standby 100 track FastEthernet0/13 50
!
interface Vlan200
ip address 192.168.200.1 255.255.255.0
no ip redirects
standby 200 ip 192.168.200.254
standby 200 priority 180
standby 200 preempt
standby 200 track FastEthernet0/13 50
!
interface Vlan300
ip address 192.168.30.1 255.255.255.0
no ip redirects
standby 30 ip 192.168.30.254
standby 30 priority 180
standby 30 preempt
standby 30 track FastEthernet0/13 50
!
interface Vlan400
ip address 192.168.40.1 255.255.255.0
no ip redirects
standby 40 ip 192.168.40.254
standby 40 priority 150
standby 40 preempt
!
interface Vlan500
ip address 192.168.50.1 255.255.255.0
no ip redirects
standby 50 ip 192.168.50.254
standby 50 priority 150
standby 50 preempt
!
interface Vlan600
ip address 192.168.60.1 255.255.255.0
no ip redirects
standby 60 ip 192.168.60.254
standby 60 priority 150
standby 60 preempt
!
interface Vlan700
ip address 192.168.70.1 255.255.255.0
no ip redirects
standby 70 ip 192.168.70.254
standby 70 priority 150
standby 70 preempt
!
router eigrp 100
network 0.0.0.0
auto-summary
no eigrp log-neighbor-changes
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.8.1
ip http server
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login

sw2配置:
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname sw2
!
!
no aaa new-model
!
ip subnet-zero
ip routing
no ip domain-lookup
!
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
spanning-tree vlan 1,100,200,300 priority 28672
spanning-tree vlan 400,500,600,700 priority 24576
!
vlan internal allocation policy ascending
!
!
!
!
!
!
interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/1
switchport mode dynamic desirable
!
interface FastEthernet0/2
switchport mode dynamic desirable
!
interface FastEthernet0/3
switchport mode dynamic desirable
!
interface FastEthernet0/4
switchport mode dynamic desirable
!
interface FastEthernet0/5
switchport mode dynamic desirable
!
interface FastEthernet0/6
switchport mode dynamic desirable
!
interface FastEthernet0/7
switchport mode dynamic desirable
!
interface FastEthernet0/8
switchport mode dynamic desirable
!
interface FastEthernet0/9
switchport mode dynamic desirable
!
interface FastEthernet0/10
switchport mode dynamic desirable
!
interface FastEthernet0/11
switchport mode dynamic desirable
!
interface FastEthernet0/12
switchport mode dynamic desirable
!
interface FastEthernet0/13
no switchport
ip address 192.168.88.2 255.255.255.0
!
interface FastEthernet0/14
switchport mode dynamic desirable
!
interface FastEthernet0/15
switchport mode dynamic desirable
!
interface FastEthernet0/16
switchport mode dynamic desirable
!
interface FastEthernet0/17
switchport mode dynamic desirable
!
interface FastEthernet0/18
switchport mode dynamic desirable
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/20
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/21
switchport mode dynamic desirable
!
interface FastEthernet0/22
switchport mode dynamic desirable
!
interface FastEthernet0/23
switchport trunk encapsulation dot1q
switchport mode trunk
channel-protocol pagp
channel-group 1 mode desirable
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
channel-protocol pagp
channel-group 1 mode desirable
!
interface GigabitEthernet0/1
switchport mode dynamic desirable
!
interface GigabitEthernet0/2
switchport mode dynamic desirable
!
interface Vlan1
ip address 192.168.1.2 255.255.255.0
standby 1 ip 192.168.1.254
standby 1 priority 150
standby 1 preempt
!
interface Vlan100
ip address 192.168.100.2 255.255.255.0
standby 100 ip 192.168.100.254
standby 100 priority 150
standby 100 preempt
!
interface Vlan200
ip address 192.168.200.2 255.255.255.0
standby 200 ip 192.168.200.254
standby 200 priority 150
standby 200 preempt
!
interface Vlan300
ip address 192.168.30.2 255.255.255.0
standby 30 ip 192.168.30.254
standby 30 priority 150
standby 30 preempt
!
interface Vlan400
ip address 192.168.40.2 255.255.255.0
standby 40 ip 192.168.40.254
standby 40 priority 180
standby 40 preempt
standby 40 track FastEthernet0/13 50
!
interface Vlan500
ip address 192.168.50.2 255.255.255.0
standby 50 ip 192.168.50.254
standby 50 priority 180
standby 50 preempt
standby 50 track FastEthernet0/13 50
!
interface Vlan600
ip address 192.168.60.2 255.255.255.0
standby 60 ip 192.168.60.254
standby 60 priority 180
standby 60 preempt
standby 60 track FastEthernet0/13 50
!
interface Vlan700
ip address 192.168.70.2 255.255.255.0
standby 70 ip 192.168.70.254
standby 70 priority 180
standby 70 preempt
standby 70 track FastEthernet0/13 50
!
!
router eigrp 100
no auto-summary
network 0.0.0.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.88.1
ip http server
ip http secure-server
!
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login

SW3配置:
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname sw3
!
!
ip subnet-zero
!
no ip domain-lookup
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
!
interface FastEthernet0/1
switchport access vlan 200
switchport mode access
no ip address
!
interface FastEthernet0/2
switchport access vlan 200
switchport mode access
no ip address
!
interface FastEthernet0/3
switchport access vlan 200
switchport mode access
no ip address
!
interface FastEthernet0/4
switchport access vlan 200
switchport mode access
no ip address
!
interface FastEthernet0/5
no ip address
!
interface FastEthernet0/6
no ip address
!
interface FastEthernet0/7
no ip address
!
interface FastEthernet0/8
no ip address
!
interface FastEthernet0/9
no ip address
!
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
no ip address
!
interface FastEthernet0/13
no ip address
!
interface FastEthernet0/14
no ip address
!
interface FastEthernet0/15
no ip address
!
interface FastEthernet0/16
no ip address
!
interface FastEthernet0/17
no ip address
!
interface FastEthernet0/18
no ip address
!
interface FastEthernet0/19
switchport mode trunk
no ip address
!
interface FastEthernet0/20
switchport mode trunk
no ip address
!
interface FastEthernet0/21
no ip address
!
interface FastEthernet0/22
no ip address
!
interface FastEthernet0/23
no ip address
!
interface FastEthernet0/24
no ip address
!
interface GigabitEthernet0/1
no ip address
!
interface GigabitEthernet0/2
no ip address
!
interface Vlan1
ip address 192.168.1.3 255.255.255.0
no ip route-cache
!
ip http server
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login
!

SW4配置:
no service single-slot-reload-enable
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname sw4
!
!
clock timezone GMT 8
ip subnet-zero
no ip domain-lookup
!
spanning-tree extend system-id
!
!
interface FastEthernet0/1
switchport access vlan 100
switchport mode access
no ip address
!
interface FastEthernet0/2
switchport access vlan 100
switchport mode access
no ip address
!
interface FastEthernet0/3
switchport access vlan 100
switchport mode access
no ip address
!
interface FastEthernet0/4
switchport access vlan 100
switchport mode access
no ip address
!
interface FastEthernet0/5
no ip address
!
interface FastEthernet0/6
no ip address
!
interface FastEthernet0/7
no ip address
!
interface FastEthernet0/8
no ip address
!
interface FastEthernet0/9
no ip address
!
interface FastEthernet0/10
no ip address
!
interface FastEthernet0/11
no ip address
!
interface FastEthernet0/12
no ip address
!
interface FastEthernet0/13
no ip address
!
interface FastEthernet0/14
no ip address
!
interface FastEthernet0/15
no ip address
!
interface FastEthernet0/16
no ip address
!
interface FastEthernet0/17
no ip address
!
interface FastEthernet0/18
no ip address
!
interface FastEthernet0/19
switchport mode trunk
no ip address
!
interface FastEthernet0/20
switchport mode trunk
no ip address
!
interface FastEthernet0/21
no ip address
!
interface FastEthernet0/22
no ip address
!
interface FastEthernet0/23
no ip address
!
interface FastEthernet0/24
no ip address
duplex full
speed 100
!
interface Vlan1
ip address 192.168.1.4 255.255.255.0
no ip route-cache
!
ip http server
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login
!

SW1的HSRP

1100200300vlansw1active

SW2的HSRP
1100200300vlansw2active

SW4上,把fa0/1-4划入vlan100,并在fa0/1上接入PC机,测试如下图

sw1

现在把SW1的fa0/13口shutdown,看下SW1和SW2的HRSP状态

sw1fa013down
sw1fa013downsw2

SW1的fa0/13口shutdown后,PC机tracert 202.103.24.68的情况

sw1down

此条目发表在cisco分类目录,贴了标签。将固定链接加入收藏夹。

VLANVTPHSRP综合实验(真机测试通过)》有一条回应

  1. 4566说:

    不错,值得—看

评论已关闭。