我是靠谱客的博主 尊敬野狼,最近开发中收集的这篇文章主要介绍思科vrrp实例_思科HSRP和VRRP双组双备,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

思科HSRP和VRRP双组双备

af3b7f74d60c6d57ed7171cb00a816ff.png

R1#conf t

R1(config)#int fa0/1

R1(config-if)#ip add 13.0.0.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#exit

R1(config)#

*Mar  1 00:02:10.087: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up

*Mar  1 00:02:11.095: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

R1(config)#ip ro

R1(config)#ip route 0.0.0.0 0.0.0.0 13.0.0.3

R1(config)#int fa0/0

R1(config-if)#ip add 192.168.10.10 255.255.255.0

R1(config-if)#no shut

R1(config-if)#standby 1 ip 192.168.10.1配置一个虚拟的ip地址

R1(config-if)#standby 1 priority 120优先级

R1(config-if)#standby 1 preempt抢占

R1(config-if)#standby 1 track fa0/1跟踪上行口

R1(config-if)#

*Mar  1 00:09:14.259: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on FastEthernet0/0 (not full duplex),

R1(config-if)#end

R1#show standby brief       看HSRP状态

P indicates configured to preempt.

|

Interface Grp  Pri P State   Active          Standby         Virtual IP

Fa0/0     1    120 P Active  local           unknown         192.168.10.1

R1#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#def

R1(config)#defa

R1(config)#default int

R1(config)#default interface fa0/0

R1(config-if)#no shut

R1(config-if)#int fa0/0.10

R1(config-subif)#encapsulation dot1Q 10

R1(config-subif)#ip add 192.168.10.01 255.255.255.0

R1(config-subif)#no shut

R1(config-subif)#standby 1 ip 192.168.10.1

R1(config-subif)#standby 1 preempt

R1(config-subif)#standby 1 track

R1(config-subif)#standby 1 track fa0/1

R1(config-subif)#exit

R1(config)#end

R1#show standby brief

0587704e64455b3d335dcadffc986e45.png

72afa5ebe40d61a738ea0bc9e42c5307.png

R1(config)#int fa0/0.20

R1(config-subif)#en

R1(config-subif)#encapsulation d

R1(config-subif)#encapsulation dot1Q 20

R1(config-subif)#ip add 192.168.20.10 255.255.255.0

R1(config-subif)#no shut

R1(config-subif)#vrrp 1 ip 192.168.20.1

R1(config-subif)#vrrp 1 preempt抢占

R1(config-subif)# vrrp 1 priority  95低优先级

R1(config-subif)#vrrp 1 authentication md5 key-string7

7d34c0ac7b1e71f838cbed86cda32eee.png

vrrp比hsrp更安全          Vrrp可以进行身份验证

R1#show vrrp brief

Interface          Grp Pri Time  Own Pre State   Master addr     Group addr

Fa0/0.20           1   95  3628       Y  Backup  192.168.20.20   192.168.20.1

R2#conf t

R2(config)#int fa0/1

R2(config-if)#ip add 23.0.0.2 255.255.255.0

R2(config-if)#no  shut

R2(config-if)#exit

R2(config)#ip route 0.0.0.0 0.0.0.0 23.0.0.3

R2(config)#do p 1.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:

.!!!!

R2(config)#int fa0/0

R2(config-if)#ip add 192.168.10.20 255.255.255.0

R2(config-if)#no shut

R2(config-if)#do p 192.168.10.10

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.10.10, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 20/27/32 ms

R2(config-if)#st

R2(config-if)#standby

R2(config-if)#standby 1 ip 192.168.10.1

R2(config-if)#standby 1 priority 115比上行口低

R2(config-if)#standby 1 preempt

不用跟踪上行口 已经是备用的

R2(config-if)#end

R2#show standby brief看HSRP状态

P indicates configured to preempt.

|

Interface Grp  Pri P State   Active          Standby         Virtual IP

Fa0/0     1    115 P Standby 192.168.10.10   local           192.168.10.1

R2(config)#int fa0/0

R2(config-if)# default int fa0/0

R2(config)#int fa0/0

