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.

[PIX/ASA MASTER] Cấu hình tracking trên ASA

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

  • [PIX/ASA MASTER] Cấu hình tracking trên ASA

    Chào các bạn,
    Bài LAB dưới đây hi vọng sẽ làm bạn bất ngờ vì không ngờ rằng trên ASA lại có thể cấu hình tracking.
    Đầu tiên, yêu cầu của chúng ta là cần phải có IOS của ASA là 8.0(3) trở lên.
    Static Route Tracking trên ASA
    Mô hình mạng :



    Bước 1 : Chúng ta thiết lập trên những interfaces như sau :

    Code:
    interface GigabitEthernet0/0
    nameif outside
    security-level 0
    ip address 192.168.6.2 255.255.255.0
    !
    interface GigabitEthernet0/1
    nameif inside
    security-level 100
    ip address 10.0.6.1 255.255.255.0
    !
    interface GigabitEthernet0/2
    nameif backup
    security-level 0
    ip address 192.168.5.25 255.255.255.0
    !
    Bước 2 : cấu hình NAT:

    Code:
    ciscoasa(config)# sh run nat
    nat (inside) 1 0.0.0.0 0.0.0.0
    ciscoasa(config)# sh run global
    global (outside) 1 interface
    global (backup) 1 interface
    ciscoasa(config)#
    Bước 3 : cấu hình static route tracking
    Code:
    sla monitor 1
    type echo protocol ipIcmpEcho 192.168.6.1 interface outside
    timeout 1000
    frequency 3
    sla monitor schedule 1 life forever start-time now
    Bước 4 : Định nghĩa ra một static route để track và một route đóng vai trò backup

    Code:
    route outside 0.0.0.0 0.0.0.0 192.168.6.1 1 track 1
    route backup 0.0.0.0 0.0.0.0 192.168.5.1 5
    Bước 5 : Kiểm tra cấu hình :
    Code:
    [COLOR=Red][B]ciscoasa(config)# sh sla monitor configuration[/B][/COLOR]
    SA Agent, Infrastructure Engine-II
    Entry number: 1
    Owner:
    Tag:
    Type of operation to perform: echo
    Target address: 192.168.6.1
    Interface: outside
    Number of packets: 1
    Request size (ARR data portion): 28
    Operation timeout (milliseconds): 1000
    Type Of Service parameters: 0x0
    Verify data: No
    Operation frequency (seconds): 3
    Next Scheduled Start Time: Start Time already passed
    Group Scheduled : FALSE
    Life (seconds): Forever
    Entry Ageout (seconds): never
    Recurring (Starting Everyday): FALSE
    Status of entry (SNMP RowStatus): Active
    Enhanced History:
    Tôi tiếp tục kiểm tra SLA và nó đang có trạng thái là OK:
    Code:
    [B][COLOR=Green]ciscoasa(config)# sh sla monitor operational-state[/COLOR][/B]
    Entry number: 1
    Modification time: 04:02:36.312 UTC Fri Oct 24 2008
    Number of Octets Used by this Entry: 1480
    Number of operations attempted: 352
    Number of operations skipped: 0
    Current seconds left in Life: Forever
    Operational state of entry: Active
    Last time this entry was reset: Never
    Connection loss occurred: FALSE
    Timeout occurred: FALSE
    Over thresholds occurred: FALSE
    Latest RTT (milliseconds): 1
    Latest operation start time: 04:20:09.312 UTC Fri Oct 24 2008
    Latest operation return code: [U][SIZE=4][COLOR=Red][B]OK[/B][/COLOR][/SIZE][/U]
    RTT Values:
    RTTAvg: 1    RTTMin: 1    RTTMax: 1
    NumOfRTT: 1    RTTSum: 1    RTTSum2: 1
    Tiếp theo , tôi sẽ kiểm tra bảng định tuyến để đảm bảo rằng , những cấu hình ở trên đã đưa ra một default route đúng đắng.

    Code:
    ciscoasa(config)# sh route
    
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
    i - IS-IS, 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 192.168.6.1 to network 0.0.0.0
    
    C    127.0.0.0 255.255.0.0 is directly connected, cplane
    C    192.168.5.0 255.255.255.0 is directly connected, backup
    C    10.0.6.0 255.255.255.0 is directly connected, inside
    C    192.168.6.0 255.255.255.0 is directly connected, outside
    [I][U][B][COLOR=Red]S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.6.1, outside[/COLOR][/B][/U][/I]
    ciscoasa(config)#
    Và cuối cùng , tôi tiễn gateway ra đi . Sau đó , tôi kiểm tra trạng thái một lần nữa.

    Code:
    ciscoasa(config)# sh sla monitor operational-state
    Entry number: 1
    Modification time: 04:02:36.321 UTC Fri Oct 24 2008
    Number of Octets Used by this Entry: 1480
    Number of operations attempted: 375
    Number of operations skipped: 0
    Current seconds left in Life: Forever
    Operational state of entry: Active
    Last time this entry was reset: Never
    Connection loss occurred: FALSE
    Timeout occurred: TRUE
    Over thresholds occurred: FALSE
    Latest RTT (milliseconds): NoConnection/Busy/Timeout
    Latest operation start time: 04:21:18.311 UTC Fri Oct 24 2008
    Latest operation return code: [SIZE=5][U][B][COLOR=Red]Timeout[/COLOR][/B][/U][/SIZE]
    RTT Values:
    RTTAvg: 0    RTTMin: 0    RTTMax: 0
    NumOfRTT: 0    RTTSum: 0    RTTSum2: 0
    Sau đó tôi tiếp tục xem bảng định tuyến xem có gì chuyển biến không :
    Code:
    ciscoasa(config)# sh route
    
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
    i - IS-IS, 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 192.168.5.1 to network 0.0.0.0
    
    C    127.0.0.0 255.255.0.0 is directly connected, cplane
    C    192.168.5.0 255.255.255.0 is directly connected, backup
    C    10.0.6.0 255.255.255.0 is directly connected, inside
    C    192.168.6.0 255.255.255.0 is directly connected, outside
    [U][COLOR=Red][B][SIZE=5]S*   0.0.0.0 0.0.0.0 [5/0] via 192.168.5.1, backup[/SIZE][/B][/COLOR][/U]
    ciscoasa(config)#
    Và để chắc ăn, tôi cho gateway ban đầu sống lại. Và kết quả đã như tôi mong đợi :

    Code:
    ciscoasa(config)# sh route
    
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
    i - IS-IS, 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 192.168.6.1 to network 0.0.0.0
    
    C    127.0.0.0 255.255.0.0 is directly connected, cplane
    C    192.168.5.0 255.255.255.0 is directly connected, backup
    C    10.0.6.0 255.255.255.0 is directly connected, inside
    C    192.168.6.0 255.255.255.0 is directly connected, outside
    [U][I][SIZE=4][COLOR=Blue][B]S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.6.1, outside[/B][/COLOR][/SIZE][/I][/U]
    ciscoasa(config)#
    Hi vọng rằng, Bài LAB trên sẽ giúp các bạn ít nhiều khi triển khai tại công ty mình.
    Mọi phản hồi vui lòng gời đến ccsp.master.guide@gmail.com
    Xin vui lòng ghi rõ nguồn gốc khi trích đăng ở những forum khác.

    Chúc các bạn luôn vui vẻ.
    Trần Mỹ Phúc
    tranmyphuc@hotmail.com
    Hãy add nick để có thông tin đề thi mới nhất :tranmyphuc (Hỗ trợ tối đa cho các bạn tự học)

    Cisco Certs : CCNP (Passed TSHOOT 1000/1000)

    Juniper Certs :
    JNCIP-ENT & JNCIP-SEC
    INSTRUCTORS (No Fee) : CISCO (Professional) , JUNIPER (Professional) , Microsoft ...

    [version 4.0] Ôn tập CCNA



  • #2
    Chao bac Phuc,
    Noi dung bai viet tren rat hay va em dang tien hanh ap dung cho con ASA cua cong ty em.
    Tuy nhien, em co mot chut thac mac. lam the nao de co the add Global cho cac interfaces outside va backup voi cung mot nat id nhu tren?
    ciscoasa(config)# sh run nat
    nat (inside) 1 0.0.0.0 0.0.0.0
    ciscoasa(config)# sh run global
    global (outside) 1 interface
    global (backup) 1 interface
    ciscoasa(config)#Em đã tiến hành cấu hình thử nhưng không tai nao add duoc global cho interfaces giong nhu tren.
    Nhung khi em add Global (backup) 1 interface thì thiết bị thông báo
    global for this range already exists
    (trước đó em đã add global (outside) 1 interface thành công)

    Rat mong duoc su huong dan cua bac.
    Xin chan thanh cam on.

    Comment


    • #3
      Bạn nối cổng backup vào Switch hoặc Router,sau đó cấu hình bình thường,
      Hugo

      Comment


      • #4
        Em da noi cong backup vao Router(1841).
        Cung da kiem tra Version IOS cua ASA :
        --------------------------------------------------------------------
        ASA5510#sh ver
        Cisco Adaptive Security Appliance Software Version 8.0(3)6
        Device Manager Version 6.0(3)
        Compiled on Thu 17-Jan-08 17:42 by builders
        System image file is "disk0:/asa803-6-k8.bin"
        Config file at boot was "startup-config"
        ASA5510 up 279 days 22 hours
        Hardware: ASA5510, 202 MB RAM, CPU Pentium 4 Celeron 1600 MHz
        Internal ATA Compact Flash, 256MB
        BIOS Flash M50FW080 @ 0xffe00000, 1024KB
        ................
        ----------------------------------------------------------------------
        Truoc day em da cau hinh :
        nat (dmz) 1 10.5.0.0 255.255.0.0
        global (outside) 1 interface
        Nhung khi em tien hanh add global cho backup interface thi xay ra tinh trang sau:
        ASA5510(config)# global (backup) 1 interface
        global for this range already exists

        Em cung dang trong qua trinh tim hieu cau hinh route tracking, mong cac bac vui long huong dan a.

        Comment


        • #5
          Bạn cấu hình theo hướng dẩn của bạn Phúc là bình thường,mổ tả thiết bị,sơ đồ đối nối dây và post cấu hình chi tiết từng con lên xem thử,
          Hugo

          Comment


          • #6
            Xin chao cac bac,
            Sau day la so do ket noi :
            Click image for larger version

