Cấu Hình Dự Phòng Với HSRP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 28

Mô hình:

1. Cấu hình dự phòng với HSRP:


- Có mô ̣t vài vấn đề xảy ra trong quá trình cấu hìnhL
o Khi mà cồng f0/0 bị down, router active không tự đô ̣ng chuyển trạng thái, nó vẫn
giữ trạng thái active – nhưng user vẫn sẽ đi tới đích được do giao thức định tuyến
rip
o Khi cổng f1/0 bị down lâ ̣p tức sẽ học được chuyển sang trạng thái từ Active
Init, còn Router Standby  chuyển sang trạng thái Active.
o Khi cổng trên router kia chạy bình thường thì router stand lâ ̣p tức từ Stanby
Speak Standby cái kia chuyển lại về Active
o Nếu thêm câu lê ̣nh sau:
o Router (config)interface f1/0
o Router (config-if)standby 1 track f0/0 <-- theo doi cong f0/0 nếu nó bị down hình
như sẽ chuyển trạng thái

Router Hanoi1:

Hanoi1#show running-config

Building configuration...

Current configuration : 904 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

hostname Hanoi1

boot-start-marker

boot-end-marker

no aaa new-model

resource policy

memory-size iomem 5

ip subnet-zero
!

ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface FastEthernet0/0

ip address 172.16.10.2 255.255.255.0

duplex auto

speed auto

interface FastEthernet1/0

ip address 192.168.10.2 255.255.255.0

duplex auto

speed auto

standby 1 ip 192.168.10.100

standby 1 priority 110

standby 1 preempt

!
router rip

version 2

network 172.16.0.0

network 192.168.10.0

no auto-summary

ip http server

no ip http secure-server

ip classless

control-plane

line con 0

line aux 0

line vty 0 4

end

Hanoi1#

Hanoi1#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

C 192.168.10.0/24 is directly connected, FastEthernet1/0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

10.0.0.0/24 is subnetted, 1 subnets

R 10.1.1.0 [120/1] via 172.16.10.100, 00:00:23, FastEthernet0/0

Hanoi1#

Hanoi1#show ip interface brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.10.2 YES manual up up

FastEthernet1/0 192.168.10.2 YES manual up up

Hanoi1#

Hanoi1#show standby

FastEthernet1/0 - Group 1

State is Active

4 state changes, last state change 00:02:40

Virtual IP address is 192.168.10.100

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 1.848 secs


Preemption enabled

Active router is local

Standby router is 192.168.10.1, priority 105 (expires in 9.876 sec)

Priority 110 (configured 110)

IP redundancy name is "hsrp-Fa1/0-1" (default)

Hanoi1#

Hanoi2#show running-config

Building configuration...

Current configuration : 904 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

hostname Hanoi2

boot-start-marker

boot-end-marker

no aaa new-model

resource policy
!

memory-size iomem 5

ip subnet-zero

ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface FastEthernet0/0

ip address 172.16.10.1 255.255.255.0

duplex auto

speed auto

interface FastEthernet1/0

ip address 192.168.10.1 255.255.255.0

duplex auto

speed auto

standby 1 ip 192.168.10.100
standby 1 priority 105

standby 1 preempt

router rip

version 2

network 172.16.0.0

network 192.168.10.0

no auto-summary

ip http server

no ip http secure-server

ip classless

control-plane

line con 0

line aux 0

line vty 0 4

end

Hanoi2#

Hanoi2#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

C 192.168.10.0/24 is directly connected, FastEthernet1/0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

10.0.0.0/24 is subnetted, 1 subnets

R 10.1.1.0 [120/1] via 172.16.10.100, 00:00:15, FastEthernet0/0

Hanoi2#

Hanoi2#show ip interface brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 172.16.10.1 YES manual up up

FastEthernet1/0 192.168.10.1 YES manual up up

Hanoi2#

Hanoi2#show standby

FastEthernet1/0 - Group 1

State is Standby

4 state changes, last state change 00:06:15

Virtual IP address is 192.168.10.100


Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.160 secs

Preemption enabled

Active router is 192.168.10.2, priority 110 (expires in 8.144 sec)

