码迷,mamicode.com
首页 > 其他好文 > 详细

HSRP热备份路由相关练习

时间:2017-10-18 19:50:03      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:hsrp

HSRP热备份路由


如图

技术分享

做不同vlan的热备份路由

PC1 vlan1 ; PC2 vlan2

SW1:

enable 

configure terminal

hostname SW1

no ip domain lookup

vlan 2

vlan 3

vlan10

vlan11

exit

interface fastethernet 0/1

switchport mode access 

switchport access vlan 2   

interface fastethernet 0/2

switchport mode access 

switchport access vlan 3

interface fastethernet 0/3

switchport mode trunk

interface fastethernet 0/4

switchport mode trunk

exit


show interfaces trunk

show vlan brief


省略了一些常规操作

SW2:

ip routing

spanning-tree vlan 1 root primary

spanning-tree vlan 2 root primary  #设置优先级成为vlan2的根交换机

spanning-tree vlan 10 root primary

interface vlan 2

ip address 192.168.1.2 255.255.255.0

standby 1 ip 192.168.1.100

standby 1 preempt

standby 1 priority 200 #默认100 越大优先级高 成为vlan 2主路由设备

interface vlan 3

ip address 192.168.2.2 255.255.255.0

standby 2 ip 192.168.2.100

standby 2 preempt 

interface fastethernet 0/1

switchport trunk encapsulation dot1q

switchport mode trunk 


show ip interface brief

show vlan brief

show spanning-tree

show standby 


SW3:

ip routing

spanning-tree vlan 3 root primary #设置优先级成为vlan3的根交换机

spanning-tree vlan 11 root primary

interface vlan 2     #SVI

ip address 192.168.1.3 255.255.255.0

standby 1 ip 192.168.1.100

standby 1 preempt

interface vlan 3

ip address 192.168.2.3 255.255.255.0

standby 2 ip 192.168.2.100

standby 2 preempt 

standby 2 priority 200   #默认100 越大优先级高 成为vlan 3主路由设备

interface fastethernet 0/2

switchport trunk encapsulation dot1q

switchport mode trunk 


在 SW2 与 SW3 上配置 HSRP 链路跟踪(必须要做)

SW2: 

interface vlan 2

standby 2 track fastethernet 0/2 priority 150   #此为实际命令 模拟器不全

SW3:

interface vlan 3

standby 3 track fastethernet 0/2 priority 150


路由

SW2:

interface vlan 10

ip address 192.168.10.1 255.255.255.0

exit

ip route 192.168.100.0 255.255.255.0 192.168.10.2

SW3:

interface vlan 11

ip address 192.168.20.1 255.255.255.0

exit

ip route 192.168.100.0 255.255.255.0 192.168.20.2


show ip interface brief

show ip route


R1

interface gig0/0

ip address 192.168.10.2 255.255.255.0

interface gig0/1

ip address 192.168.20.2 255.255.255.0

interface loopback 0 

ip address 192.168.100.1 255.255.255.0

exit

ip route 192.168.0.0 255.255.0.0 192.168.10.1

ip route 192.168.0.0 255.255.0.0 192.168.20.1


ping 测试


本文出自 “45545613” 博客,谢绝转载!

HSRP热备份路由相关练习

标签:hsrp

原文地址:http://45545613.blog.51cto.com/13393189/1973807

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!