/*auto readmore*/ /*auto readmore*/ /* an hien script*/ // an hien password /*an hien ma chuong trinh cong tru */ /*Scrollbox thanh cuon*/ /***Nhung CODE***/ /* dòng xanh dòng trắng */ /* https://cdnjs.com/libraries/prism lay thu vien, can vao ten file ma goi 1. copy link vao vi du:prism-python.min.js 2. ten ngon nua la python */ /*=== New posts ===*/ /*header slider*/ /*=== bai viet lien quan===*/ /*===tabcode===*/
Showing posts with label PAgP. Show all posts
Showing posts with label PAgP. Show all posts

Cisco, Etherchannel on Catalyst Switch

Etherchannel là kỹ thuật để bó nhiều link vật lý lại với nhau thành một link luận lý, hôm nay chúng ta cùng nhau tìm hiểu xem Etherchannel hoạt động thư thế nào.


Ta có sơ đồ đấu nối như hình vẽ trên. Ví dụ băng thông của đường link đấu nối giữa 2 switch là:
  • 100 MB 
Nếu PC_01 đang trao đổi dữ liệu với PC_03 và chúng sử dụng hết băng thông là 100MB, tại thời điểm đó nếu có bất cứ PC nào bên Zone_A muốn truy cập đến các PC bên Zone_B và ngược lại thì nó sẽ xảy ra hiện tượng tắc nghẽn và mọi traffic sẽ bị drop.
  • 1.000 MB
- Nếu PC_01 đang trao đổi dữ liệu với PC_03 và chúng sử dụng băng thông là 800 MB;
- Và nếu PC_02 đang trao đổi dữ liệu với PC_04 và sẽ dự định sử dụng băng thông là 500 MB, lúc này cũng xảy ra hiện tượng tắc nghẽn vì 800 MB + 500 MB = 1.200 MB > 1.000 MB băng thông của đường link.

Giải pháp:
  • Nâng cấp đường link lên 10 GB -> Quay lại bài toán về chi phí, chi phí tốn rất nhiều để nâng cấp lên 10 GB trong khi đó nhu cầu cần chỉ 1.200 MB, gây ra lãng phí
  • Gắng nhiều link lại với nhau và bó chúng lại thành một EtherChannel nhằm mục đích tăng băng thông.


Với mô hình trên chúng ta nối nhiều đường link kết nối giữa 2 switch, lúc này sẽ tạo thành vòng loop nên spanning tree sẽ block 3/4 đường link này. Chính vì thế Etherchannel ra đời để giải quyết vấn đề này bằng cách chúng tạo ra một đường link ảo single virtual link hay chúng tạo ra một đường link luận lý bao gồm nhiều đường link vật lý (trường hợp là 4 đường link).


  • Băng thông của đường link này được tính bằng tổng băng thông các đường link vật lý (4 x 1.000 MB = 4.000 MB), spanning tree xem đường link này là một đường logical link (luận lý), sẽ không có loop xảy ra và sẽ không có spaning tree tồn tại giữa các link này.
  • Etherchannel sẽ thực hiện cân bằng tải - load balancing giữa các đường link này
  • Đảm bảo tính dự phòng - redundancy, nếu trong các link vật lý bị lỗi nó vẫn làm việc với các link còn lại.
  • Etherchannel hỗ trợ cả port Layer 2 (switch port) và port Layer 3 (routed port)
Với cisco có thể sử dụng maximum là 8 đường link (8 physical interface) active tại một thời điểm, nếu số đường link lớn hơn 8 thì chúng sẽ ở trạng thái Hot-Stanby, tuy nhiên chúng ta cũng có thể điều chỉnh được số lượng đường link active tại một thời điểm, nhưng không quá 8 đường active đồng thời.

Tham khảo link Cisco Etherchannel, theo khuyến cáo thì nên sử dụng 2n đường link khi cấu hình Etherchannel.

Có hai phương thức để thiết lập Etherchannel giữa 2 switch đó là:
  • Thiết lập tĩnh (static): thiết lập Etherchannel mà không sử dụng giao thức - protocol;
  • Thương lượng tự động (dynamic)
Có hai giao thức sử dụng để thương lượng tự động Etherchannel trên các catalyst switch của cisco đó là:
  • PAgP - Port Aggregation Protocol: là giao thức độc quyền của cisco, chỉ chạy trên các dòng sản phẩm switch của cisco 
  • LACP - Link Aggregation Control Protocol: là giao thức chuẩn quốc tế IEEE được chuẩn hóa bởi chuẩn IEEE 802.3ad
Các cổng/port tham gia vào tạo và thiết lập Etherchannel thành công thì phải đảm các điều kiện:
  • Cùng tốc độ - speed
  • Cùng duplex
  • Cùng switchport mode (Access hoặc trunk)
  • Cùng native vlan
  • Cùng cho qua các danh sách vlan (allow vlan) phải giống nhau
  • Phải chọn đúng mode hoạt động ở 2 đầu thiết bị thì mới có thể xây dựng được Etherchannel





Thực hành Etherchanel

Noted: Etherchannel không thể sử dụng nếu cấu hình SPAN là port destination.

Xong!

Mô Hình Mạng Cho Các Doanh Nghiệp Vừa & Nhỏ - Bài 2


Giới thiệu: Khi thiết kế hệ thống mạng thường thường gặp nhưng yêu cầu rẻ mà ngon, hệ thống phải có tính dự phòng nhưng chi phí rẻ nhất, hiệu quả nhất. Bài lab này sẽ đáp ứng yêu cầu đó.

Sơ đồ bài lab:

Các kiến thức: EtherChannel, Spanning, Trunking, Vlan, VTP, SVI, DHCP, NAT, static route, OSPF, IP SLA, Track

Yêu cầu:
1. Yêu cầu cấu hình ban đầu
     1a. Cấu hình EtherChannel theo yêu cầu hình sơ đồ lab; Po2 và Po3 mode trunk; Cấu hình đường trunk giứa switch AC_01 và AC_02
     1b. Cấu hình VTP và Tạo VLAN:
  • Cấu hình VTP:
          + Core_Sw: mode server
          + AC_01, AC_02: mode client
  • Tạo các VLAN từ 99 đến 103 trên Core_Sw, kiểm tra đảm bảo các vlan vừa tạo phải lang truyền xuống switch AC_01, AC_02.
  • Chuyển AC_02 về mode transparent
  • Tạo Vlan 200 trên Core_Sw
     1c. Gán các interface vào các VLAN tương ứng như sơ đồ
     1d. Đặt IP và trỏ route theo bảng quy hoạch IP

2. Cấu hình theo yêu cầu:
     2a. DHCP_Server: cấu hình các pool để cấp DHCP cho VLAN 101, VLAN 102, VLAN 103
     2b. Core_Sw: làm DHCP relay agent, định tuyến đảm bảo các PC, server có thể giao tiếp được với nhau sử dụng Switch Layer 3

3. Cấu hình đảm bảo Server Zone, Web server (vùng DMZ) và tất cả các PCs của các vlan có thể truy cập internet thông qua: (1) default gateway là các IP của SVI, (2) IP của firewall 192.168.98.254, (3) IP của R1 200.2.21.1.

4. Chạy OSPF trên Core_Sw, DMZ_Router, Firewall đảm bảo:
     4a. Server Zone và vlan 100-103 muốn truy cập vào Web_server bắt phải thông qua Firewall theo đúng thứ tự: (1) Default gateway là các SVI trên Core_Sw, (2) Firewall IP 192.168.98.254, (3) DMZ Router IP 192.168.99.252, (4) Web_Server.
     4b. Web_Server truy cập đến Server Zone và vlan 100-103 theo thứ tự: (1) default gateway IP 192.168.97.254, (2) Firewall IP 192.168.99.254, (3) Core_Sw IP 192.168.98.253, (4) đến host cần đến
     4c. Kiểm tra đảm bảo Web Server truy cập internet theo đúng thứ tự: (1) default gateway IP 192.168.97.254, (2) IP của Core_Sw 192.168.99.253, (3) IP của firewall 192.168.98.254, (4) IP của R1 200.2.21.1.
      4d. Kiểm tra đảm bảo rằng Web server, Server Zone, Vlan 101-103 có thể giao tiếp được với nhau khi firewall down.

