Você está na página 1de 47

Conceito sobre HSRP,VRRP

Configuração em equipamentos cisco, juniper e Huawei


Uma visão geral do HSRP

O Hot Standby Router Protocol (HSRP) é um protocolo da Cisco que, conforme detalhado no RFC 2281, permite que
vários gateways clientes sejam configurados como um roteador "virtual". Este roteador "virtual" é configurado com
um único endereço IP que é compartilhado entre o grupo junto com um endereço MAC virtual. A ideia por trás disso é,
claro, que o cliente veja seu único gateway, mesmo que esse gateway falhe. O HSRP elege um roteador ativo que
encaminha os pacotes IP do cliente. Um roteador de backup ou de espera pode ser configurado para assumir o
encaminhamento de pacotes caso o roteador ativo falhe. Para rastrear um ao outro, o HSRP usa multicast para enviar
suas atualizações e hellos do HSRP.

NOTA: O valor de prioridade pode ser de 1 a 255.o padrão é 100. Uma prioridade maior resultará nesse roteador
sendo eleito o roteador ativo. Se as prioridades
de todos os roteadores no grupo são iguais, o roteador com endereço IP mais alto se torna o roteador ativo
Active -ro u ter
HSRP_CISCO P rio rity 1 0 1

1 9 2 .1 6 8 .4 0 .5 / 2 4 1 9 2 .1 6 8 .4 0 .3 / 2 4
Ospf are a 0
eth0/0 fast0/0
eth0/3
fast0/1
R5 Vlan 40 R3 14
1 7 2 .4 0 .0 .1 2 / 3 0 Ospf 1 0 0
eth0/2 eth0/1 Lo 0 -1 7 2 .4 0 .0 .3 / 3 2
fast0/1 1 7 2 .4 0 .0 .8 / 3 0
13 9
10
Vlan 40 1 9 2 .1 6 8 .4 0 .0 / 2 4 R2
1 7 fast1/0 R1
Vi rtu a l-ga te w a y- fast0/0 fast0/0
1 9 2 .1 6 8 .4 0 .1 Lo 0 -1 7 2 .4 0 .0 .2 / 3 2
Lo 0 -1 7 2 .4 0 .0 .1 / 3 2
eth0/2 eth0/1 Lo 1 -1 9 2 .1 6 8 .5 0 .1 / 2 4
1 7 2 .4 0 .0 .1 6 / 3 0
18
eth0/0 fast0/0
eth0/3 fast0/1
R6 1 9 2 .1 6 8 .4 0 .4 / 2 4 R4
1 9 2 .1 6 8 .4 0 .6 / 2 4
Vlan 40
Lo 0 -1 7 2 .4 0 .0 .4 / 3 2
Sta ndby-ro u ter
P rio rity 1 0 0
Dada a topologia acima configurar HSRP de forma que os roteadores R5 e R6 tenham accesso a loopback 1 do
roteador R1 ainda que o roteador R3 e ou R4 cair. O roteador R3 devera estar no modo active e o roteador R4 no
modo standby. Os switches deveram fazer etherchannel nas suas interfaces e0/1-2 passando a vlan 40 como vlan de
interligação.

O roteadores R5-R6 serão usados para semular hosts finais e deverão apontar a routas default estatica ao IP virtual
do HSRP.

Para teste deveremos apos a configuração e teste desligar as interfaces do roteador R3 e analisar o comportamento
do trafego dentro da topologia.
R1_CONFIG

