0 Members and 1 Guest are viewing this topic.

AuthorTopic: HSRP (Hot Standby Router Protocol) วิธีเซ็ตสวิตช์ Layer3 2 ตัว ให้ Standby รอเมื่ออีกตัว Down  (Read 9828 times)

Offline aegkaluk

  • Administrator
  • Hero Member
  • *****
  • Posts: 1096
  • Total Like : 0
    • Email
« on: 06, 12, 2010, 12:37:01 »
HSRP (Hot Standby Router Protocol) วิธีเซ็ตสวิตช์ Layer3 2 ตัว ให้ Standby รอเมื่ออีกตัว Down
พอดีลองทดสอบดู work ก็เลยเก็บมาฝาก ข้อดีของ HSRP คือ กรณีองค์กรมี หลายเน็ตเวิกส์ แน่นอนต้องมี Switch Layer 3 ทำหน้าที่เป็น Router ให้แต่ละเน็ตเวิกส์สามารถติดต่อกันได้ หากองค์กรมี Switch Layer 3 สัก 2 ตัว ก็สามารถ Config ให้ อีกตัว Standby ไว้ หากตัวหลัก Down ลง ตัว Standby จะ Active ขึ้นทำหน้าที่ Route ต่อทันที ช่วยให้เน็ตเวิกส์ล่มยากขึ้น ด้านล่างเป็นตัวอย่างการ config


SW1

...,
!
interface Vlan1
 ip address 192.168.1.229 255.255.255.0
!
interface Vlan2
 ip address 192.168.2.10 255.255.255.0
 standby version 2
 standby 2 ip 192.168.2.1
!
interface Vlan100
 ip address 192.168.100.10 255.255.255.0
 standby version 2
 standby 100 ip 192.168.100.1
!
------------
C3750E-28P-1#show standby
Vlan2 - Group 2 (version 2)
  State is Standby
    4 state changes, last state change 01:41:48
  Virtual IP address is 192.168.2.1
  Active virtual MAC address is 0000.0c9f.f002
    Local virtual MAC address is 0000.0c9f.f002 (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.032 secs
  Preemption disabled
  Active router is 192.168.2.11, priority 100 (expires in 10.240 sec)
    MAC address is 6c50.4d02.9bc1
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Vl2-2" (default)
Vlan100 - Group 100 (version 2)
  State is Standby
    1 state change, last state change 01:41:28
  Virtual IP address is 192.168.100.1
  Active virtual MAC address is 0000.0c9f.f064
    Local virtual MAC address is 0000.0c9f.f064 (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.544 secs
  Preemption disabled
  Active router is 192.168.100.11, priority 100 (expires in 8.976 sec)
    MAC address is 6c50.4d02.9bc2
  Standby router is local
  Priority 100 (default 100)
  Group name is "hsrp-Vl100-100" (default)
------------

C3750E-28P-1#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.1.0/24 is directly connected, Vlan1
C    192.168.2.0/24 is directly connected, Vlan2
C    192.168.100.0/24 is directly connected, Vlan100
C3750E-28P-1# 



SW2

......,
!
interface Vlan1
 ip address 192.168.1.230 255.255.255.0
!
interface Vlan2
 ip address 192.168.2.11 255.255.255.0
 standby version 2
 standby 2 ip 192.168.2.1
!
interface Vlan100
 ip address 192.168.100.11 255.255.255.0
 standby version 2
 standby 100 ip 192.168.100.1
!
------------

C3750E-28P-2#show standby
Vlan2 - Group 2 (version 2)
  State is Active
    2 state changes, last state change 01:49:09
  Virtual IP address is 192.168.2.1
  Active virtual MAC address is 0000.0c9f.f002
    Local virtual MAC address is 0000.0c9f.f002 (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.864 secs
  Preemption disabled
  Active router is local
  Standby router is 192.168.2.10, priority 100 (expires in 11.504 sec)
  Priority 100 (default 100)
  Group name is "hsrp-Vl2-2" (default)
Vlan100 - Group 100 (version 2)
  State is Active
    2 state changes, last state change 01:47:42
  Virtual IP address is 192.168.100.1
  Active virtual MAC address is 0000.0c9f.f064
    Local virtual MAC address is 0000.0c9f.f064 (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 2.384 secs
  Preemption disabled
  Active router is local
  Standby router is 192.168.100.10, priority 100 (expires in 10.480 sec)
  Priority 100 (default 100)
  Group name is "hsrp-Vl100-100" (default)
------------

C3750E-28P-2#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.1.0/24 is directly connected, Vlan1
C    192.168.2.0/24 is directly connected, Vlan2
C    192.168.100.0/24 is directly connected, Vlan100
C3750E-28P-2#