5. Cấu hình rapid spanning tree và hiệu chỉnh sao cho:
      5a. Core_Sw là root bridge cho tất cả các vlan
     5b. AC_02 là backup root cho các Vlan 101, vlan 103; cấu hình port past cho các cổng Et1/1-2, Et0/3 của AC_02; tinh chỉnh trên AC_01 để port Po2 là port block cho vlan 101, 103
      5c. AC_01 là backup root cho các Vlan 102; cấu hình port past cho các cổng Et1/1-3 của AC_01; tinh chỉnh trên AC_02 để port Po2 là port block cho vlan 102

6. Cấu hình đảm bảo khi firewall chết tất PCs trong vùng LAN và vùng DMZ vẫn có thể truy cập được internet


Cấu hình:
1. Yêu cầu cấu hình ban đầu
     1a. Cấu hình EtherChannel theo yêu cầu hình sơ đồ lab; Po2 và Po3 mode trunk; Cấu hình đường trunk giứa switch AC_01 và AC_02

  • Cấu hình:

Server_Sw:
interface range Ethernet0/0-1
shutdown
channel-protocol lacp
channel-group 1 mode active
no shutdown

Core_Sw:
interface range Ethernet0/3,  Ethernet1/3
shutdown
 channel-protocol lacp
 channel-group 1 mode active
no shutdown
exit
!
interface range Ethernet0/1-2
shutdown
 channel-protocol pagp
 channel-group 2 mode desirable
no shutdown
exit
interface Port-channel2
 switchport trunk encapsulation dot1q
 switchport mode trunk
exit
!
interface range Ethernet1/1-2
 shutdown
 channel-protocol pagp
 channel-group 3 mode desirable
no shutdown
exit
interface Port-channel3
 switchport trunk encapsulation dot1q
 switchport mode trunk
end
write

AC_01:
interface range Ethernet0/1-2
shutdown
channel-protocol pagp
channel-group 2 mode desirable
no shutdown
exit
!
interface Port-channel2
 switchport trunk encapsulation dot1q
 switchport mode trunk
end
write

AC_02:
interface range Ethernet0/1-2
 shutdown
 channel-protocol pagp
 channel-group 3 mode desirable
no shutdown
exit
!
interface Port-channel3
 switchport trunk encapsulation dot1q
 switchport mode trunk
end

  • Kiểm tra:
Server_Sw#show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port
Number of channel-groups in use: 1
Number of aggregators:           1
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP      Et0/0(P)    Et0/1(P)  
Server_Sw#show etherchannel 1 port-channel
                Port-channels in the group:
                ---------------------------
Port-channel: Po1    (Primary Aggregator)
------------
Age of the Port-channel   = 0d:18h:40m:32s
Logical slot/port   = 16/0          Number of ports = 2
HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   LACP
Port security       = Disabled
Ports in the Port-channel:
Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
     0        00     Et0/0       Active             0
     0        00     Et0/1       Active             0

Cổng Et0/0 và Et0/1 đang trong group channel 1, protocol là LACP và đang trong trạng thái Active

Core_sw#show etherchannel 1 port-channel 
                Port-channels in the group:
                ---------------------------
Port-channel: Po1    (Primary Aggregator)
------------
Age of the Port-channel   = 0d:02h:51m:21s
Logical slot/port   = 16/0          Number of ports = 2
HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   LACP
Port security       = Disabled
Ports in the Port-channel:
Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
    0       00       Et0/3       Active             0
    0       00       Et1/3       Active             0
Time since last port bundled:    0d:02h:45m:08s    Et1/3

Tương tự trên Core_Sw các cổng trong port-channel 1 cũng đang Active với protocol là LACP

AC_01#show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port
Number of channel-groups in use: 1
Number of aggregators:           1
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
2      Po2(SU)         PAgP      Et0/1(P)    Et0/2(P)
Core_sw#show etherchannel 2 port-channel
                Port-channels in the group:
                ---------------------------
Port-channel: Po2
------------
Age of the Port-channel   = 0d:02h:43m:24s
Logical slot/port   = 16/1          Number of ports = 2
GC                  = 0x00020001      HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   PAgP
Port security       = Disabled
Ports in the Port-channel:
Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
  0     00     Et0/1    Desirable-Sl       0
  0     00     Et0/2    Desirable-Sl       0
Time since last port bundled:    0d:02h:41m:14s    Et0/1
Time since last port Un-bundled: 0d:02h:41m:20s    Et0/2

Tương tự AC_01 và Core_Sw đã thiết lập được port channel 2 theo yêu cầu đề bài.

AC_02#show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        M - not in use, minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port
Number of channel-groups in use: 1
Number of aggregators:           1
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
3      Po3(SU)         PAgP      Et0/1(P)    Et0/2(P)
Core_sw#show etherchannel 3 port-channel 
                Port-channels in the group:
                ---------------------------
Port-channel: Po3
------------
Age of the Port-channel   = 0d:02h:38m:41s
Logical slot/port   = 16/2          Number of ports = 2
GC                  = 0x00030001      HotStandBy port = null
Port state          = Port-channel Ag-Inuse
Protocol            =   PAgP
Port security       = Disabled
Ports in the Port-channel:
Index   Load   Port     EC state        No of bits
------+------+------+------------------+-----------
     0     00     Et1/1    Desirable-Sl       0
     0     00     Et1/2    Desirable-Sl       0
Time since last port bundled:    0d:00h:18m:54s    Et1/2
Time since last port Un-bundled: 0d:00h:36m:46s    Et1/1 
  
 Tương tự AC_02 và Core_Sw đã thiết lập được port channel 3 thành công

Core_sw#show etherchannel summary 
Flags:  D - down        P - bundled in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      N - not in use, no aggregation
        f - failed to allocate aggregator
        M - not in use, minimum links not met
        m - not in use, port not aggregated due to minimum links not met
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port
        A - formed by Auto LAG
Number of channel-groups in use: 3
Number of aggregators:           3
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)         LACP     Et0/3(P)    Et1/3(P) 
2      Po2(SU)         PAgP      Et0/1(P)    Et0/2(P) 
3      Po3(SU)         PAgP      Et1/1(P)    Et1/2(P)    

Đã có 3 port-etherchannel đã được thiết lập trên Core_Sw theo đúng yêu cầu đặt ra.

AC_01#show interfaces trunk 
Port        Mode             Encapsulation  Status        Native vlan
Po2            on                    802.1q         trunking      1
AC_02#show interfaces trunk 
Port        Mode             Encapsulation  Status        Native vlan
Po3            on                    802.1q         trunking      1
Core_sw# show interfaces trunk 
Port        Mode             Encapsulation  Status        Native vlan
Po2            on               802.1q              trunking      1
Po3            on               802.1q              trunking      1

Port-EtherChannel Po2 và Po3 đã thiết lập đường trunk với AC_01 và AC_02.

* Cấu hình đường trunk giứa switch AC_01 và AC_02

AC_01, AC_02:
interface Ethernet0/0
 switchport trunk encapsulation dot1q
 switchport mode trunk
end

Kiểm tra

AC_01#show interfaces trunk 
Port        Mode             Encapsulation  Status        Native vlan
Et0/0          on               802.1q         trunking      1
Po2             on               802.1q         trunking      1
AC_02#show interfaces trunk
Port        Mode             Encapsulation  Status        Native vlan
Et0/0       on               802.1q         trunking      1
Po3          on               802.1q         trunking      1

Switch AC_01 và AC_02 đã thiết lập trunking với nhau

     1b. Cấu hình VTP và Tạo VLAN:

  • Cấu hình VTP:
          + Core_Sw: mode server
          + AC_01, AC_02: mode client

Core_Sw:
vtp domain khanhvc
vtp password cisco
vtp version 2
vtp mode server
vtp pruning

AC_01, CA_02:
vtp domain khanhvc
vtp password cisco
vtp version 2
vtp mode client

Kiểm tra
Core_sw#show vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 2
VTP Domain Name                : khanhvc
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc80.4000
Configuration last modified by 0.0.0.0 at 10-30-19 06:15:18
Local updater ID is 0.0.0.0 (no valid interface found)
Feature VLAN:
--------------
VTP Operating Mode                : Server
Maximum VLANs supported locally   : 1005
Core_sw#show vtp password 
VTP Password: cisco

Kiểm tra các thông tin vừa cấu hình trên trên Core_Sw đã đúng yêu cầu