Name:	1.JPG
Views:	2
Size:	26.6 KB
ID:	205339
            Cau hinh thiet bi:
            --------------------------------------------------------------
            interface Ethernet0/0
            nameif dmz
            security-level 50
            ip address 10.x.x.x 255.255.255.252
            !
            interface Ethernet0/1
            nameif inside
            security-level 100
            ip address 10.x.x.x 255.255.255.252
            !
            interface Ethernet0/2 (ADSL line được thêm vào để tạo đường backup)
            nameif backup
            security-level 0
            ip address 192.168.1.3 255.255.255.0
            !
            interface Ethernet0/3 (Internet leased line đang sử dụng)
            nameif outside
            security-level 0
            ip address 220.x.x.x 255.255.255.x

            Nat :
            nat (dmz) 1 10.0.0.0 255.0.0.0

            Apply cho outside interface:
            global (outside) 1 interface

            Với default route :
            route outside 0.0.0.0 0.0.0.0 220.x.x.x 2
            -------------------------------------------------------------------
            Sau khi em tien hanh noi Modem ADSL vao cong backup va cau hinh route tracking cho ASA như hướng dẫn của bác Phúc.
            Hiện tại Route tracking trên thiết bị đã hoạt động(khi em shutdown cổng outside thì backup route sẽ active và default route sẽ đi ra ngòai theo đường backup)
            Vấn đề ở đây là việc áp Global cho backup interface với nat-id = 1(trùng với outside interface) như hướng dẫn của bác Phúc.
            Em cũng đã tìm hiểu tài liệu hướng dẫn từ phía cisco, thấy hướng dẫn đúng như bác Phúc đã hướng dẫn.
            NHưng khi em tiến hành add câu lệnh:
            Global (backup) 1 interface
            thì hệ thống thông báo :
            global for this range already exists

            Em không tài nào add được global cho 2 interfaces với cùng 1 nat id:
            global (outside) 1 interface
            global (backup) 1 interface

            Rất mong nhận được ý kiến của các bác.

            Comment


            • #7
              Mình hổng thấy được sơ đồ của tranmyphuc bạn nào có cho mình xin được không ạ!
              Ký rồi

              Comment

              Working...
              X