• 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.

Khống chế lưu lượng đi qua control plane

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

  • Khống chế lưu lượng đi qua control plane

    Nguyễn Trường Sơn


    KHỐNG CHẾ LƯU LƯỢNG ĐI QUA CONTROL PLANE

    Yêu cầu:

    Trong bài lab này sẽ tiến hành cấu hình router bảo vệ phần điều khiển tránh việc nhận quá nhiều thông tin UDP từ các thiết bị PC.

    Sơ đồ:



    Thực hiện
    Cấu hình ban đầu của hệ thống
    R1:
    R1#sh run
    Building configuration...

    Current configuration : 1149 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    !
    !
    ip cef
    no ip dhcp use vrf connected
    !
    ip dhcp pool 10
    network 10.10.20.0 255.255.255.0
    default-router 10.10.20.1
    dns-server 203.162.4.1 203.162.4.190 203.162.4.191
    !
    interface FastEthernet0/0
    ip address 10.10.10.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    ip address 10.10.20.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    ip address 192.1.1.1 255.255.255.0
    clock rate 2000000
    !
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 192.1.1.2
    !
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    scheduler allocate 20000 1000
    !
    end

    R1#

    R2:
    R2#sh run
    Building configuration...

    Current configuration : 1178 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    memory-size iomem 15
    !
    !
    ip cef
    !
    !
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    interface FastEthernet0/0
    ip address 20.20.20.1 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    ip address dhcp
    ip nat outside
    ip virtual-reassembly
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    ip address 192.1.1.2 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    !
    interface Serial0/3/0
    no ip address
    shutdown
    clock rate 2000000
    !
    ip route 10.10.0.0 255.255.0.0 192.1.1.1
    !
    !
    ip http server
    no ip http secure-server
    ip nat inside source list 1 interface FastEthernet0/1 overload
    !
    access-list 1 permit 10.10.0.0 0.0.255.255
    !
    control-plane
    !
    !
    line con 0
    exec-timeout 0 0
    privilege level 15
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    logging synchronous
    no login
    !
    scheduler allocate 20000 1000
    !
    end


    Bước 1: Cấu hình router R1 và R2 chạy giao thức định tuyến multicast PIM-Dense mode

    Trên R1 và R2, bật tính năng định tuyến gói tin Multicast:
    R1(config)#ip multicast-routing
    R2(config)#ip multicast-routing

    Bật giao thức PIM-DENSE MODE trên các cổng giao tiếp tương ứng
    R1(config)#
    R1(config)#interface FastEthernet0/1
    R1(config-if)#ip pim dense-mode

    R1(config)#interface Serial0/1/0
    R1(config-if)#ip pim dense-mode

    R2(config)#interface Serial0/1/0
    R2(config-if)# ip pim dense-mode

    R2(config)#interface FastEthernet0/0
    R2(config-if)#ip pim dense-mode
    R2(config-if)#ip igmp join-group 224.1.1.100 << cho cổng này của R2 tham gia vào group 224.1.1.100


    Bước 2: Do trong trường hợp cho R2 nhận gói tin multicast từ subnet 10.10.20.0/24 chỉ có mục đích kiểm tra đường đi thông của lưu lượng multicast nên R2 sẽ được cấu hình chỉ chấp nhận gói tin UDP gửi đến phần điều khiển (control-plane) ở mức độ là 8 kbps, nếu vượt quá sẽ bị loại bỏ. Việc này nhằm tránh CPU của router xử lý quá nhiều dẫn đến hiện tượng DoS.

    R2(config)#access-list 102 remark *** udp ***
    R2(config)#access-list 102 permit udp 10.10.20.0 0.0.0.255 any

    R2(config)#class-map match-all udp
    R2(config-cmap)# match access-group 102
    R2(config-cmap)#exit

    R2(config)#policy-map udp
    R2(config-pmap)# class udp
    R2(config-pmap-c)# police 8000 conform-action transmit exceed-action drop

    Áp dụng cấu hình policy-map lên phần điều khiển (control-plane) của R2:
    R2(config)#control-plane
    R2(config-cp)#service-policy input udp

    Kiểm tra cấu hình

    R2#sh policy-map
    Policy Map udp
    Class udp
    police cir 8000 bc 1500
    conform-action transmit
    exceed-action drop


    Bước 3:Cấu hình cho PC trở thành source phát gói tin Multicast

    Chương trình wmulticast là chương trình có khả năng gửi hoặc nhận gói tin Multicast, bài lab này dùng chương trình Wsend để gửi gói tin



    Chạy chương trình Wsend.exe
    Chọn session > New Multicast


    Nhập các thông tin tương ứng


    Chọn Save


    Bắt đầu khởi tạo lưu lượng multicast từ PC đến địa chỉ 224.1.1.100

    Bước 4: kiểm tra thông tin trên R2

    Trước khi gửi gói tin multicast

    R2#sh policy-map control-plane
    Control Plane

    Service-policy input: udp

    Class-map: udp (match-all)
    0 packets, 0 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: access-group 102
    police:
    cir 8000 bps, bc 1500 bytes
    conformed 0 packets, 0 bytes; actions:
    transmit
    exceeded 0 packets, 0 bytes; actions:
    drop
    conformed 0 bps, exceed 0 bps

    Class-map: class-default (match-any)
    1 packets, 24 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: any
    R2#

    Sau khi gửi gói tin Multicast

    R2#sh policy-map control-plane
    Control Plane

    Service-policy input: udp

    Class-map: udp (match-all)
    382 packets, 110016 bytes
    5 minute offered rate 8000 bps, drop rate 8000 bps
    Match: access-group 102
    police:
    cir 8000 bps, bc 1500 bytes
    conformed 171 packets, 49248 bytes; actions:
    transmit << sốlượng gói tin tương thích
    exceeded 211 packets, 60768 bytes; actions:
    drop << số lượng gói tin vượt ngưỡng 8 kbps
    conformed 8000 bps, exceed 10000 bps

    Class-map: class-default (match-any)
    16 packets, 1108 bytes
    5 minute offered rate 0 bps, drop rate 0 bps
    Match: any
    R2#

    Như vậy R2 chỉ nhận gói tin multicast đến từ PC ở mức là 8 kbps, nếu vượt ngưỡng này gói tin sẽ bị loại bỏ

    Cấu hình cuối cùng
    R1:
    R1#sh run
    Building configuration...

    Current configuration : 1698 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    dot11 syslog
    !
    !
    ip cef
    no ip dhcp use vrf connected
    ip dhcp excluded-address 10.10.20.254
    ip dhcp excluded-address 10.10.20.1
    !
    ip dhcp pool 10
    network 10.10.20.0 255.255.255.0
    default-router 10.10.20.1
    dns-server 203.162.4.1 203.162.4.190 203.162.4.191
    !
    ip multicast-routing
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    interface FastEthernet0/0
    ip address 10.10.10.1 255.255.255.0
    ip pim dense-mode
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    ip address 10.10.20.1 255.255.255.0
    ip pim dense-mode
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    ip address 192.1.1.1 255.255.255.0
    ip pim dense-mode
    clock rate 2000000
    !
    ip forward-protocol nd
    ip route 0.0.0.0 0.0.0.0 192.1.1.2
    !
    !
    ip http server
    no ip http secure-server
    !
    control-plane
    !
    line con 0
    exec-timeout 0 0
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    scheduler allocate 20000 1000
    !
    end

    R1#

    R2:
    R2#sh run
    Building configuration...

    Current configuration : 2082 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    memory-size iomem 15
    !
    !
    ip cef
    !
    !
    ip multicast-routing
    !
    multilink bundle-name authenticated
    !
    !
    voice-card 0
    no dspfarm
    !
    class-map match-all udp
    match access-group 102
    !
    policy-map udp
    class udp
    police cir 8000
    conform-action transmit
    exceed-action drop
    !
    !
    interface FastEthernet0/0
    ip address 20.20.20.1 255.255.255.0
    ip pim dense-mode
    ip nat inside
    ip virtual-reassembly
    ip igmp join-group 224.1.1.100
    duplex auto
    speed auto
    no keepalive
    !
    interface FastEthernet0/1
    ip address dhcp
    ip nat outside
    ip virtual-reassembly
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    ip address 192.1.1.2 255.255.255.0
    ip pim dense-mode
    ip nat inside
    ip virtual-reassembly
    !
    interface Serial0/3/0
    no ip address
    shutdown
    clock rate 2000000
    !
    ip route 10.10.0.0 255.255.0.0 192.1.1.1
    !
    !
    ip http server
    no ip http secure-server
    ip nat inside source list 1 interface FastEthernet0/1 overload
    !
    access-list 102 remark *** udp ***
    access-list 102 permit udp 10.10.20.0 0.0.0.255 any
    !
    control-plane
    !
    service-policy input udp
    !
    line con 0
    exec-timeout 0 0
    privilege level 15
    password cisco
    logging synchronous
    line aux 0
    line vty 0 4
    privilege level 15
    password vnpro
    logging synchronous
    no login
    !
    scheduler allocate 20000 1000
    !
    end
    Last edited by phamminhtuan; 07-04-2011, 12:55 AM.
    Phạm Minh Tuấn

    Email : phamminhtuan@vnpro.org
    Yahoo : phamminhtuan_vnpro
    -----------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- 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

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog

  • #2
    hixhix hình ảnh jì nó đi về nơi xa ấy hết rùi a Tuấn ui
    nếu đc a UP lại dùm bà con nhé :x

    Comment


    • #3
      Đã úp lại giúp bà con rồi đó :D
      Phạm Minh Tuấn

      Email : phamminhtuan@vnpro.org
      Yahoo : phamminhtuan_vnpro
      -----------------------------------------------------------------------------------------------
      Trung Tâm Tin Học VnPro
      149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
      Tel : (08) 35124257 (5 lines)
      Fax: (08) 35124314

      Home page: http://www.vnpro.vn
      Support Forum: http://www.vnpro.org
      - 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

      Network channel: http://www.dancisco.com
      Blog: http://www.vnpro.org/blog

      Comment

      • Working...
        X