AC_01#show vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 2
VTP Domain Name                : khanhvc
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc00.1000
Configuration last modified by 0.0.0.0 at 10-30-19 06:15:18
Feature VLAN:
--------------
VTP Operating Mode                : Client
Maximum VLANs supported locally   : 1005
AC_02#show vtp status 
VTP Version capable             : 1 to 3
VTP version running             : 2
VTP Domain Name                : khanhvc
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : aabb.cc00.2000
Configuration last modified by 0.0.0.0 at 10-30-19 06:15:18
Feature VLAN:
--------------
VTP Operating Mode                : Client
Maximum VLANs supported locally   : 1005

Đối với các vtp client chúng ta không cần cấu hình Pruning và nó sẽ tự động Enable khi server đã cấu hình Pruning Enable

  • Tạo các VLAN từ 99 đến 103 trên Core_Sw, kiểm tra đảm bảo các vlan vừa tạo phải lang truyền xuống switch AC_01, AC_02.

Core_Sw:
vlan 99         
name ===DMZ Zone===
vlan 100
name ===Server Zone===
vlan 101
name ===IT_Dept.===
vlan 102
name ===Acc_Dept.===
vlan 103
name ===HR_Dept.===
end
write

Kiểm tra

AC_01#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                                   active    Et0/0, Et0/3, Et1/0, Et1/1
                                                                  Et1/2, Et1/3
99   ===DMZ Zone===              active 
100  ===Server Zone===           active 
101  ===IT_Dept.===                active 
102  ===Acc_Dept.===             active 
103  ===HR_Dept.===              active 

1002 fddi-default                        act/unsup
1003 trcrf-default                        act/unsup
1004 fddinet-default                    act/unsup
1005 trbrf-default                        act/unsup 
AC_02#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                                  active    Et0/0, Et0/3, Et1/0, Et1/1
                                                                 Et1/2, Et1/3
99   ===DMZ Zone===             active 
100  ===Server Zone===           active 
101  ===IT_Dept.===                active 
102  ===Acc_Dept.===             active 
103  ===HR_Dept.===             active 

1002 fddi-default                       act/unsup
1003 trcrf-default                      act/unsup
1004 fddinet-default                 act/unsup
1005 trbrf-default                     act/unsup 

Các vlan vừa tạo trên Core_Sw đã lang truyền đến AC_01 và AC_02 nhờ vtp có cùng thông tin với Core_Sw

  • Chuyển AC_02 về mode transparent
AC_02:
vtp mode transparent

  • Tạo Vlan 200 trên Core_Sw

Core_Sw:
vlan 200
name ===WAN Zone===
exit

Kiểm tra:

AC_01# show vlan brief 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/0, Et0/3, Et1/0, Et1/1
                                                Et1/2, Et1/3
99   ===DMZ Zone===                   active 
100  ===Server Zone===                active 
101  ===IT_Dept.===                   active 
102  ===Acc_Dept.===                  active 
103  ===HR_Dept.===                   active 
200  ===WAN Zone===                   active 
1002 fddi-default                     act/unsup
1003 trcrf-default                    act/unsup
1004 fddinet-default                  act/unsup 

Vlan 200 đã lang truyền đến AC_01 vì hiện tại AC_01 đang ở mode client

AC_02#show vlan brief 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/0, Et0/3, Et1/0, Et1/1
                                                Et1/2, Et1/3
99   ===DMZ Zone===                   active 
100  ===Server Zone===                active 
101  ===IT_Dept.===                   active 
102  ===Acc_Dept.===                  active 
103  ===HR_Dept.===                   active 
1002 fddi-default                     act/unsup
1003 trcrf-default                    act/unsup
1004 fddinet-default                  act/unsup
1005 trbrf-default                    act/unsup

Trên AC_02 không có vlan 200, vì AC_02 đang ở mode transparent. Nếu Switch đang ở mode transparent chỉ được phép thêm sửa xóa các vlan chỉ có tác dụng trên local switch mà thôi, và nó sẽ không ảnh hưởng thông tin vlan của các switch khác trong cùng domain.

     1c. Gán các interface vào các VLAN tương ứng như sơ đồ: 




Giải thích vì sao lại đấu nối kỳ cục thế:
  • Vlan 200: tận dụng các port còn trống trên Core_Sw chưa dùng và có đến 6 IP cần dùng nhưng hiện tại mới dùng 2 con, nếu có thiết bị nào cần dùng IP public không NAT ta chỉ gắng chúng vào port còn trống trên Core_Sw và gán port đó vào vlan 200 là được.
  • Vlan 99: Thường là vùng DMZ sẽ nối trực tiếp vào firewall nhưng nếu firewall down thì các IP trong LAN không trể truy cập vào được vùng này, nếu muốn vùng LAN truy cập vào thì phải đấu nối vào core rồi cấu hình các kiểu. Vì yêu cầu đặt ra chi phí thấp nhất có thể nên tận dụng port trống trên Core_Sw, kết hợp routing để giải quyết yêu cầu
  • DMZ_Router: ta có thể dùng switch layer 3 cho router (lab dùng router để các bạn dể hình dung)
Sơ đồ layer 3

Cấu hình
Core_Sw:
interface range ethernet 0/0, ethernet 2/3
switchport mode access
switchport access vlan 200
exit
!
interface range ethernet 2/1, ethernet 1/0
switchport mode access
switchport access vlan 99
exit
!
interface Po 1
switchport mode access
switchport access vlan 100
end

AC_01:
interface range ethernet 1/1-2
switchport mode access
switchport access vlan 102
exit
!
interface ethernet 1/3
switchport mode access
switchport access vlan 103
end

AC_02:
interface ethernet 1/1
switchport mode access 
switchport access vlan 103
exit
!
interface ethernet 1/2
switchport mode access
switchport access vlan 102
exit
!
interface ethernet 0/3
switchport mode access
switchport access vlan 101
end

Kiểm tra:


Core_sw#show vlan brief 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et2/0, Et2/2
99   ===DMZ Zone===                   active    Et1/0, Et2/1
100  ===Server Zone===                active    Po1

101  ===IT_Dept.===                     active 
102  ===Acc_Dept.===                  active 
103  ===HR_Dept.===                   active 
200  ===WAN Zone===                   active    Et0/0, Et2/3
AC_01#show vlan brief 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/3, Et1/0
99   ===DMZ Zone===                   active 
100  ===Server Zone===                active 
101  ===IT_Dept.===                     active 
102  ===Acc_Dept.===                  active    Et1/1, Et1/2
103  ===HR_Dept.===                   active    Et1/3

200  ===WAN Zone===                   active    
AC_02#show vlan brief 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et1/0, Et1/3
99   ===DMZ Zone===                   active 
100  ===Server Zone===                active 
101  ===IT_Dept.===                     active    Et0/3
102  ===Acc_Dept.===                  active    Et1/2
103  ===HR_Dept.===                   active    Et1/1

Kiểm tra trên Core_Sw, AC_01, AC_02 thì các port đã gán đúng theo yêu cầu đặt ra.

     1d. Đặt IP và trỏ route theo bảng quy hoạch IP
Bảng quy hoạch IP

ISP:
interface Loopback0
ip address 8.8.8.8 255.255.255.255
!
interface Ethernet0/1
no shutdown
ip address 100.2.12.1 255.255.255.252
exit
!
ip route 200.2.21.0 255.255.255.248 100.2.12.2
end
200.2.12.0/29 là dãy ip public doanh nghiệp đã mua nhằm phục vụ cho mục đích của họ nên chúng ta phải route về router của doanh nghiệp
R1:
interface Ethernet0/0
no shutdown
ip address 100.2.12.2 255.255.255.252
exit
interface Ethernet0/1
no shutdown
ip address 200.2.21.1 255.255.255.248
exit
!
ip route 0.0.0.0 0.0.0.0 100.2.12.1
end

Core_Sw:
interface Vlan99
no shutdown
ip address 192.168.99.253 255.255.255.248
exit
interface Vlan100
no shutdown
ip address 192.168.100.254 255.255.255.0
exit
interface Vlan101
no shutdown
ip address 192.168.101.254 255.255.255.0
exit
interface Vlan102
no shutdown
ip address 192.168.102.254 255.255.255.0
exit
interface Vlan103
no shutdown
ip address 192.168.103.254 255.255.255.0
exit
!
interface Ethernet2/2
no switchport
no shutdown
ip address 192.168.98.253 255.255.255.248
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.98.254
end
write

Chúng ta không đặt IP cho vlan 200 vì không muốn vlan 200 tham gia vào route của các SVI trên Core switch.
DMZ_Router:
interface Ethernet0/0
no shutdown
 ip address 192.168.99.252 255.255.255.248
