• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

LAB GLBP – Bài 1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LAB GLBP – Bài 1


    1. Yêu cầu:
    Cấu hình cơ bản trên các thiết bị.
    PAT: Cấu hình PAT trên R1 và R2 đảm bảo các thiết bị nội bộ truy cập được Internet.
    GLBP:
    + Cấu hình GLBP trên cổng e0/0 trên R1 và R2.
    + Hiệu chỉnh GLBP sao cho R1 làm Active AVG, R2 làm Standby AVG, R1 & R2 đóng vai trò AVF.

    2. Thực hiện:

    Yêu cầu 1: Cấu hình cơ bản trên các thiết bị.

    Cấu hình cơ bản trên R1.

    hostname R1

    interface e0/0

    ip address 10.0.1.1 255.255.255.0

    no shutdown

    exit

    interface e0/1

    ip address dhcp

    no shutdown

    exit

    ip route 0.0.0.0 0.0.0.0 dhcp

    line vty 0 4

    privilege level 15

    no login

    exit

    line console 0

    logging synchronous

    exec-timeout 0 0

    exit

    no ip domain-lookup

    no cdp run



    Cấu hình cơ bản trên R2.

    hostname R2

    interface e0/0

    ip address 10.0.1.2 255.255.255.0

    no shutdown

    exit

    interface e0/1

    ip address dhcp

    no shutdown

    exit

    ip route 0.0.0.0 0.0.0.0 dhcp

    line vty 0 4

    privilege level 15

    no login

    exit

    line console 0

    logging synchronous

    exec-timeout 0 0

    exit

    no ip domain-lookup

    no cdp run



    Gán IP trên PC1 nếu sử dụng VPCS để giả lập PC trên Unetlab.

    VPCS> ip 10.0.1.3/24 10.0.1.254

    Gán IP trên PC2 nếu sử dụng VPCS để giả lập PC trên Unetlab.

    VPCS> ip 10.0.1.4/24 10.0.1.254

    Gán IP trên PC3 nếu sử dụng VPCS để giả lập PC trên Unetlab.

    VPCS> ip 10.0.1.5/24 10.0.1.254

    Gán IP trên PC4 nếu sử dụng VPCS để giả lập PC trên Unetlab.

    VPCS> ip 10.0.1.6/24 10.0.1.254



    Yêu cầu 2: Cấu hình PAT trên R1 và R2 đảm bảo các thiết bị nội bộ truy cập được Internet.

    ip nat inside source list 1 interface e0/1 overload

    interface e0/1

    ip nat outside

    exit

    interface e0/0

    ip nat inside

    exit

    access-list 1 permit 10.0.1.0 0.0.0.255



    Yêu cầu 3.a: Cấu hình GLBP trên cổng e0/0 trên R1 và R2.

    Cấu hình GLBP trên cổng e0/0 trên R1.

    interface e0/0

    glbp 1 ip 10.0.1.254

    exit

    Cấu hình GLBP trên cổng e0/0 trên R2.

    interface e0/0

    glbp 1 ip 10.0.1.254

    exit

    Lúc này, các PC có thể ping tới địa chỉ VIP (Virtual IP) 10.0.1.254 và ping đi được Internet.

    VPCS> ping 10.0.1.254

    VPCS> ping 8.8.8.8

    VPC1 đã có thể ping được địa chỉ IP ở ngoài Internet là 8.8.8.8 nhưng vấn đề là gói tin sẽ đi qua hướng R1 hay R2. Thông thường mọi gói tin gửi đi Internet sẽ có thông tin địa chỉ Destination MAC là địa chỉ MAC của default gateway 10.0.1.254 trong tình huống này.

    Vậy địa chỉ MAC của defautl gateway 10.0.1.254 sẽ là địa chỉ nào? Theo cơ chế hoạt động của GLBP, trong số các Router bật GLBP sẽ có một Router đóng vai trò AVG (Active Virtual Gateway), AVG sẽ chịu trách nhiệm phát sinh các địa chỉ Virtual MAC rồi phân phối lại cho từng GLBP Router thành viên. Để kiểm tra xem địa chỉ Virtual MAC mà GLBP Router đang sở hữu là gì, ta có thể thực hiện câu lệnh sau.

    Kiểm tra thông tin địa chỉ Virtual MAC của R1.
    • MAC 0007.b400.0101 là địa chỉ Virtual MAC của R1.
    • MAC aabb.cc00.0100 là địa chỉ MAC cổng e0/0 của R1.


    R1# show glbp

    Ethernet0/0 – Group 1

    State is Active

    1 state change, last state change 00:12:22

    Virtual IP address is 10.0.1.254

    Hello time 3 sec, hold time 10 sec

    Next hello sent in 0.448 secs

    Redirect time 600 sec, forwarder timeout 14400 sec

    Preemption disabled

    Active is local

    Standby is 10.0.1.2, priority 100 (expires in 8.256 sec)

    Priority 100 (default)

    Weighting 100 (default 100), thresholds: lower 1, upper 100

    Load balancing: round-robin

    Group members:

    aabb.cc00.0100 (10.0.1.1) local

    aabb.cc00.0200 (10.0.1.2)

    There are 2 forwarders (1 active)

    Forwarder 1

    State is Active

    1 state change, last state change 00:11:40

    MAC address is 0007.b400.0101 (default)

    Owner ID is aabb.cc00.0100

    Redirection enabled

    Preemption enabled, min delay 30 sec

    Active is local, weighting 100

    Client selection count: 1

    Forwarder 2

    State is Listen

    MAC address is 0007.b400.0102 (learnt)

    Owner ID is aabb.cc00.0200

    Redirection enabled, 598.272 sec remaining (maximum 600 sec)

    Time to live: 14398.272 sec (maximum 14400 sec)

    Preemption enabled, min delay 30 sec

    Active is 10.0.1.2 (primary), weighting 100 (expires in 8.704 sec)

    Client selection count: 1

    R1#

    Kiểm tra thông tin địa chỉ Virtual MAC của R2.
    • MAC 0007.b400.0102 là địa chỉ Virtual MAC của R2.
    • MAC aabb.cc00.0200 là địa chỉ MAC cổng e0/0 của R2.


    R2# show glbp

    Ethernet0/0 – Group 1

    State is Standby

    1 state change, last state change 00:14:38

    Virtual IP address is 10.0.1.254

    Hello time 3 sec, hold time 10 sec

    Next hello sent in 0.608 secs

    Redirect time 600 sec, forwarder timeout 14400 sec

    Preemption disabled

    Active is 10.0.1.1, priority 100 (expires in 9.536 sec)

    Standby is local

    Priority 100 (default)

    Weighting 100 (default 100), thresholds: lower 1, upper 100

    Load balancing: round-robin

    Group members:

    aabb.cc00.0100 (10.0.1.1)

    aabb.cc00.0200 (10.0.1.2) local

    There are 2 forwarders (1 active)

    Forwarder 1

    State is Listen

    2 state changes, last state change 00:14:16

    MAC address is 0007.b400.0101 (learnt)

    Owner ID is aabb.cc00.0100

    Time to live: 14399.328 sec (maximum 14400 sec)

    Preemption enabled, min delay 30 sec

    Active is 10.0.1.1 (primary), weighting 100 (expires in 10.112 sec)

    Forwarder 2

    State is Active

    1 state change, last state change 00:14:41

    MAC address is 0007.b400.0102 (default)

    Owner ID is aabb.cc00.0200

    Preemption enabled, min delay 30 sec

    Active is local, weighting 100

    R2#

    Tại VPC1 ta kiểm tra bảng cache arp thì sẽ biết được lưu lượng từ VPC1 gửi đi Internet sẽ đi theo hướng nào.

    VPCS> show arp

    00:07:b4:00:01:01 10.0.1.254 expires in 113 seconds

    VPCS>

    Ta có thể thấy, địa chỉ MAC tương ứng với VIP 10.0.1.254 trong tình huống này là 00:07:b4:00:01:01 và đây chính là địa chỉ Virtual MAC của R1. Vậy ta có thể khẳng định là lưu lượng của VPC1 gửi đi Internet sẽ di chuyển theo hướng R1.

    Để khảo sát cơ chế cân bằng tải của GLBP, tại VPC2, ta tiếp tục ping tới 8.8.8.8 rồi kiểm tra bảng cache arp.

    VPCS> ping 8.8.8.8

    VPCS> show arp

    00:07:b4:00:01:02 10.0.1.254 expires in 95 seconds

    aa:bb:cc:00:02:00 10.0.1.2 expires in 95 seconds

    VPCS>

    Lúc này, địa chỉ MAC tương ứng với Virtual IP 10.0.1.254 là 00:07:b4:00:01:02 tương ứng với Virtual MAC của R2. Vậy lưu lượng của VPC2 gửi đi Internet sẽ di chuyển qua hướng R2.

    Yêu cầu 3.b: Hiệu chỉnh GLBP sao cho R1 làm Active AVG, R2 làm Standby AVG, R1 & R2 đóng vai trò AVF.

    AVG giữ vai trò quan trọng trong giao thức GLBP, nó phát sinh các địa chỉ Virtual MAC rồi phân phối cho các Router thành viên AVF (Active Virtual Forwarder). AVG cũng đứng ra để hồi đáp các bản tin ARP Request do các PC gửi đến hỏi thăm về địa chỉ Virtual MAC tương ứng với Virtual IP là gì.

    Cơ chế bầu chọn Active AVG trong GLBP tương tự như HSRP, Router nào có Priority càng lớn, Router đó làm Active AVG, còn lại làm Standby AVG. Nếu giá trị Priority bằng nhau thì các Router dựa vào địa chỉ IP để bầu chọn Active AVG, IP của Router nào lớn nhất thì Router đó sẽ đóng vai trò là Active AVG.

    Kiểm tra giá trị Priority mặc định trên các Router.

    R1# show glbp

    Ethernet0/0 – Group 1

    State is Active

    1 state change, last state change 00:12:22

    Virtual IP address is 10.0.1.254

    Hello time 3 sec, hold time 10 sec

    Next hello sent in 0.448 secs

    Redirect time 600 sec, forwarder timeout 14400 sec

    Preemption disabled

    Active is local

    Standby is 10.0.1.2, priority 100 (expires in 8.256 sec)

    Priority 100 (default)

    Weighting 100 (default 100), thresholds: lower 1, upper 100

    Load balancing: round-robin

    Group members:

    aabb.cc00.0100 (10.0.1.1) local

    aabb.cc00.0200 (10.0.1.2)

    There are 2 forwarders (1 active)

    Forwarder 1

    State is Active

    1 state change, last state change 00:11:40

    MAC address is 0007.b400.0101 (default)

    Owner ID is aabb.cc00.0100

    Redirection enabled

    Preemption enabled, min delay 30 sec

    Active is local, weighting 100

    Client selection count: 1

    Forwarder 2

    State is Listen

    MAC address is 0007.b400.0102 (learnt)

    Owner ID is aabb.cc00.0200

    Redirection enabled, 598.272 sec remaining (maximum 600 sec)

    Time to live: 14398.272 sec (maximum 14400 sec)

    Preemption enabled, min delay 30 sec

    Active is 10.0.1.2 (primary), weighting 100 (expires in 8.704 sec)

    Client selection count: 1

    R1#

    R2# show glbp

    Ethernet0/0 – Group 1

    State is Standby

    1 state change, last state change 00:29:08

    Virtual IP address is 10.0.1.254

    Hello time 3 sec, hold time 10 sec

    Next hello sent in 0.064 secs

    Redirect time 600 sec, forwarder timeout 14400 sec

    Preemption disabled

    Active is 10.0.1.1, priority 100 (expires in 11.296 sec)

    Standby is local

    Priority 100 (default)

    Weighting 100 (default 100), thresholds: lower 1, upper 100

    Load balancing: round-robin

    Group members:

    aabb.cc00.0100 (10.0.1.1)

    aabb.cc00.0200 (10.0.1.2) local

    There are 2 forwarders (1 active)

    Forwarder 1

    State is Listen

    2 state changes, last state change 00:28:45

    MAC address is 0007.b400.0101 (learnt)

    Owner ID is aabb.cc00.0100

    Time to live: 14399.424 sec (maximum 14400 sec)

    Preemption enabled, min delay 30 sec

    Active is 10.0.1.1 (primary), weighting 100 (expires in 9.952 sec)

    Forwarder 2

    State is Active

    1 state change, last state change 00:29:11

    MAC address is 0007.b400.0102 (default)

    Owner ID is aabb.cc00.0200

    Preemption enabled, min delay 30 sec

    Active is local, weighting 100

    R2#

    Ta thấy giá trị Priority mặc định trên các Router đều bằng 100. Nếu giá trị Priority bằng nhau thì các Router sẽ dựa vào địa chỉ IP trên cổng vật lý để xét vai trò Active AVG với nguyên tắc IP càng lớn thì sẽ trở thành Active AVG. Thực hiện các câu lệnh sau để kiểm tra địa chỉ IP cổng e0/0 các Router.

    R1# show ip interface brief

    Interface IP-Address OK? Method Status Protocol

    Ethernet0/0 10.0.1.1 YES TFTP up up

    Ethernet0/1 10.215.26.235 YES DHCP up up

    Ethernet0/2 unassigned YES TFTP administratively down down

    Ethernet0/3 unassigned YES TFTP administratively down down

    NVI0 10.0.1.1 YES unset up up

    R1#

    R2# show ip interface brief

    Interface IP-Address OK? Method Status Protocol

    Ethernet0/0 10.0.1.2 YES TFTP up up

    Ethernet0/1 10.215.26.234 YES DHCP up up

    Ethernet0/2 unassigned YES TFTP administratively down down

    Ethernet0/3 unassigned YES TFTP administratively down down

    NVI0 10.0.1.2 YES unset up up

    R2#

    Mặc dù IP của R1 nhỏ hơn IP của R2 nhưng R1 vẫn đóng vai trò là Active AVG vì GLBP sử dụng cơ chế không chiếm quyền Non Pre-empt, tức là R1 cấu hình GLBP trên cổng e0/0 trước nên nó sẽ tuyên bố nó là Active AVG, R2 cấu hình GLBP trên cổng e0/0 sau nên sẽ trở thành Standby GLBP.

    R1# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 100 Active 10.0.1.254 local 10.0.1.2

    Et0/0 1 1 – Active 0007.b400.0101 local –

    Et0/0 1 2 – Listen 0007.b400.0102 10.0.1.2 –

    R1#



    R2# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 100 Standby 10.0.1.254 10.0.1.1 local

    Et0/0 1 1 – Listen 0007.b400.0101 10.0.1.1 –

    Et0/0 1 2 – Active 0007.b400.0102 local –

    R2#

    Để hiệu chỉnh R1 làm Active AVG, R2 làm Standby AVG, ta sẽ tiến hành hiệu chỉnh Priority của R1 là 120 còn R2 để mặc định là 100.

    R1(config)# interface e0/0

    R1(config-if)# glbp 1 priority 120

    R1(config-if)# glbp 1 preempt



    R2(config)# interface e0/0

    R2(config-if)# glbp 1 priority 100

    R2(config-if)# glbp 1 preempt

    Để xác nhận R1 đã trở thành Active AVG, R2 làm Standby AVG ta thực hiện câu lệnh sau.

    R1# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 120 Active 10.0.1.254 local 10.0.1.2

    Et0/0 1 1 – Active 0007.b400.0101 local –

    Et0/0 1 2 – Listen 0007.b400.0102 10.0.1.2 –

    R1#

    R2# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 100 Standby 10.0.1.254 10.0.1.1 local

    Et0/0 1 1 – Listen 0007.b400.0101 10.0.1.1 –

    Et0/0 1 2 – Active 0007.b400.0102 local –

    R2#

    Để kiểm tra chức năng AVF trên các Router, ta thực hiện câu lệnh sau.

    R1# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 120 Active 10.0.1.254 local 10.0.1.2

    Et0/0 1 1 – Active 0007.b400.0101 local –

    Et0/0 1 2 – Listen 0007.b400.0102 10.0.1.2 –

    R1#

    R2# show glbp brief

    Interface Grp Fwd Pri State Address Active router Standby router

    Et0/0 1 – 100 Standby 10.0.1.254 10.0.1.1 local

    Et0/0 1 1 – Listen 0007.b400.0101 10.0.1.1 –

    Et0/0 1 2 – Active 0007.b400.0102 local –

    R2#

    Với thông tin hiển thị như trên, ta thấy hiện nay R1 đang làm AVF cho Virtual MAC 0007.b400.0101 còn R2 làm AVF cho Virtual MAC 0007.b400.0102.

    Bùi Quốc Kỳ
    Phạm Thanh Đông Khê
    Email: dongkhe@vnpro.org
    Hãy share hoặc like nếu thông tin hữu ích!
    ---------------------------------------------------------------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm, P.25, Q.Bình Thạnh, Tp.HCM
Tel: (08) 35124257 (5 lines)
Fax: (08) 35124314

Home Page: http://www.vnpro.vn
Forum: http://www.vnpro.org
Twitter: https://twitter.com/VnVnpro
LinkedIn: https://www.linkedin.com/in/VnPro
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Videos: http://www.dancisco.com
Blog: http://www.vnpro.org/blog
FB: http://facebook.com/VnPro
Working...
X