R2(config-if)#no shut

R2(config-if)#int fa0/0.10

R2(config-subif)#encapsulation dot1Q 10

R2(config-subif)#ip add 192.168.10.20 255.255.255.0

R2(config-subif)#no shut

R2(config-subif)#standby 1 ip 192.168.10.1

R2(config-subif)#standby 1 priority 95

R2(config-subif)#standby  1 preempt

R2(config-subif)#standby 1 preempt

R2(config-subif)#do show stan b

P indicates configured to preempt.

|

Interface Grp  Pri P State   Active          Standby         Virtual IP

Fa0/0.10  1    95  P Active  local           unknown         192.168.10.1

fe664a9245f33a46d72bd389fe269811.png

R2(config-subif)#exit

R2(config)#end

R2#show ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES TFTP   up                    up

FastEthernet0/0.10         192.168.10.20   YES manual up                    up

FastEthernet0/1            23.0.0.2        YES manual up                    up

R2#conf t

R2(config)#int fa0/0.20

R2(config-subif)#encapsulation dot1Q 20

R2(config-subif)#ip add 192.168.20.20 255.255.255.0

R2(config-subif)#vrrp 1 ip 192.168.20.1

R2(config-subif)#vrrp 1 preempt抢占

R2(config)#track 1 int fa0/1 line-protocol建track对象

R2(config)#int fa0/0.20

R2(config-subif)#vrrp  1 track 1

R2 vrrp已经配置完成

R2#show vrrp brief

Interface          Grp Pri Time  Own Pre State   Master addr     Group addr

Fa0/0.20           1   100 3609       Y  Master  192.168.20.20   192.168.20.1

R3(config)#int fa0/0

R3(config-if)#ip add 13.0.0.3 255.255.255.0

R3(config-if)#no shut

R3(config-if)#int fa0/1

R3(config-if)#ip add 23.0.0.3 255.255.255.0

R3(config-if)# no shut

R3(config-if)#exit

R3(config)#int loo 0

R3(config-if)#ip add 1.1.1.1 255.255.255.0

R3(config-if)#ip route 192.168.10.0 255.255.255.0 13.0.0.1配制回城路由

R3(config)#ip route 192.168.10.0 255.255.255.0 23.0.0.2 10上面挂了走这个路由

R3(config)#end

R3#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

S    192.168.10.0/24 [1/0] via 13.0.0.1

23.0.0.0/24 is subnetted, 1 subnets

C       23.0.0.0 is directly connected, FastEthernet0/1

13.0.0.0/24 is subnetted, 1 subnets

C       13.0.0.0 is directly connected, FastEthernet0/0

R3#conft

R3(config)#ip route 192.168.20.0 255.255.255.0 23.0.0.2做路由

R3(config)#ip route 192.168.20.0 255.255.255.0 13.0.0.1 10比1大就行

R3(config)#int fa0/1

R3(config-if)#shut

R4(config)#

R4(config)#vlan 10

R4(config-vlan)#vlan 20

R4(config-vlan)#int ran fa1/10 -11

R4(config-if-range)#switchport mode trunk

R4(config-if-range)#exit

R4(config)#int fa1/1

R4(config-if)#switchport access vlan  10

R4(config-if)#int fa1/2

R4(config-if)#switchport access vlan 20

PC的配置

26a321f13fac0b4a4dc84aa833c64aa1.png

验证:

54f548b6afb3d984aa901ff9931dea87.png

C1从那边走的

feb0bd98f858e82c2b09bdddbeb26700.png

C2从那边走的

9dcc6693faa59a8cf924610e5ec7685b.png

把R2和R3的fa0/1   shut

2726b698a4c407b9cac2408a5f9dd443.png

看shut之后c2怎么走

a9437c29270cdbdc25f9cc0da3bc7927.png

最后

以上就是尊敬野狼为你收集整理的思科vrrp实例_思科HSRP和VRRP双组双备的全部内容,希望文章能够帮你解决思科vrrp实例_思科HSRP和VRRP双组双备所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(38)

评论列表共有 0 条评论

立即
投稿
返回
顶部