Standby router is local

Priority 105 (configured 105)

IP redundancy name is "hsrp-Fa1/0-1" (default)

Hanoi2#

destination#show running-config

Building configuration...

Current configuration : 878 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

hostname destination

boot-start-marker

boot-end-marker

!
!

no aaa new-model

resource policy

memory-size iomem 5

ip subnet-zero

ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface Loopback0

ip address 10.1.1.1 255.255.255.0

interface FastEthernet0/0

ip address 172.16.10.100 255.255.255.0

duplex auto
speed auto

interface FastEthernet1/0

no ip address

shutdown

duplex auto

speed auto

router rip

version 2

network 10.0.0.0

network 172.16.0.0

no auto-summary

ip http server

no ip http secure-server

ip classless

control-plane

line con 0

line aux 0

line vty 0 4

end
destination#

destination#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

R 192.168.10.0/24 [120/1] via 172.16.10.2, 00:00:14, FastEthernet0/0

[120/1] via 172.16.10.1, 00:00:05, FastEthernet0/0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Loopback0

destination#

2. Cấu hình Load balancing với HSRP:

destination#
*Mar 1 01:45:08.567: %SYS-5-CONFIG_I: Configured from console by consoleshow ru
n

Building configuration...

Current configuration : 873 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

hostname destination

boot-start-marker

boot-end-marker

no aaa new-model

resource policy

memory-size iomem 5

ip subnet-zero

!
ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface Loopback0

ip address 10.1.1.1 255.255.255.0

interface FastEthernet0/0

ip address 172.16.10.100 255.255.255.0

duplex auto

speed auto

interface FastEthernet1/0

no ip address

shutdown

duplex auto

speed auto

ip http server
no ip http secure-server

ip classless

ip route 0.0.0.0 0.0.0.0 172.16.10.1

ip route 0.0.0.0 0.0.0.0 172.16.10.2

control-plane

line con 0

line aux 0

line vty 0 4

end

destination#

destination#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 172.16.10.2 to network 0.0.0.0


172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Loopback0

S* 0.0.0.0/0 [1/0] via 172.16.10.2

[1/0] via 172.16.10.1

destination#

Hanoi1#show run

*Mar 1 01:47:23.943: %SYS-5-CONFIG_I: Configured from console by console

Building configuration...

Current configuration : 925 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

hostname Hanoi1

boot-start-marker

boot-end-marker

no aaa new-model
!

resource policy

memory-size iomem 5

ip subnet-zero

ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface FastEthernet0/0

ip address 172.16.10.2 255.255.255.0

duplex auto

speed auto

interface FastEthernet1/0

ip address 192.168.10.2 255.255.255.0

duplex auto
speed auto

standby track FastEthernet0/0

standby 1 ip 192.168.10.100

standby 1 priority 200

standby 1 preempt

standby 2 ip 192.168.10.99

standby 2 priority 105

standby 2 preempt

ip http server

no ip http secure-server

ip classless

control-plane

line con 0

line aux 0

line vty 0 4

end

Hanoi1# 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

C 192.168.10.0/24 is directly connected, FastEthernet1/0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

Hanoi1#show standby

FastEthernet1/0 - Group 1

State is Active

8 state changes, last state change 00:32:49

Virtual IP address is 192.168.10.100

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 1.516 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.1, priority 105 (expires in 9.764 sec)

Priority 200 (configured 200)

IP redundancy name is "hsrp-Fa1/0-1" (default)


FastEthernet1/0 - Group 2

State is Standby

1 state change, last state change 00:23:05

Virtual IP address is 192.168.10.99

Active virtual MAC address is 0000.0c07.ac02

Local virtual MAC address is 0000.0c07.ac02 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.248 secs

Preemption enabled

Active router is 192.168.10.1, priority 110 (expires in 7.908 sec)

Standby router is local

Priority 105 (configured 105)

IP redundancy name is "hsrp-Fa1/0-2" (default)

Hanoi1#

Hanoi2#show ru

*Mar 1 01:47:47.619: %SYS-5-CONFIG_I: Configured from console by consolen

Building configuration...