exit
interface Ethernet0/1
no shutdown
ip address 192.168.97.254 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.99.253
end

WEB_Server:
interface Ethernet0/0
no shutdown
ip address 192.168.97.1 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.97.254
end

ACC_Server:
interface Ethernet0/0
no shutdown
ip address 192.168.100.3 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.100.254
end

HR_Server:
interface Ethernet0/0
no shutdown
ip address 192.168.100.2 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.100.254
end


DHCP_Server:
interface Ethernet0/0
no shutdown
ip address 192.168.100.1 255.255.255.0
exit
!
ip route 0.0.0.0 0.0.0.0 192.168.100.254
end

2. Cấu hình theo yêu cầu:
     2a. DHCP_Server: cấu hình các pool để cấp DHCP cho VLAN 101, VLAN 102, VLAN 103

DHCP Server:
ip dhcp pool VLAN_101
network 192.168.101.0 255.255.255.0
default-router 192.168.101.254
exit
!
ip dhcp pool VLAN_102
network 192.168.102.0 255.255.255.0
default-router 192.168.102.254
exit
!
ip dhcp pool VLAN_103
network 192.168.103.0 255.255.255.0
default-router 192.168.103.254
end

   2b. Core_Sw: làm DHCP relay agent, định tuyến đảm bảo các PC, server có thể giao tiếp được với nhau sử dụng Switch Layer 3

Core_Sw:

ip routing
!
interface range Vlan 101-103
ip helper-address 192.168.100.1
end

Cấu hình DHCP relay trỏ về DHCP server có ip 192.168.100.1, và đảm bảo rằng các máy có thể xin được DHCP thì cần phải cấu hình thêm ip routing để các ip khác lớp mạng có thể giao tiếp được với nhau qua switch layer 3.


Kiểm tra:

IT_01> dhcp
DORA IP 192.168.101.1/24 GW 192.168.101.254
ACC_02> dhcp
DORA IP 192.168.102.2/24 GW 192.168.102.254
HR_01> dhcp
DORA IP 192.168.103.1/24 GW 192.168.103.254

Các PC ở các vlan đã nhận được ip từ DHCP server

DHCP_Server#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                           Hardware address/
                           User name
192.168.101.1       0100.5079.6668.11       Nov 02 2019 10:05 AM    Automatic
192.168.102.2       0100.5079.6668.06       Nov 02 2019 10:05 AM    Automatic
192.168.103.1       0100.5079.6668.07       Nov 02 2019 10:04 AM    Automatic

Kiểm tra trên DHCP server đã có các thông của dhcp client

HR_01> ping 192.168.99.252
84 bytes from 192.168.99.252 icmp_seq=1 ttl=254 time=1.744 ms
84 bytes from 192.168.99.252 icmp_seq=2 ttl=254 time=2.078 ms
84 bytes from 192.168.99.252 icmp_seq=3 ttl=254 time=1.440 ms
84 bytes from 192.168.99.252 icmp_seq=4 ttl=254 time=2.419 ms
84 bytes from 192.168.99.252 icmp_seq=5 ttl=254 time=3.582 ms
HR_01> ping 192.168.100.1
84 bytes from 192.168.100.1 icmp_seq=1 ttl=254 time=2.141 ms
84 bytes from 192.168.100.1 icmp_seq=2 ttl=254 time=2.532 ms
84 bytes from 192.168.100.1 icmp_seq=3 ttl=254 time=2.225 ms
84 bytes from 192.168.100.1 icmp_seq=4 ttl=254 time=2.129 ms
84 bytes from 192.168.100.1 icmp_seq=5 ttl=254 time=3.209 ms
HR_01> ping 192.168.101.1
84 bytes from 192.168.101.1 icmp_seq=1 ttl=63 time=5.119 ms
84 bytes from 192.168.101.1 icmp_seq=2 ttl=63 time=2.034 ms
84 bytes from 192.168.101.1 icmp_seq=3 ttl=63 time=2.131 ms
84 bytes from 192.168.101.1 icmp_seq=4 ttl=63 time=3.569 ms
84 bytes from 192.168.101.1 icmp_seq=5 ttl=63 time=3.117 ms
HR_01> ping 192.168.102.2
84 bytes from 192.168.102.2 icmp_seq=1 ttl=63 time=4.459 ms
84 bytes from 192.168.102.2 icmp_seq=2 ttl=63 time=2.123 ms
84 bytes from 192.168.102.2 icmp_seq=3 ttl=63 time=3.171 ms
84 bytes from 192.168.102.2 icmp_seq=4 ttl=63 time=3.347 ms
84 bytes from 192.168.102.2 icmp_seq=5 ttl=63 time=1.680 ms

Ví dụ đứng từ vlan 103 ta có thể ping đến tất cả các vlan còn lại.

3. Cấu hình đảm bảo Server Zone, Web server (vùng DMZ) và tất cả các PCs của các vlan có thể truy cập internet thông qua: (1) default gateway là các IP của SVI, (2) IP của firewall 192.168.98.254, (3) IP của R1 200.2.21.1.

Giải thích trước khi cấu hình:
Trong mô hình này giữa R1 và Firewall có thể có nhiều cách để cấu hình để cho các thiết bị bên dưới có thể truy cập được internet ví dụ như: 
+ Nat Overload trên R1
+ Nat Overload trên Firewall
+ Nat Overload trên R1 và Firewall (NAT 2 lần)
Và tạo thêm route tương ứng, tuy nhiên trong bài này chúng ta chọn NAT Overload trên Firewall. NAT trên firewall có nhiều linh động hơn so với router. Sẽ có bài nói về chuyền đề về firewall chúng ta sẽ tìm hiểu kỹ hơn.

Firewall:
interface Ethernet0/3
ip address 200.2.21.2 255.255.255.248
no shutdown
exit
interface Ethernet0/2
ip address 192.168.98.254 255.255.255.248
no shutdown
exit
interface Ethernet0/1
ip address 192.168.99.254 255.255.255.248
no shutdown
exit
!
interface Ethernet0/2
ip nat inside
interface Ethernet0/3
ip nat outside
ip nat inside source list 1 interface Ethernet0/3 overload
!
access-list 1 permit any
!
ip route 0.0.0.0 0.0.0.0 200.2.21.1
ip route 192.168.0.0 255.255.0.0 192.168.98.253
end
write

Để đảm bảo firewall có thể đến được các IP bên dưới chúng ta phải cấu hình thêm route và trỏ next-hop về Core_Sw "ip route 192.168.0.0 255.255.0.0 192.168.98.253"

Core_Sw:
ip route 192.168.97.0 255.255.255.0 192.168.99.252
end
write

Đảm bảo Core_Sw biết đường đi đến Web_Server, trong trường hợp này phải có route này thì Web_Server mới có thể truy cập internet được.

Kiểm tra:
ACC_01> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=252 time=3.218 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=252 time=3.646 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=252 time=3.534 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=252 time=3.074 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=252 time=3.303 ms

HR_01> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=252 time=3.529 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=252 time=3.645 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=252 time=3.229 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=252 time=3.585 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=252 time=3.482 ms

IT_01> ping 8.8.8.8
84 bytes from 8.8.8.8 icmp_seq=1 ttl=252 time=3.175 ms
84 bytes from 8.8.8.8 icmp_seq=2 ttl=252 time=3.797 ms
84 bytes from 8.8.8.8 icmp_seq=3 ttl=252 time=5.337 ms
84 bytes from 8.8.8.8 icmp_seq=4 ttl=252 time=4.087 ms
84 bytes from 8.8.8.8 icmp_seq=5 ttl=252 time=4.176 ms
WEB_Server#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms

Các máy bên dưới có thể truy cập internet thành công

WEB_Server#traceroute 8.8.8.8 numeric 
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.97.254 1 msec 0 msec 1 msec
  2 192.168.99.253 1 msec 1 msec 1 msec
  3 192.168.98.254 2 msec 1 msec 1 msec
  4 200.2.21.1 3 msec 4 msec 3 msec
  5 100.2.12.1 3 msec *  3 msec

DHCP_Server#traceroute 8.8.8.8 numeric 
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.100.254 1 msec 1 msec 1 msec
  2 192.168.98.254 1 msec 2 msec 2 msec
  3 200.2.21.1 3 msec 3 msec 2 msec
  4 100.2.12.1 4 msec *  4 msec