interface Loopback0
ip address 172.40.0.1 255.255.255.255
!
interface Loopback1
ip address 192.168.50.1 255.255.255.0
!
interface FastEthernet0/0
ip address 172.40.0.9 255.255.255.252
duplex auto
speed auto
!
!
router ospf 100
router-id 172.40.0.1
log-adjacency-changes
network 172.40.0.1 0.0.0.0 area 0
network 172.40.0.9 0.0.0.0 area 0
network 192.168.50.1 0.0.0.0 area 0
R2_CONF router ospf 100
router-id 172.40.0.2
interface Loopback0 log-adjacency-changes
ip address 172.40.0.2 255.255.255.255 network 172.40.0.2 0.0.0.0 area 0
! network 172.40.0.10 0.0.0.0 area 0
interface FastEthernet0/0 network 172.40.0.13 0.0.0.0 area 0
ip address 172.40.0.10 255.255.255.252 network 172.40.0.17 0.0.0.0 area 0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.40.0.13 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 172.40.0.17 255.255.255.252
duplex auto
speed auto
R3_CONFIG router ospf 100
router-id 172.40.0.3
interface Loopback0 log-adjacency-changes
ip address 172.40.0.3 255.255.255.255 network 172.40.0.3 0.0.0.0 area 0
! network 172.40.0.14 0.0.0.0 area 0
interface FastEthernet0/0 network 192.168.40.1 0.0.0.0 area 0
ip address 192.168.40.3 255.255.255.0 network 192.168.40.3 0.0.0.0 area 0
duplex auto
speed auto
standby 1 ip 192.168.40.1
standby 1 priority 101
standby 1 preempt
!
interface FastEthernet0/1
ip address 172.40.0.14 255.255.255.252
duplex auto
speed auto
!
Configuração do HSRP no roteador R3

R3(config-if)#standby 1 ?
authentication Authentication
follow Name of HSRP group to follow
ip Enable HSRP IPv4 and set the virtual IP address
ipv6 Enable HSRP IPv6
mac-address Virtual MAC address
name Redundancy name string
preempt Overthrow lower priority Active routers
priority Priority level
timers Hello and hold timers
track Priority tracking

R3(config-if)#standby 1 ip 192.168.40.1
R3(config-if)#standby 1 priority 101
R3(config-if)#standby 1 preempt
R3(config-if)#
*Mar 1 01:12:58.443: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active
R3_CONFIG

interface Loopback0
ip address 172.40.0.4 255.255.255.255
!
interface FastEthernet0/0
ip address 192.168.40.4 255.255.255.0
duplex auto
speed auto
standby 1 ip 192.168.40.1
standby 1 preempt
!
interface FastEthernet0/1
ip address 172.40.0.18 255.255.255.252
speed 100
full-duplex
!
router ospf 100
router-id 172.40.0.4
log-adjacency-changes
network 172.40.0.4 0.0.0.0 area 0
network 172.40.0.18 0.0.0.0 area 0
network 192.168.40.1 0.0.0.0 area 0
network 192.168.40.4 0.0.0.0 area 0
Configuração do HSRP no roteador R4

R4(config)#interface fastEthernet 0/0


R4(config-if)#standby 1 ip 192.168.40.1
R4(config-if)#standby 1 priority 100
R4(config-if)#standby 1 preempt

*Mar 1 01:32:45.011: %HSRP-5-STATECHANGE: FastEthernet0/0 Grp 1 state Standby -> Active


SW_FCOC1 SW_FCOC1(config)#interface Port-channel1
SW_FCOC1(config-if)#switchport trunk encapsulation dot1q
SW_FCOC1(config)#vlan 40 SW_FCOC1(config-if)#switchport trunk allowed vlan 40
SW_FCOC1(config)#interface ethernet 0/0
SW_FCOC1(config-if)#switchport mode access
SW_FCOC1(config-if)#switchport access vlan 40

SW_FCOC1(config)#interface ethernet 0/3


SW_FCOC1(config-if)#switchport mode access
SW_FCOC1(config-if)#switchport access vlan 40

SW_FCOC1(config)#interface range ethernet 0/1-2


SW_FCOC1(config-if-range)#switchport trunk encapsulation
dot1q
SW_FCOC1(config-if-range)#switchport mode trunk
SW_FCOC1(config-if-range)#switchport trunk allowed vlan 40
SW_FCOC1(config-if-range)#channel-group 1 mode active
SW_FCOC2 !
interface Port-channel1
SW_FCOC2(config)#vlan 40 switchport
switchport trunk encapsulation dot1q
SW_FCOC2(config)#interface ethernet 0/0 switchport trunk allowed vlan 40
SW_FCOC2(config-if)#switchport mode access
SW_FCOC2(config-if)#switchport access vlan 40