Current configuration : 892 bytes

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!
hostname Hanoi2

boot-start-marker

boot-end-marker

no aaa new-model

resource policy

memory-size iomem 5

ip subnet-zero

ip cef

no ip dhcp use vrf connected

no ip ips deny-action ips-interface

no ftp-server write-enable

no crypto isakmp ccm

interface FastEthernet0/0

ip address 172.16.10.1 255.255.255.0

duplex auto
speed auto

interface FastEthernet1/0

ip address 192.168.10.1 255.255.255.0

duplex auto

speed auto

standby 1 ip 192.168.10.100

standby 1 priority 105

standby 1 preempt

standby 2 ip 192.168.10.99

standby 2 priority 110

standby 2 preempt

ip http server

no ip http secure-server

ip classless

control-plane

line con 0

line aux 0

line vty 0 4

end
Hanoi2#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

C 192.168.10.0/24 is directly connected, FastEthernet1/0

172.16.0.0/24 is subnetted, 1 subnets

C 172.16.10.0 is directly connected, FastEthernet0/0

Hanoi2#show standby

FastEthernet1/0 - Group 1

State is Standby

10 state changes, last state change 00:33:12

Virtual IP address is 192.168.10.100

Active virtual MAC address is 0000.0c07.ac01

Local virtual MAC address is 0000.0c07.ac01 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.296 secs

Preemption enabled

Active router is 192.168.10.2, priority 200 (expires in 9.060 sec)


Standby router is local

Priority 105 (configured 105)

IP redundancy name is "hsrp-Fa1/0-1" (default)

FastEthernet1/0 - Group 2

State is Active

2 state changes, last state change 00:24:53

Virtual IP address is 192.168.10.99

Active virtual MAC address is 0000.0c07.ac02

Local virtual MAC address is 0000.0c07.ac02 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 1.452 secs

Preemption enabled

Active router is local

Standby router is 192.168.10.2, priority 105 (expires in 9.392 sec)

Priority 110 (configured 110)

IP redundancy name is "hsrp-Fa1/0-2" (default)

Hanoi2#

Trên PC1:

C:\Documents and Settings\Administrator>ipconfig

Windows IP Configuration
Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 192.168.10.101

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.10.100

C:\Documents and Settings\Administrator>ping 172.16.10.100

Pinging 172.16.10.100 with 32 bytes of data:

Reply from 172.16.10.100: bytes=32 time=35ms TTL=254

Reply from 172.16.10.100: bytes=32 time=68ms TTL=254

Reply from 172.16.10.100: bytes=32 time=16ms TTL=254

Reply from 172.16.10.100: bytes=32 time=16ms TTL=254

Ping statistics for 172.16.10.100:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 16ms, Maximum = 68ms, Average = 33ms

C:\Documents and Settings\Administrator>tracert 172.16.10.100

Tracing route to 172.16.10.100 over a maximum of 30 hops


1 24 ms 15 ms 3 ms 192.168.10.2

2 50 ms 39 ms 6 ms 172.16.10.100

Trace complete.

C:\Documents and Settings\Administrator>

Trên PC2:

C:\Documents and Settings\Administrator>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :

IP Address. . . . . . . . . . . . : 192.168.10.102

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . : 192.168.10.99

C:\Documents and Settings\Administrator>ping 172.16.10.100

Pinging 172.16.10.100 with 32 bytes of data:


Reply from 172.16.10.100: bytes=32 time=9ms TTL=254

Reply from 172.16.10.100: bytes=32 time=23ms TTL=254

Reply from 172.16.10.100: bytes=32 time=22ms TTL=254

Reply from 172.16.10.100: bytes=32 time=36ms TTL=254

Ping statistics for 172.16.10.100:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 9ms, Maximum = 36ms, Average = 22ms

C:\Documents and Settings\Administrator>tracert 172.16.10.100

Tracing route to 172.16.10.100 over a maximum of 30 hops

1 6 ms 3 ms 3 ms 192.168.10.1

2 47 ms 6 ms 6 ms 172.16.10.100

Trace complete.

C:\Documents and Settings\Administrator>

You might also like