IT_01> tracer 8.8.8.8 
trace to 8.8.8.8, 8 hops max, press Ctrl+C to stop
 1   192.168.101.254   2.165 ms  1.912 ms  1.844 ms
 2   192.168.98.254   2.446 ms  2.108 ms  2.618 ms
 3   200.2.21.1   3.123 ms  3.119 ms  2.969 ms
 4   *100.2.12.1   3.426 ms (ICMP type:3, code:3, Destination port unreachable)

Qua kết quả traceroute ta thấy các thiết bị bên dưới đã kết nối internet đúng theo thứ tự yêu cầu đặt ra.

4. Chạy OSPF trên Core_Sw, DMZ_Router, Firewall đảm bảo:
4a. Server Zone và vlan 100-103 muốn truy cập vào Web_server bắt phải thông qua Firewall theo đúng thứ tự: (1) Default gateway là các SVI trên Core_Sw, (2) Firewall IP 192.168.98.254, (3) DMZ Router IP 192.168.99.252, (4) Web_Server.

Kiểm tra trước khi cấu hình
ACC_Server#traceroute 192.168.97.1 numeric 
Type escape sequence to abort.
Tracing the route to 192.168.97.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.100.254 1 msec 1 msec 1 msec
  2 192.168.99.252 2 msec 1 msec 2 msec
  3 192.168.97.1 2 msec *  2 msec
DHCP_Server#traceroute 192.168.97.1 numeric 
Type escape sequence to abort.
Tracing the route to 192.168.97.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.100.254 2 msec 1 msec 1 msec
  2 192.168.99.252 1 msec 2 msec 2 msec
  3 192.168.97.1 2 msec *  2 msec
ACC_01> trace 192.168.97.1
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.102.254   2.601 ms  0.769 ms  0.909 ms
 2   192.168.99.252   1.766 ms  1.896 ms  2.804 ms
 3   *192.168.97.1   1.996 ms (ICMP type:3, code:3, Destination port unreachable)  *

HR_01> trace 192.168.97.1
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.103.254   0.949 ms  1.460 ms  0.722 ms
 2   192.168.99.252   1.471 ms  1.085 ms  0.984 ms
 3   *192.168.97.1   1.710 ms (ICMP type:3, code:3, Destination port unreachable)  *
IT_01> trace 192.168.97.1
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.101.254   2.161 ms  1.726 ms  1.806 ms
 2   192.168.99.252   2.526 ms  2.602 ms  2.252 ms
 3   *192.168.97.1   2.761 ms (ICMP type:3, code:3, Destination port unreachable)  *

Next-hop thứ 2 hiện tại trong kết quả tracert đang trỏ về IP 192.168.99.252 chưa đúng với yêu cầu

WEB_Server#traceroute 192.168.100.1 numeric
Type escape sequence to abort.
Tracing the route to 192.168.100.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.97.254 1 msec 0 msec 1 msec
  2 192.168.99.253 2 msec 1 msec 1 msec
  3 192.168.100.1 3 msec *  2 msec

Next-hop thứ 2 đúng phải là 192.168.99.254


  • Cấu hình:
Core_Sw:
no ip route 192.168.97.0 255.255.255.0 192.168.99.252
!
router ospf 1
router-id 1.1.1.1
exit
interface range vlan 99-103, ethernet 2/2
ip ospf 1 area 0
end
write
DMZ_Router:
router ospf 1
router-id 2.2.2.2
exit
interface range ethernet 0/0-1
ip ospf 1 area 0
end
write
Firewall:
router ospf 1
router-id 3.3.3.3
exit
interface range ethernet 0/1-2
ip ospf 1 area 0
end
write

  • Kiểm tra:
DMZ_Router#show ip ospf interface ethernet 0/1
Ethernet0/1 is up, line protocol is up
  Internet Address 192.168.97.254/24, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 10
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           10        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 2.2.2.2, Interface address 192.168.97.254
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:07
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 0
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Firewall#show ip ospf interface ethernet 0/1
Ethernet0/1 is up, line protocol is up
  Internet Address 192.168.99.254/29, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 10
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           10        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 192.168.99.254
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.99.252
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:02
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 2
  Last flood scan time is 0 msec, maximum is 1 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 1.1.1.1
    Adjacent with neighbor 2.2.2.2  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)

Core_Sw#show ip ospf interface ethernet 2/2
Ethernet2/2 is up, line protocol is up (connected)
Internet Address 192.168.98.253/29, Area 0, Attached via Interface Enable
Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10
Topology-MTID Cost Disabled Shutdown Topology Name
0 10 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 1.1.1.1, Interface address 192.168.98.253
Backup Designated router (ID) 3.3.3.3, Interface address 192.168.98.254
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 2
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.3 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Core_Sw#show ip ospf interface vlan 99
Vlan99 is up, line protocol is up
  Internet Address 192.168.99.253/29, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
                      0           1            no               no              Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 192.168.99.254
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.99.252
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 6/6, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 3
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 2.2.2.2  (Backup Designated Router)
    Adjacent with neighbor 3.3.3.3  (Designated Router)
  Suppress hello for 0 neighbor(s)

Phân tích: Để chọn đường đi từ vlan 100-103 đến Web_server ta có thể tính bằng tổng metric(cost) theo hướng ngược lại từ web_server đến các vlan theo nguyên tắt vào cộng ra không cộng, và sẽ có 2 hướng đi với 2 giá trị tương ứng:
* Et0/1 của DMZ router + Et0/1 của Firewall + Et2/2 của Core_Sw = 10 + 10 + 10 = 30   (I)
* Et0/1 của DMZ router +  Vlan 99 trên Core_Sw  = 10 + 1 = 11  (II)

Ta thấy tổng path-cost theo hướng (II) = 11 tốt hơn theo hướng (I) nên chắc chắn hướng đi hiện tại sẽ chọn là hướng (II)

Core_Sw#show ip route 192.168.97.1
Routing entry for 192.168.97.0/24
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.99.252 on Vlan99, 01:58:49 ago
  Routing Descriptor Blocks:
  * 192.168.99.252, from 2.2.2.2, 01:58:49 ago, via Vlan99
      Route metric is 11, traffic share count is 1

Kết quả bảng route hiện tại để đến Web_server 192.168.97.1 bắt buột phải đi qua vlan 99 và next-hop 192.168.99.252 theo phân tích trên.

Để hiệu chỉnh đường đi của ospf có nhiều cách, trong trường hợp này ta hiệu chỉnh cost sao cho tổng path cost đến web_server đi qua cổng Ethernet 2/2 phải tốt hơn tổng path cost đi qua vlan 99 và cụ thể là: Et0/1 của DMZ router +  Vlan 99 trên Core_Sw phải lớn hơn 30 (30 là kết quả phân tích theo hướng (I)) là được.

Core_Sw:
interface vlan 99
ip ospf cost 21
end
write

Chỉnh cost của ospf trên vlan 99 = 21. Và theo cách phân tích trên tổng path-cost = 30 - theo hướng (I) sẽ được chọn vì sau khi hiệu chỉnh cost trên cổng vlan 99 tổng path-cost theo hướng (II) 10 + 21 = 31 > 30.

Core_Sw#show ip ospf interface vlan 99
Vlan99 is up, line protocol is up
  Internet Address 192.168.99.253/29, Area 0, Attached via Interface Enable
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 21
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           21        no          no            Base
  Enabled by interface config, including secondary ip addresses
  Transmit Delay is 1 sec, State DROTHER, Priority 1
  Designated Router (ID) 3.3.3.3, Interface address 192.168.99.254
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.99.252
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:09
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 6/6, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 3
  Last flood scan time is 0 msec, maximum is 1 msec
  Neighbor Count is 2, Adjacent neighbor count is 2
    Adjacent with neighbor 2.2.2.2  (Backup Designated Router)
    Adjacent with neighbor 3.3.3.3  (Designated Router)
  Suppress hello for 0 neighbor(s)
Core_Sw#show ip route 192.168.97.1
Routing entry for 192.168.97.0/24
  Known via "ospf 1", distance 110, metric 30, type intra area
  Last update from 192.168.98.254 on Ethernet2/2, 00:01:02 ago
  Routing Descriptor Blocks:
  * 192.168.98.254, from 2.2.2.2, 00:01:02 ago, via Ethernet2/2
      Route metric is 30, traffic share count is 1

Sau khi điều chỉnh cost, route đến Web_server đã đi qua Ethernet2/2, đúng như lập luận ở trên