SW_FCOC2(config)#interface ethernet 0/3


SW_FCOC2(config-if)#switchport mode access
SW_FCOC2(config-if)#switchport access vlan 40

SW_FCOC2(config)#interface range ethernet 0/1-2


SW_FCOC2(config-if-range)#switchport trunk encapsulation
dot1q
SW_FCOC2(config-if-range)#switchport trunk allowed vlan
40
SW_FCOC2(config-if-range)#switchport mode trunk
SW_FCOC2(config-if-range)#channel-group 1 mode active
Creating a port-channel interface Port-channel 1
CONFIGURAÇÃO R5

interface FastEthernet0/0
ip address 192.168.40.5 255.255.255.0
duplex auto
speed auto
!
!
ip route 0.0.0.0 0.0.0.0 192.168.40.1

CONFIGURAÇÃO R6

interface FastEthernet0/0
ip address 192.168.40.6 255.255.255.0
duplex auto
speed auto
!
!
ip route 0.0.0.0 0.0.0.0 192.168.40.1
BATERIA DE TESTES R5#traceroute 192.168.50.1

TESTE DE PING A TRACE ENTRE O ROTEADOR R5 E A Type escape sequence to abort.


LOOPBACK 1 DO R1 Tracing the route to 192.168.50.1

1 192.168.40.3 28 msec 276 msec 12 msec


R5#ping 192.168.50.1 2 172.40.0.13 32 msec 44 msec 40 msec
3 172.40.0.9 88 msec 60 msec *
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.50.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
52/58/64 ms
Observando o trace acima podemos ver que o trafego entre o roteador R5 ao roteador R1 flui no sentido
R5-R3-R2-R1, Neste contexto iremos colocar As portas do R3 em shutdown para analisar-como o trafego ira
comportar-se.

R3(config)#interface fastEthernet 0/0


R3(config-if)#shutdown

R3(config)#interface fastEthernet 0/1

R3(config-if)#shutdown
R1#ping 192.168.40.5

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.40.5, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
52/60/72 ms
R1#tr
R1#traceroute 192.168.40.5

Type escape sequence to abort.


Tracing the route to 192.168.40.5

1 172.40.0.10 20 msec 20 msec 20 msec


2 172.40.0.18 32 msec 48 msec 40 msec
3 192.168.40.5 64 msec 52 msec *
Uma visão geral do VRRP

É provável que, se você tiver um ambiente de vários fornecedores e desejar os mesmos benefícios do HSRP, configure o
VRRP (Virtual Router Redundancy Protocol), protocolo de redundância de roteador virtual) para fazer isso. O VRRP,
detalhado no RFC 3768, opera da mesma maneira que o HSRP, elegendo um roteador Ativo chamado de Mestre entre
um grupo de roteadores e permitindo que ele seja o "detentor" de um IP e MAC virtual. Assim como no HSRP, uma
falha acionaria o roteador em espera (backup) para então se tornar o mestre e, subsequentemente, encaminhar o
tráfego do cliente. O VRRP também usa multicast para o seu mecanismo de hello e eleições, mas ao contrário do HSRP
* que usa 224.0.0.2 (esta sub-rede) o VRRP usa o 224.0.0.18.
Dada a topologia abaixo configurar o vrrp de forma que o roteador R3 torna-se o master de forma que
o trafego entre a rede 192.168.40.0/24 flua no sentido R3-R2-R1 e ou R1-R2-R3-R5-6
em caso o roteador R3 estar fora de serviço o trafego devera fluir no sentido inverso.

R4-R2-R1 e ou R1-R2-R4-R5-6

1-Apos configurar o vrrp na rede:

*Devera se o roteador R3 e realmente o roteador master

*colocar o R3 em baixo e analisar se trafego ira mesmo fluir em sentido contrario


