VRRP CISCO 应用

原理:

虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是由IETF提出的解决局域网中配置静态网关出现单点失效现象的路由协议,1998年已推出正式的RFC2338协议标准。VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及及时在实际第一跳路由器使用失败的情形下仍能够维护路由器间的连通性。

实验拓扑:

实验环境:

用思科的设备,模拟软件完成,小凡模拟器

终端用Xmanager Enterprise 4  中的xshell链接

Sw1 sw1(config)#no ip routing   //取消三层交换
sw1(config)#line console 0
sw1(config-line)#logging synchronous
sw1(config-line)#no exec-timeout
sw1#show vlan-switch  // 查看vlan
sw1#vlan database         //创建vlan
sw1(vlan)#vlan 10 name stc
sw1(vlan)#vlan 20 name server
sw1(config)#int f0/2           //加入vlan
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 10
sw1(config-if)#int f0/15
sw1(config-if)#switchport mode access
sw1(config-if)#switchport access vlan 20
sw1(config)#int f0/0           //做trunk
sw1(config-if)#switchport mode trunk
sw1(config-if)#switchport trunkencapsulation dot1q
sw1(config-if)#int f0/1
sw1(config-if)#switchport mode trunk
sw1(config-if)#switchport trunkencapsulation dot1q
sw1#show int f0/1 switchport
sw1(config)#int vlan 1    //建立远程连接账户
sw1(config-if)#ip add 192.168.1.1255.255.255.0
sw1(config)#username admin password admin
sw1(config)#line vty 0 4
sw1(config-line)#login local

sw2

sw2(config)#no ip routing
Router(config)#hostname sw2
sw2(config)#line console 0
sw2(config-line)#logging synchronous
sw2(config-line)#no exec-timeout
sw2#vlan database
sw2(vlan)#vlan 10 name stc
sw2(vlan)#vlan 20 name servwer
sw2(config)#int f0/2
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 10
sw2(config-if)#int f0/15
sw2(config-if)#switchport mode access
sw2(config-if)#switchport access vlan 20
sw2(config-if)#int f0/0
sw2(config-if)#switchport mode trunk
sw2(config-if)#switchport trunkencapsulation dot1q
sw2(config-if)#int f0/1
sw2(config-if)#switchport mode trunk
sw2(config-if)#switchport trunkencapsulation dot1q
sw2(config)#username admin password admin
sw2(config)#line vty 0 4
sw2(config-line)#login local

r1

r1(config)#line console 0
r1(config-line)#logging synchronous
r1(config-line)#no exec-timeout
r1(config)#int f0/0
r1(config-if)#no sh
r1(config)#int f0/0.10
r1(config-subif)#encapsulation dot1Q 10  // 一定要先打标签,不然配不上IP
r1(config-subif)#ip add 192.168.10.1255.255.255.0
r1(config-subif)#int f0/0.20
r1(config-subif)#encapsulation dot1Q 20
r1(config-subif)#ip add 192.168.20.1255.255.255.0

r2

Router(config)#hostname r2
r2(config)#line console 0
r2(config-line)#logging synchronous
r2(config-line)#no exec-t
r2(config)#interface f0/0
r2(config-if)#no shu
r2(config-if)#int f0/0.1
r2(config-subif)#encapsulation dot1Q 10
r2(config-subif)#ip add 192.168.10.2255.255.255.0
r2(config-subif)#int f0/0.2
r2(config-subif)#encapsulation dot1Q 20
r2(config-subif)#ip add 192.168.20.2255.255.255.0

vrrp

r1(config)#int f0/0.10
r1(config-subif)#vrrp 10 ip 192.168.10.254  // 把这个接口加入10组,并添加IP
r1#show vrrp    、、//查看vrrp
r1(config)#int f0/0.10
r1(config-subif)#vrrp 10 priority 120    // 改变组10优先级
r1(config-subif)#int f0/0.20
r1(config-subif)#vrrp 20 ip 192.168.20.254
r1(config-subif)#vrrp 20 priority 120

r2

r2(config)#int f0/0.1
r2(config-subif)#vrrp 10 ip 192.168.10.254   //和r1的虚拟IP一致
r2(config-subif)#int f0/0.2
r2(config-subif)#vrrp 20 ip 192.168.20.254

vrrp配置结束