ACC_01> trace 192.168.97.1
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.102.254   1.280 ms  0.983 ms  0.906 ms
 2   192.168.98.254   1.970 ms  1.573 ms  1.764 ms
 3   192.168.99.252   2.358 ms  2.006 ms  1.977 ms
 4   *192.168.97.1   2.757 ms (ICMP type:3, code:3, Destination port unreachable)  *

HR_01> trace 192.168.97.1 
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.103.254   1.024 ms  1.282 ms  0.938 ms
 2   192.168.98.254   1.461 ms  1.521 ms  1.476 ms
 3   192.168.99.252   2.128 ms  1.689 ms  1.916 ms
 4   *192.168.97.1   2.580 ms (ICMP type:3, code:3, Destination port unreachable)  *
IT_01> trace 192.168.97.1
trace to 192.168.97.1, 8 hops max, press Ctrl+C to stop
 1   192.168.101.254   1.567 ms  1.632 ms  1.726 ms
 2   192.168.98.254   2.493 ms  2.336 ms  2.178 ms
 3   192.168.99.252   2.617 ms  2.609 ms  2.116 ms
 4   *192.168.97.1   3.055 ms (ICMP type:3, code:3, Destination port unreachable)  *
DHCP_Server#traceroute 192.168.97.1 numeric 
Type escape sequence to abort.
Tracing the route to 192.168.97.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.100.254 1 msec 1 msec 0 msec
  2 192.168.98.254 1 msec 1 msec 1 msec
  3 192.168.99.252 2 msec 2 msec 2 msec
  4 192.168.97.1 2 msec *  5 msec

Ta thấy các thứ tự trong kết quả tracert đã đáp ứng được yêu cầu đề bài.

4b. Web_Server truy cập đến Server Zone và vlan 100-103 theo thứ tự: (1) default gateway IP 192.168.97.254, (2) Firewall IP 192.168.99.254, (3) Core_Sw IP 192.168.98.253, (4) đến host cần đến

Giải thích trước khi cấu hình: Nếu chọn đường đi theo tổng path-cost trong ospf tương tự như lập luận ở câu 4a ta có:
* cost của vlan 100 trên Core_Sw + cost Et0/2 trên Firewall + cost E0/t của DMZ_Router = 1 + 10 + 10 =21 (III)
* cost của vlan 100 trên Core_Sw  + cost E0/t của DMZ_Router = 1 + 10 = 11 (IV)
Ta thấy (IV) sẽ luôn được chọn.

DMZ_Router#show ip route 192.168.100.1
Routing entry for 192.168.100.0/24
  Known via "ospf 1", distance 110, metric 11, type intra area
  Last update from 192.168.99.253 on Ethernet0/0, 00:01:32 ago
  Routing Descriptor Blocks:
  * 192.168.99.253, from 1.1.1.1, 00:01:32 ago, via Ethernet0/0
      Route metric is 11, traffic share count is 1

Nêu với yêu cầu của bài này chúng ta sẽ không chọn cách chọn hướng đi bằng metric/cost.

DMZ_Router#show ip route ospf
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override
Gateway of last resort is 192.168.99.253 to network 0.0.0.0
      192.168.98.0/29 is subnetted, 1 subnets
O        192.168.98.248 [110/20] via 192.168.99.254, 03:07:12, Ethernet0/0
                        [110/20] via 192.168.99.253, 03:07:12, Ethernet0/0
   192.168.100.0/24 [110/11] via 192.168.99.253, 00:06:02, Ethernet0/0
O     192.168.101.0/24 [110/11] via 192.168.99.253, 23:54:27, Ethernet0/0
O     192.168.102.0/24 [110/11] via 192.168.99.253, 23:54:27, Ethernet0/0
O     192.168.103.0/24 [110/11] via 192.168.99.253, 23:54:27, Ethernet0/0

Route  trên DMZ_Router hiện tại học được các lớp mạng của vlan 100-103 thông qua OSPF có AD =110. Để đơn giản trên DMZ_Router ta tạo thêm Static route với AD <110 lúc này hướng đi đến các vlan 100-103 chắc chắn sẽ được chọn và hiển thị trong bảng routing vì AD < 110.

DMZ_Router:
ip route 192.168.100.0 255.255.255.0 192.168.99.254 100

DMZ_Router#show ip route 
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override
Gateway of last resort is 192.168.99.253 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 192.168.99.253
      192.168.97.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.97.0/24 is directly connected, Ethernet0/1
L        192.168.97.254/32 is directly connected, Ethernet0/1
      192.168.98.0/29 is subnetted, 1 subnets
O        192.168.98.248 [110/20] via 192.168.99.254, 03:17:23, Ethernet0/0
                        [110/20] via 192.168.99.253, 03:17:23, Ethernet0/0
      192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.99.248/29 is directly connected, Ethernet0/0
L        192.168.99.252/32 is directly connected, Ethernet0/0
   192.168.100.0/24 [100/0] via 192.168.99.254
O     192.168.101.0/24 [110/11] via 192.168.99.253, 1d00h, Ethernet0/0
O     192.168.102.0/24 [110/11] via 192.168.99.253, 1d00h, Ethernet0/0
O     192.168.103.0/24 [110/11] via 192.168.99.253, 1d00h, Ethernet0/0
DMZ_Router#show ip route 192.168.100.0
Routing entry for 192.168.100.0/24
  Known via "static", distance 100, metric 0
  Routing Descriptor Blocks:
  * 192.168.99.254
      Route metric is 0, traffic share count is 1

Bây giờ đường đi đến vlan 100 sẽ thông qua gateway 192.168.99.254

WEB_Server#traceroute 192.168.100.1 numeric 
Type escape sequence to abort.
Tracing the route to 192.168.100.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.97.254 1 msec 1 msec 0 msec
  2 192.168.99.254 2 msec 2 msec 1 msec
  3 192.168.98.253 1 msec 2 msec 3 msec
  4 192.168.100.1 6 msec *  4 msec


Đã đáp ứng đúng yêu cầu đặt ra.
Tương tự ta cấu hình cho vlan 101-103

DMZ_Router:
ip route 192.168.101.0 255.255.255.0 192.168.99.254 100
ip route 192.168.102.0 255.255.255.0 192.168.99.254 100
ip route 192.168.103.0 255.255.255.0 192.168.99.254 100

DMZ_Router#show ip route 
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override
Gateway of last resort is 192.168.99.253 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 192.168.99.253
      192.168.97.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.97.0/24 is directly connected, Ethernet0/1
L        192.168.97.254/32 is directly connected, Ethernet0/1
      192.168.98.0/29 is subnetted, 1 subnets
O        192.168.98.248 [110/20] via 192.168.99.254, 03:35:30, Ethernet0/0
                        [110/20] via 192.168.99.253, 03:35:30, Ethernet0/0
      192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.99.248/29 is directly connected, Ethernet0/0
L        192.168.99.252/32 is directly connected, Ethernet0/0
S     192.168.100.0/24 [100/0] via 192.168.99.254
S     192.168.101.0/24 [100/0] via 192.168.99.254
S     192.168.102.0/24 [100/0] via 192.168.99.254
S     192.168.103.0/24 [100/0] via 192.168.99.254

Tương tự với lập luận với vlan 100, yêu cầu 4b đã được giải quyết

4c. Kiểm tra đảm bảo Web Server truy cập internet theo đúng thứ tự: (1) default gateway IP 192.168.97.254, (2) IP của Core_Sw 192.168.99.253, (3) IP của firewall 192.168.98.254, (4) IP của R1 200.2.21.1.


WEB_Server#traceroute 8.8.8.8 numeric 
Type escape sequence to abort.
Tracing the route to 8.8.8.8
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.97.254 1 msec 0 msec 0 msec
  2 192.168.99.253 2 msec 1 msec 2 msec
  3 192.168.98.254 2 msec 2 msec 2 msec
  4 200.2.21.1 3 msec 2 msec 3 msec
  5 100.2.12.1 3 msec *  4 msec
Đã đáp ứng đúng yêu cầu đặt ra của bài

4d. Kiểm tra đảm bảo rằng Web server, Server Zone, Vlan 101-103 có thể giao tiếp được với nhau khi firewall down.