Active -ro u ter
VRRP_JUNIPER P rio rity 1 0 1

1 9 2 .1 6 8 .4 0 .5 / 2 4 1 9 2 .1 6 8 .4 0 .3 / 2 4
Ospf are a 0
eth0/0 fast0/0
eth0/3 R3 fast0/1
R5 Vlan 40 14
1 7 2 .4 0 .0 .1 2 / 3 0
eth0/2 eth0/1 Lo 0 -1 7 2 .4 0 .0 .3 / 3 2
fast0/1 1 7 2 .4 0 .0 .8 / 3 0
13 9
10
Vlan 40 1 9 2 .1 6 8 .4 0 .0 / 2 4 R2
1 7 fast1/0 R1
Vi rtu a l-ga te w a y- fast0/0 fast0/0
1 9 2 .1 6 8 .4 0 .1 Lo 0 -1 7 2 .4 0 .0 .2 / 3 2
Lo 0 -1 7 2 .4 0 .0 .1 / 3 2
eth0/2 eth0/1 Lo 1 -1 9 2 .1 6 8 .5 0 .1 / 2 4
1 7 2 .4 0 .0 .1 6 / 3 0
18
eth0/0 fast0/0
R4 fast0/1
R6 eth0/3 1 9 2 .1 6 8 .4 0 .4 / 2 4
1 9 2 .1 6 8 .4 0 .6 / 2 4
Vlan 40
Lo 0 -1 7 2 .4 0 .0 .4 / 3 2
Sta ndby-ro u ter
P rio rity 1 0 0
R3_CONFIG

set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.3/24 vrrp-group 1 virtual-address 192.168.40.1
set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.3/24 vrrp-group 1 priority 101
set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.3/24 vrrp-group 1 preempt
set interfaces ge-0/0/1 unit 0 family inet address 172.40.0.14/30

set protocols ospf export VRRP_OSPF