测试:用两台虚拟机链接,分别桥接和仅主机模式

如果想要实现负载均衡,把优先级改了,两个路由器各100和各120

就实现了负载均衡

时间: 2024-12-21 22:18:44

VRRP CISCO 应用的相关文章

cisco IOS,nexus和Arista 的vrrp

最近有用到Arista 7150S 万兆交换机,基本配置跟cisco 的nexus 比较像,但是跟cisco nexus 还是有些差别,后面大家有类似的场景可以注意下:1,Arista 7150s datasheet 设备延时为350ns,比cisco 的250ns 稍高,但是官方说明起了L3功能延时不变,nexus 没有类似的说明,2,设备配置vrrp 需要开启ip routing 和ip multicast-routing,vrrp 的状态才能正常,默认是不开启的,其它设备如果有类似需要用到

cisco dhcp vlan vtp stp vrrp ospf

ciso dhcp vlan stp vtp vrrp ospf 一.拓扑 二.接口配置 IOU1(config)# hostname dhcp dhcp(config)# int e0/0 dhcp(config-if)# ip add 1.1.1.1 255.255.255.0 dhcp(config-if)# no shut dhcp(config)# int e0/1 dhcp(config-if)# ip add 2.2.2.1 255.255.255.0 dhcp(config-if

Cisco VRRP Config Case1

实验图如下图示: 实验连线如下: R1 f0/0 <-> ESW1 f0/0 R1 f0/1 <-> ESW2 f0/1 R2相当于PC1,关闭路由器功能后,设置f0/1接口地址为192.168.1.1/24和网关192.168.1.254. R3相当于PC2,关闭路由器功能后,设置f0/0接口地址为192.168.2.2/24和网关192.168.2.254. ESW1 f0/14 <-> ESW2 f0/14 ESW1 f0/15 <-> ESW2 f0

VRRP协议具体解释

转帖:http://blog.chinaunix.net/space.php?uid=11654074&do=blog&id=2857384 Contents                                                                                                                                   Page 文件夹 入木三分学网络第一篇--VRRP协议具体解释... 1

3-redundancy protocol-HSRP Configuration on Cisco IOS

In this section we will do an HSRP configuration to understand the issue better. To do this we will use the below the topology [t'pld]. At the end ofthis article, you will find the GNS3 configuration lab of this lesson. Before the HSRP configuration,

入木三分学网络第一篇--VRRP协议详解第一篇(转)

因为keepalived使用了VRRP协议,所有有必要熟悉一下. 虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称VRRP)是解决局域网中配置静态网关时,静态网关出现单点失效现象的路由协议. VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器(位于一个虚拟路由器组中, 在该组中,只有一台路由器--master路由器工作,转发数据包,其它路由器是backup路由器,不参与转发数据包),以及在实

安全基线规范之Cisco核心交换机

当前已经进入了互联网+的时代,几乎绝大部分商家.企业.甚至国企央企都在拓展互联网业务,经济的飞速发展,人民生活水平提高,人们都忙于工作没有时间和精力去享受经济带来的福利,而网络业务能够给大众提供更加方便快捷的服务,所以引得互联网更加的火热.但是快捷背后时候存在着诸多的安全隐患,在巨大利益的引诱下许多商家大量的投入人力.财力去发展互联网业务,却极少重视它的安全稳定,千里之堤毁于蚁穴,信息安全的建设不是一朝一夕,而是循序渐进,防微杜渐. 那么本篇文章主要介绍的就是从最基本的安全角度出发,来规范和完善

Layer2-网关冗余技术HSRP、VRRP、GLBP

session 1 ARP代理技术 1.arp代理 arp代理功能是L3层网关设备所有的功能,路由器或者L3层交换机.arp代理功能利用arp协议的不可靠性来代替终端进行L3层转发,因为arp-requst广播被L3层隔离,所以需要L3层网关代替终端进行arp-requst,当PC发送arp-requst去往不同目的网段时,网关设备会收到arp广播,并且用自己的MAC地址作为PC请求的目的主机的MAC地址回给发送端PC(利用arp欺骗原理),让PC构建一个目的ip对应网关MAC的帧,这样再次发送

cisco learn book index

------------------------------------------------------------------ Routing TCP/IP Volume 1 , Second Edition ------------------------------------------------------------------ Routing TCP/IP Volume 2 ---------------------------------------------------