Hiện tại trên DMZ_Router học được router đến vlan 100-103 từ OSPF và Static route, vì AD của static route trong trường hợp này = 100 tốt hơn AD của OSPF nên đường đi đến các vlan 100-103 sẽ chọn qua hướng 192.168.99.254.
Trong trường hợp này ta dùng kỹ thuật TRACK + IP SLA để kiểm tra rằng: nếu không đến được IP 192.168.99.254 thì xóa route static ra khỏi bảng route, lúc này DMZ_Router chỉ còn route học được thông qua OSPF nên bảng route sẽ hiển thị trong bảng route và next-hop sẽ đi qua là 192.168.99.253.

ip sla 99254
icmp-echo 192.168.99.254
threshold 2
frequency 10
exit
!
ip sla schedule 99254 life forever start-time now
!
track 254 ip sla 99254 reachability
exit
!
no ip route 192.168.100.0 255.255.255.0 192.168.99.254 100
ip route 192.168.100.0 255.255.255.0 192.168.99.254 50 track 254
!
no ip route 192.168.101.0 255.255.255.0 192.168.99.254 100
ip route 192.168.101.0 255.255.255.0 192.168.99.254 50 track 254
!
no ip route 192.168.102.0 255.255.255.0 192.168.99.254 100
ip route 192.168.102.0 255.255.255.0 192.168.99.254 50 track 254
!
no ip route 192.168.103.0 255.255.255.0 192.168.99.254 100
ip route 192.168.103.0 255.255.255.0 192.168.99.254 50 track 254
end
write

Noted: Cấu hình ip sla tùy từng version của OS mà có cách cấu hình khác nhau đôi chút.

Xóa Static route có AD =100 thay bằng static route có AD = 50 kết hợp với kỹ thuật track để kiểm tra IP 192.168.99.254 có online không và thực hiện điều chỉnh bảng route cho phù hợp.

DMZ_Router#show ip route 
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override
Gateway of last resort is 192.168.99.253 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 192.168.99.253
      192.168.97.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.97.0/24 is directly connected, Ethernet0/1
L        192.168.97.254/32 is directly connected, Ethernet0/1
      192.168.98.0/29 is subnetted, 1 subnets
O        192.168.98.248 [110/20] via 192.168.99.254, 00:27:45, Ethernet0/0
                        [110/20] via 192.168.99.253, 00:47:05, Ethernet0/0
      192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.99.248/29 is directly connected, Ethernet0/0
L        192.168.99.252/32 is directly connected, Ethernet0/0
S     192.168.100.0/24 [50/0] via 192.168.99.254
S     192.168.101.0/24 [50/0] via 192.168.99.254
S     192.168.102.0/24 [50/0] via 192.168.99.254
Hiện tại đường đi từ Web server đi đến các vlan 100-103 đang đi thông qua IP 192.168.99.254 với AD = 50

Firewall:
interface ethernet 0/1
shutdown 

Thử shutdown interface Et0/1 của Fw để kiểm tra

DMZ_Router#
*Nov  6 08:27:36.297: %TRACKING-5-STATE: 254 ip sla 99254 reachability Up->Down

Thông báo trên DMZ_Router trạng thái của SLA đã down

DMZ_Router#show ip route 
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override
Gateway of last resort is 192.168.99.253 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 192.168.99.253
      192.168.97.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.97.0/24 is directly connected, Ethernet0/1
L        192.168.97.254/32 is directly connected, Ethernet0/1
      192.168.98.0/29 is subnetted, 1 subnets
O        192.168.98.248 [110/20] via 192.168.99.253, 00:57:53, Ethernet0/0
      192.168.99.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.99.248/29 is directly connected, Ethernet0/0
L        192.168.99.252/32 is directly connected, Ethernet0/0
O     192.168.100.0/24 [110/11] via 192.168.99.253, 00:02:13, Ethernet0/0
O     192.168.101.0/24 [110/11] via 192.168.99.253, 00:02:13, Ethernet0/0
O     192.168.102.0/24 [110/11] via 192.168.99.253, 00:02:13, Ethernet0/0
O     192.168.103.0/24 [110/11] via 192.168.99.253, 00:02:13, Ethernet0/0

Bây giờ bảng route hiện tại đến các vlan 100-103 là học được từ OSPF và thông qua IP 192.168.99.253

WEB_Server#traceroute 192.168.100.1 numeric 
Type escape sequence to abort.
Tracing the route to 192.168.100.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.97.254 5 msec 1 msec 1 msec
  2 192.168.99.253 1 msec 1 msec 2 msec
  3 192.168.100.1 2 msec *  3 msec

Kết quả tracert cho thấy đã từ web_server đi đến vlan 100 không còn qua firewall nữa

DHCP_Server#traceroute 192.168.97.1 numeric
Type escape sequence to abort.
Tracing the route to 192.168.97.1
VRF info: (vrf in name/id, vrf out name/id)
  1 192.168.100.254 1 msec 1 msec 1 msec
  2 192.168.99.252 2 msec 2 msec 1 msec
  3 192.168.97.1 2 msec *  3 msec

Và từ vlan 100 đến web_server cũng không còn đi qua firewall nữa.

Các bạn tự kiểm tra các vlan còn lại.

5. Cấu hình rapid spanning tree và hiệu chỉnh sao cho:
5a. Core_Sw là root bridge cho tất cả các vlan


Cấu hình:
spanning-tree mode rapid-pvst
spanning-tree vlan 1-4094 priority 4096 

bài lab này chọn cách cấu hình thay đổi và điền priority trực tiếp 1 số cụ thể, tuy nhiên vẫn có cách khác để cấu hình 1 switch làm root bridge ví dụ: spanning-tree vlan 1-4094 root primary

Kiểm tra:
Core_Sw#show spanning-tree vlan 101
VLAN0101
  Spanning tree enabled protocol rstp
  Root ID    Priority    4197
             Address     aabb.cc00.4000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    4197   (priority 4096 sys-id-ext 101)
             Address     aabb.cc00.4000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po3                 Desg FWD 56        128.65   Shr
Po2                 Desg FWD 56        128.66   Shr 
Trạng thái các cổng của root brigde là forward.
Số 4197 = 4096 + VLAN ID = 4096 + 101 =  4179

Core_Sw#show spanning-tree vlan 102
VLAN0102
  Spanning tree enabled protocol rstp
  Root ID    Priority    4198
             Address     aabb.cc00.4000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    4198   (priority 4096 sys-id-ext 102)
             Address     aabb.cc00.4000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po3                 Desg FWD 56        128.65   Shr
Po2                 Desg FWD 56        128.66   Shr 
Core_Sw#show spanning-tree vlan 103
VLAN0103
  Spanning tree enabled protocol rstp
  Root ID    Priority    4199
             Address     aabb.cc00.4000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    4199   (priority 4096 sys-id-ext 103)
             Address     aabb.cc00.4000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Po3                 Desg FWD 56        128.65   Shr
Po2                 Desg FWD 56        128.66   Shr

Kết quả cho thấy Core_Sw là root của các vlan như đề bài yêu cầu.
Trong bài lab này, cấu hình đến đây là spanning tree block các port đã tối ưu rồi chỉ cần cấu hình spanning port past cho các cổng đấu nối đến host nữa là đạt, tuy nhiên chúng ta nên tham khảo thêm câu 5b và 5c để biết cách tinh chỉnh để spanning block đúng cổng mà chúng ta chỉ định.

5b. AC_02 là backup root cho các Vlan 101, vlan 103; cấu hình port past cho các cổng Et1/1-2, Et0/3 của AC_02; tinh chỉnh trên AC_01 để port Po2 là port block cho vlan 101, 103



Yêu cầu này có nghĩa là nếu trên switch AC_01 bất kỳ host nào thuộc vlan 101 và vlan 103 muốn truy cập đến IP thuộc lớp mạng khác thì: (1) xuất phát từ AC_01, (2) phải đi qua switch AC_02, (3) đến Core_Sw, (4)...đến đích mong muốn.

Trong bài lab này ta phải cấu hình sao cho cổng Po2 trên switch AC_01 phải là port block.

Kiểm tra trước khi cấu hình:
AC_01#show spanning-tree vlan 101
VLAN0101
  Spanning tree enabled protocol ieee
  Root ID    Priority    4197
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32869  (priority 32768 sys-id-ext 101)
             Address     aabb.cc00.1000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr
Po2                 Root FWD 56        128.65   Shr 
AC_01#show spanning-tree vlan 103
VLAN0103
  Spanning tree enabled protocol ieee
  Root ID    Priority    4199
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32871  (priority 32768 sys-id-ext 103)
             Address     aabb.cc00.1000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr
Et1/3               Desg FWD 100       128.8    Shr
Po2                 Root FWD 56        128.65   Shr 

Trên switch AC_01 cổng Po2 hiện đang ở trạng thái forward.

AC_02#show spanning-tree vlan 101
VLAN0101
  Spanning tree enabled protocol ieee
  Root ID    Priority    4197
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32869  (priority 32768 sys-id-ext 101)
             Address     aabb.cc00.2000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Altn BLK 100       128.1    Shr
Et0/3               Desg FWD 100       128.4    Shr
Et1/0               Desg FWD 100       128.5    Shr Edge
Po3                 Root FWD 56        128.65   Shr 
AC_02#show spanning-tree vlan 103
VLAN0103
  Spanning tree enabled protocol ieee
  Root ID    Priority    4199
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32871  (priority 32768 sys-id-ext 103)
             Address     aabb.cc00.2000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Altn BLK 100       128.1    Shr
Et1/1               Desg FWD 100       128.6    Shr
Po3                 Root FWD 56        128.65   Shr 

Trên switch AC_02 cổng Et0/0 đang ở trạng thái block.
Có nhiều cách để điều chỉnh để port chuyển sang trạng thái block. Trong trường hợp này ta chọn là cách điều chỉnh cost trên cổng.

Lý giải tại sao trong vlan 101 port block trên cổng Et0/0 của switch AC_02 như sau:

  • Tổng path cost của vlan 101 tính trong phân đoạn giữa switch AC_01 và AC_02 là: cost của cổng Po + cost của Et0/0 được tính ngược từ Core_Sw tình về AC_0X
  • Tổng path cost từ AC_01 về Core_Sw thông qua AC_02: 56 (Po3 của AC_02)  + 100 (Et0/0 của AC_01) = 156  (a)
  • Tổng path cost từ AC_01 về Core_Sw chính là cost của Po2 = 56 (b)

Tổng path cost của (b) tốt hơn (a) nên Po2 trên AC_01 không bị block. Để port block là Po2 trên switch AC_01 thì ta phải tính làm sao tổng path cost của nó phải lớn hơn kết quả (a) 156  là được.

Lý thuyết spanning tree tại đây

Cấu hình:
AC_02:
spanning-tree mode rapid-pvst
spanning-tree vlan 101 priority 12288
spanning-tree vlan 103 priority 12288
!
interface range ethernet 1/1-2, ethernet 0/3
spanning-tree portfast
end
write

Cấu hình AC_02 là backup root bằng điều chỉnh priority, cũng có thể thay băng câu lệnh spanning-tree vlan <vlan id> root secondary

AC_01:
interface po2
spanning-tree vlan 101 cost 157
spanning-tree vlan 103 cost 157
end
write

Điều chỉnh cost trên trên cổng Po2 là 157 là đủ cho các vlan 101, vlan 103

Kiểm tra:
AC_01#show spanning-tree vlan 101
VLAN0101
  Spanning tree enabled protocol rstp
  Root ID    Priority    4197
             Address     aabb.cc00.4000
             Cost        156
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32869  (priority 32768 sys-id-ext 101)
             Address     aabb.cc00.1000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Po2                 Altn BLK 157          128.65   Shr 
AC_01#show spanning-tree vlan 103
VLAN0103
  Spanning tree enabled protocol rstp
  Root ID    Priority    4199
             Address     aabb.cc00.4000
             Cost        156
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32871  (priority 32768 sys-id-ext 103)
             Address     aabb.cc00.1000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et1/3               Desg FWD 100       128.8    Shr
Po2                 Altn BLK 157          128.65   Shr 
AC_02#show spanning-tree vlan 101
VLAN0101
  Spanning tree enabled protocol rstp
  Root ID    Priority    4197
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    12389  (priority 12288 sys-id-ext 101)
             Address     aabb.cc00.2000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr
Et0/3               Desg FWD 100       128.4    Shr Edge
Et1/0               Desg FWD 100       128.5    Shr Edge
Po3                 Root FWD 56        128.65   Shr 
AC_02#show spanning-tree vlan 103
VLAN0103
  Spanning tree enabled protocol rstp
  Root ID    Priority    4199
             Address     aabb.cc00.4000
             Cost        56
             Port        65 (Port-channel3)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    12391  (priority 12288 sys-id-ext 103)
             Address     aabb.cc00.2000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Desg FWD 100       128.1    Shr
Et1/1               Desg FWD 100       128.6    Shr Edge
Po3                 Root FWD 56        128.65   Shr

Cổng Po2 trên AC_01 đã block đúng yêu cầu đặt ra.

5c. AC_01 là backup root cho các Vlan 102; cấu hình port past cho các cổng Et1/1-3 của AC_01; tinh chỉnh trên AC_02 để port Po2 là port block cho vlan 102


Tương tự câu 5b với vlan 102 ta điều chỉnh cost sao cho cổng Po3 trên AC_02 phải ở trạng thái block

Cấu hình:

AC_01:
spanning-tree mode rapid-pvst
spanning-tree vlan 102 root secondary
!
interface range ethernet 01/1-3
spanning-tree portfast
end
write

AC_02:
spanning-tree mode rapid-pvst
!
interface po 3
spanning-tree vlan 102 cost 157
end
write

Kiểm tra:
AC_02#show spanning-tree vlan 102
VLAN0102
  Spanning tree enabled protocol rstp
  Root ID    Priority    4198
             Address     aabb.cc00.4000
             Cost        156
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32870  (priority 32768 sys-id-ext 102)
             Address     aabb.cc00.2000
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  300 sec
Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et1/2               Desg FWD 100       128.7    Shr Edge
Po3                 Altn BLK 157       128.65   Shr

Đã đáp ứng được yêu cầu đặt ra.

6. Cấu hình đảm bảo khi firewall chết tất PCs trong vùng LAN và vùng DMZ vẫn có thể truy cập được internet

Có nhiều cách để giải quyết vấn đề này tuy nhiên trong LAB đưa ra gợi ý:
- Đặt ip cho vlan 200
- Trỏ default route đến R1 sao cho AD có độ ưu tiên thấp hơn firewall (AD cao hơn ưu tiên thấp hơn). Nên thêm phân IP SLA kiểm tra trạng thái của firewall
- NAT overload và route tương ứng trên R1 (trong phần NAT overload nhớ loại trừ các IP mà firewall đã NAT để không ảnh hưởng đến các yêu cầu trước nếu firewall còn sống)

Kết luận:  xong lab này chúng ta làm được:
  1. Từ sơ đồ đấu nối vật lý layer 1 ban đầu vẽ lại sẽ sơ đồ layer 2 (trong yêu cầu 5 nói về spanning tree)
  2. Vẽ được sơ đồ layer 3 từ sơ đồ vật lý (trong phần yêu cầu tạo vlan gán port vào vlan, và routing)
  3. Sử dụng EtherChannel để tăng băng thông đấu nối giữa các switch, và tăng khả năng dự phòng
  4. Dùng kỹ track ip sla để kiểm tra kết nối đến IP đầu xa và kết hợp với các giao thức route để điều chỉnh bảng routing một cách tự động
  5. Kỹ thuật chỉnh đường đi của gói tin trong giao thức OSPF bằng cách điều chỉnh cost
  6. Cấu hình VTP để đồng bộ vlan xuống các switch access đảm bảo tính nhất quán thông tin vlan trong hệ thống
  7. Cấu hình DHCP relay agent.
P/s: Về phần DHCP server chúng ta có thể bổ sung thêm phần ngoại trừ 1 địa chỉ IP cố định nào đó, hay cả 1 dãy IP liên tục, cấp ip bao gồm default gateway, DNS, quy định thời gian xin cấp lại ip.... 
Ví dụ: 
Core_Sw:
ip dhcp excluded-address 192.168.104.1
ip dhcp excluded-address 192.168.104.200 192.168.104.254
!
ip dhcp pool DHCP_NgoaiTru
 network 192.168.104.0 255.255.255.0
 default-router 192.168.104.254
 dns-server 8.8.8.8 4.4.4.4
 lease 0 8 0
end
write

Cấu hình trên là cấp ip cho lớp mạng 192.168.104.0/24 không cấp ip 192.168.104.1, không cấp dãy ip từ 192.168.104.200 đến 192.168.104.254; thời gian xin cấp lại dhcp là 8 h. (lease <ngày> <giờ> <phút>)

Xong!




/*header slide*/