set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 172.40.0.3/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 172.40.0.14/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 192.168.40.3/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 192.168.40.1/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf then accept
}
root@R3# run show configuration }
}
interfaces { protocols {
ge-0/0/0 { ospf {
unit 0 { export VRRP_OSPF;
family inet { area 0.0.0.0 {
address 192.168.40.3/24 { interface ge-0/0/1.0;
vrrp-group 1 { interface ge-0/0/0.0;
virtual-address 192.168.40.1; }
priority 101; }
preempt; }
} policy-options {
} policy-statement VRRP_OSPF {
} term accept_ospf {
} from {
} route-filter 172.40.0.3/32 exact;
ge-0/0/1 { route-filter 172.40.0.14/32 exact;
unit 0 { route-filter 192.168.40.3/32 exact;
family inet { route-filter 192.168.40.1/32 exact;
address 172.40.0.14/30; }
} then accept;
R4_CONFIG

set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.4/24 vrrp-group 1 virtual-address 192.168.40.1
set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.4/24 vrrp-group 1 priority 100
set interfaces ge-0/0/0 unit 0 family inet address 192.168.40.4/24 vrrp-group 1 preempt
set interfaces ge-0/0/1 unit 0 family inet address 172.40.0.18/30

set protocols ospf export VRRP_OSPF


set protocols ospf area 0.0.0.0 interface ge-0/0/1.0
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0

set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 172.40.0.4/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 172.40.0.18/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 192.168.40.4/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf from route-filter 192.168.40.1/32 exact
set policy-options policy-statement VRRP_OSPF term accept_ospf then accept
protocols {
ospf {
export VRRP_OSPF;
root@R4# run show configuration area 0.0.0.0 {
} interface ge-0/0/1.0;
} interface ge-0/0/0.0;
} }
interfaces { }
ge-0/0/0 { }
unit 0 { policy-options {
family inet { policy-statement VRRP_OSPF {
address 192.168.40.4/24 { term accept_ospf {
vrrp-group 1 { from {
virtual-address 192.168.40.1; route-filter 172.40.0.4/32 exact;
priority 100; route-filter 172.40.0.18/32 exact;
preempt; route-filter 192.168.40.4/32 exact;
} route-filter 192.168.40.1/32 exact;
} }
} then accept;
ge-0/0/1 { }
unit 0 { }
family inet {
address 172.40.0.18/30
Teste efectuado no equipamento R3
root@R3> show vrrp ?

Possible completions:
<[Enter]> Execute this command
brief Display brief output (default)
detail Display detailed output
extensive Display extensive output
interface Show VRRP interface
logical-system Name of logical system
nsr Display VRRP state of Master RE.
summary Display summary output
track Show VRRP track interfaces
| Pipe through a command

root@R3> show vrrp summary


Interface State Group VR state VR Mode Type
Address
ge-0/0/0.0 up 1 master Active lcl
192.168.40.3
vip 192.168.40.1
Teste efectuado ao roteador R4
root@R4> show vrrp summary
Interface State Group VR state VR Mode Type Address
ge-0/0/0.0 up 1 backup Active lcl 192.168.40.4
vip 192.168.40.1

Nota: Podemos notar que apartir do comando acima que o roteador R4 e o backup do protocolo vrrp visto que o
mesmo foi configurado com uma prioridade inferior ao do roteador R3. partir de R6 poderemos ver que trafego
passara pelo R3 para chegar a loopback1 do roteador R1
Teste a apartir do roteador R5

R5#ping 192.168.50.1

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.50.1, timeout is 2
seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max =
120/458/740 ms

R5#traceroute 192.168.50.1

Type escape sequence to abort.


Tracing the route to 192.168.50.1

1 192.168.40.3 148 msec 36 msec 8 msec


2 172.40.0.13 28 msec 28 msec 20 msec
3 172.40.0.9 40 msec 40 msec *
Teste a apartir do roteador R6

R6#ping 192.168.40.1

Type escape sequence to abort.


Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2
seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max =
8/22/56 ms

R6#traceroute 192.168.50.1

Type escape sequence to abort.


Tracing the route to 192.168.50.1

1 192.168.40.3 20 msec 24 msec 20 msec


2 172.40.0.13 24 msec 28 msec 20 msec
3 172.40.0.9 44 msec 28 msec *
Colocando a interface ge-0/0/0 do roteador R3 podemos ver partir do comando abaixo que o roteador
R4 passa a ser o master.

root@R4> show vrrp summary


Interface State Group VR state VR Mode Type Address
ge-0/0/0.0 up 1 master Active lcl 192.168.40.4
vip 192.168.40.1

Teste apartir de R5

R5#traceroute 192.168.50.1

Type escape sequence to abort.


Tracing the route to 192.168.50.1

1 192.168.40.4 684 msec 16 msec 20 msec


2 172.40.0.17 24 msec 24 msec 20 msec
3 172.40.0.9 180 msec 116 msec *
Active -ro u ter
VRRP_HUAWEI P rio rity 1 2 0

1 9 2 .1 6 8 .4 0 .5 / 2 4 1 9 2 .1 6 8 .4 0 .3 / 2 4
gig0/0/0 Ospf are a 0
gig0/0/4 gig0/0/1 gig0/0/0
gig0/0/1
R5
R5 Vlan 40 R3 14
1 7 2 .4 0 .0 .1 2 / 3 0
gig0/0/2 Lo 0 -1 7 2 .4 0 .0 .3 / 3 2
gig0/0/3 gig0/0/1 1 7 2 .4 0 .0 .8 / 3 0
13 9
10
Vlan 40 1 9 2 .1 6 8 .4 0 .0 / 2 4
17 gig0/0/0 R1
Vi rtu a l-ga te w a y- Gig0/0/2 R2 gig0/0/0 R1
1 9 2 .1 6 8 .4 0 .1 Lo 0 -1 7 2 .4 0 .0 .2 / 3 2
gig0/0/2 Lo 0 -1 7 2 .4 0 .0 .1 / 3 2
gig0/0/3 1 7 2 .4 0 .0 .1 6 / 3 0 Lo 1 -1 9 2 .1 6 8 .5 0 .1 / 2 4
gig0/0/0 18
gig0/0/1 gig0/0/0
gig0/0/4
R6 R4 gig0/0/2
R6 1 9 2 .1 6 8 .4 0 .4 / 2 4
1 9 2 .1 6 8 .4 0 .6 / 2 4
Vlan 40
Lo 0 -1 7 2 .4 0 .0 .4 / 3 2
Sta ndby-ro u ter
P rio rity 1 0 0
Dada a topologia acima configurar o vrrp de forma que roteador R3 torna-se o master e o roteador R4 backup,
configurar eth-trunk entre o sw_fcoc1 e sw_fcoc2 nas interfaces ge-0/0/2-3, usar a vlan 40 para a comunicação
entre R3-R4 e os roteadores R5-R6.Usar a prioridade de 120, os testes deveram ser efetuado de forma que os
roteadores R5-R6 conseguem chegar na interface loopback1 do roteador R1, apois o roteador R3 torna-se o
master o trafego devera fluir no sentido R3------->R2---------->R1.
R1_CONFIG

interface GigabitEthernet0/0/0
ip address 172.40.0.9 255.255.255.252
#
interface LoopBack0
ip address 172.40.0.1 255.255.255.255
#
interface LoopBack1
ip address 192.168.50.1 255.255.255.0

[R1]ospf 100 router-id 172.40.0.1


[R1-ospf-100-area-0.0.0.0]network 172.40.0.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 172.40.0.9 0.0.0.0
[R1-ospf-100-area-0.0.0.0]network 192.168.50.1 0.0.0.0
R2_CONFIG

[R2]interface GigabitEthernet 0/0/0


[R2-GigabitEthernet0/0/0]ip address 172.40.0.10 255.255.255.252

[R2]interface LoopBack 0
[R2-LoopBack0]ip address 172.40.0.2 255.255.255.255

[R2]interface GigabitEthernet 0/0/1


[R2-GigabitEthernet0/0/1]ip address 172.40.0.13 255.255.255.252

[R2]interface GigabitEthernet 0/0/2


[R2-GigabitEthernet0/0/2]ip address 172.40.0.17 255.255.255.252

R2]ospf 100 router-id 172.40.0.2


[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]network 172.40.0.2 0.0.0.0.
[R2-ospf-100-area-0.0.0.0]network 172.40.0.10 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 172.40.0.13 0.0.0.0
[R2-ospf-100-area-0.0.0.0]network 172.40.0.17 0.0.0.0
R3_CONFIG

[R3]interface GigabitEthernet 0/0/1


[R3-GigabitEthernet0/0/1]ip address 172.40.0.14 255.255.255.252

[R3]interface LoopBack 0
[R3-LoopBack0]ip address 172.40.0.3 255.255.255.255

[R3]interface GigabitEthernet 0/0/0


[R3-GigabitEthernet0/0/0]ip address 192.168.40.3 255.255.255.0
[R3-GigabitEthernet0/0/0]

[R3]ospf 100 router-id 172.40.0.3


[R3-ospf-100]area 0
[R3-ospf-100-area-0.0.0.0]network 172.40.0.3 0.0.0.0
[R3-ospf-100-area-0.0.0.0]network 172.40.0.13 0.0.0.0
[R3-ospf-100-area-0.0.0.0]network 192.168.40.3 0.0.0.0
R4_CONFIG

[R4]interface GigabitEthernet 0/0/1


[R4-GigabitEthernet0/0/1]ip address 172.40.0.18 255.255.255.252

[R4]interface GigabitEthernet 0/0/0


[R4-GigabitEthernet0/0/0]ip address 192.168.40.4 255.255.255.0
[R4-GigabitEthernet0/0/0]

[R4]interface LoopBack 0
[R4-LoopBack0]ip address 172.40.0.4 255.255.255.255
[R4-LoopBack0]

[R4]ospf 100 router-id 172.40.0.4


[R4-ospf-100]area 0
[R4-ospf-100-area-0.0.0.0]network 172.40.0.4 0.0.0.0
[R4-ospf-100-area-0.0.0.0]network 172.40.0.18 0.0.0.0
[R4-ospf-100-area-0.0.0.0]network 192.168.40.4 0.0.0.0
SW_FCOC1_CONFIG

[SW_FCOC1]vlan 40
[SW_FCOC1-vlan40]

[SW_FCOC1]interface Eth-Trunk 40
[SW_FCOC1-Eth-Trunk40]port link-type trunk
[SW_FCOC1-Eth-Trunk40]port trunk allow-pass vlan 40

[SW_FCOC1]interface GigabitEthernet 0/0/2


[SW_FCOC1-GigabitEthernet0/0/2]eth-trunk 40

[SW_FCOC1]interface GigabitEthernet 0/0/3


[SW_FCOC1-GigabitEthernet0/0/2]eth-trunk 40

[SW_FCOC1]interface GigabitEthernet 0/0/1


[SW_FCOC1-GigabitEthernet0/0/1]port link-type access
[[SW_FCOC1-GigabitEthernet0/0/1]port default vlan 40

[SW_FCOC1]interface GigabitEthernet 0/0/4


[SW_FCOC1-GigabitEthernet0/0/3]port link-type access
[SW_FCOC1-GigabitEthernet0/0/3]port default vlan 40
[SW_FCOC1-GigabitEthernet0/0/3]
SW_FCOC2_CONFIG

[SW_FCOC2]interface Eth-Trunk 40
[SW_FCOC2-Eth-Trunk40]port link-type trunk
[SW_FCOC2-Eth-Trunk40]port trunk allow-pass vlan 40

[SW_FCOC2]interface GigabitEthernet 0/0/2


[SW_FCOC2-GigabitEthernet0/0/2]eth-trunk 40

[SW_FCOC2]interface GigabitEthernet 0/0/3


[SW_FCOC2-GigabitEthernet0/0/3]eth-trunk 40

[SW_FCOC2]interface GigabitEthernet 0/0/1


[SW_FCOC2-GigabitEthernet0/0/1]port link-type access
[SW_FCOC2-GigabitEthernet0/0/1]port default vlan 40

[SW_FCOC2]interface GigabitEthernet 0/0/4


[SW_FCOC2-GigabitEthernet0/0/4]port link-type access
[SW_FCOC2-GigabitEthernet0/0/4]port default vlan 40
R5_CONFIG

interface GigabitEthernet0/0/0
ip address 192.168.40.5 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.40.1

##################################################

R6_CONFIG

[R6]interface GigabitEthernet 0/0/0


[R6-GigabitEthernet0/0/0]ip address 192.168.40.6 255.255.255.0
[R6-GigabitEthernet0/0/0]

[R6]ip route-static 0.0.0.0 0.0.0.0 192.168.40.1


Configuração de vrrp no roteador R3

[R3]interface GigabitEthernet 0/0/0


[R3-GigabitEthernet0/0/0]vrrp vrid 40 virtual-ip 192.168.40.1
[R3-GigabitEthernet0/0/0]vrrp vrid 40 priority 120
[R3-GigabitEthernet0/0/0]vrrp vrid 40 preempt-mode timer delay 20

##################################################

Configuração de vrrp no roteador R4

[R4]interface GigabitEthernet 0/0/0


[R4-GigabitEthernet0/0/0]vrrp vrid 40 virtual-ip 192.168.40.1
[R4-GigabitEthernet0/0/0]
Teste efectuado a R3--------------R6 <R3>display vrrp ?
INTEGER<1-255> Virtual router identifier
admin-vrrp Specify configuration information of the
<R3>display vrrp administrator
GigabitEthernet0/0/0 | Virtual Router 40 VRRP
State : Master binding Specify binding type of VRRP
Virtual IP : 192.168.40.1 brief Summary information
Master IP : 192.168.40.3 error The error VRRP packet
PriorityRun : 120 interface Specify the interface
PriorityConfig : 120 protocol-information Protocol information of VRRP
MasterPriority : 120 statistics Statistics about VRRP packets
Preempt : YES Delay Time : 20 s | Matching output
TimerRun : 1 s <cr>
TimerConfig : 1 s
Auth type : NONE <R3>display vrrp brief
Virtual MAC : 0000-5e00-0128 VRID State Interface Type Virtual IP
Check TTL : YES ----------------------------------------------------------------
Config type : normal-vrrp 40 Master GE0/0/0 Normal 192.168.40.1
Create time : 2019-03-02 22:42:55 UTC-08:00 ----------------------------------------------------------------
Last change time : 2019-03-02 22:42:59 UTC- Total:1 Master:1 Backup:0 Non-active:0
08:00
<R5>ping 192.168.50.1
Reply from 192.168.50.1: bytes=56 Sequence=1 ttl=253 time=150 ms
Reply from 192.168.50.1: bytes=56 Sequence=2 ttl=253 time=80 ms

--- 192.168.50.1 ping statistics ---


5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 80/106/150 ms
############################################################
<R5>tracert 192.168.50.1

traceroute to 192.168.50.1(192.168.50.1), max hops: 30 ,packet length: 40,press


CTRL_C to break

1 192.168.40.3 60 ms 60 ms 80 ms

2 172.40.0.13 80 ms 60 ms 70 ms

3 172.40.0.9 90 ms 110 ms 90 ms
Teste efectuado apartir do roteador R4-R6

<R4>display vrrp
GigabitEthernet0/0/0 | Virtual Router 40
State : Backup
Virtual IP : 192.168.40.1
Master IP : 192.168.40.3
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0128
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-03-02 22:48:53 UTC-08:00
Last change time : 2019-03-02 22:48:53 UTC-08:00

<R4>display vrrp brief


VRID State Interface Type Virtual IP
----------------------------------------------------------------
40 Backup GE0/0/0 Normal 192.168.40.1
----------------------------------------------------------------
Total:1 Master:0 Backup:1 Non-active:0
Colocando o Interface gige-0/0/0 do roteador R3 por sinal o roteador master, o router R4 activara o seu gateway e
tornara-se o master e todo trafego passara no sentido R4------>R2---------->R1

[R3]interface GigabitEthernet 0/0/0


[R3-GigabitEthernet0/0/0]shutdown

Checando o estado do vrrp no roteador R3 apois colocara interface gig0/0/0 em baixo


<R3>display vrrp
GigabitEthernet0/0/0 | Virtual Router 40
State : Initialize
Virtual IP : 192.168.40.1
Master IP : 0.0.0.0
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0128
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-03-02 22:42:55 UTC-08:00
Last change time : 2019-03-03 09:40:35 UTC-08:00
Com a interface gig0/0/0 do roteador R3 em baixo. o roteador R4 estará elegível a ser o vrrp master e o trafego
fluirá no sentido desejado R4----------->R2--------->R1

<R4>display vrrp
GigabitEthernet0/0/0 | Virtual Router 40
State : Master
Virtual IP : 192.168.40.1
Master IP : 192.168.40.4
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 100
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0128
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-03-02 22:48:53 UTC-08:00
Last change time : 2019-03-03 09:40:38 UTC-08:00
Testes efectuados em R5 e R6 apois R4 tornar-se o Master

R5_TEST

<R5>ping 192.168.50.1

PING 192.168.50.1: 56 data bytes, press CTRL_C to break


Reply from 192.168.50.1: bytes=56 Sequence=1 ttl=253 time=110 ms
Reply from 192.168.50.1: bytes=56 Sequence=2 ttl=253 time=140 ms
--- 192.168.50.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 100/124/140 ms

<R5>tracert 192.168.50.1

traceroute to 192.168.50.1(192.168.50.1), max hops: 30 ,packet length: 40,press


CTRL_C to break

1 192.168.40.4 60 ms 90 ms 80 ms

2 172.40.0.17 80 ms 110 ms 110 ms

3 172.40.0.9 120 ms 140 ms 100 ms

Você também pode gostar