ACLs - Access Control Lists

IP ACCESS CONTROL LIST SECURITY


1. Một số khái niệm:
ACL (Access Control Lists) là gì: Sử dụng để điều khiển gói tin ra vào trong một đoạn mạng, lọc những gói tin không cần đến và có thể dùng để lập một chính sách bảo mật nào đó.

Chức năng của ACLs là:
+ Xác định tuyến đường thích hợp cho DDR (dial-on-demand routing)
+ Thuận tiện cho việc lọc gói tin ip
+ Cung cấp tính sẵn sàn mạng cao

Có 2 loại ACLs:
Numbered và Named
Standard và Extended

+ Standard (ACLs): Lọc (Filter) địa chỉ ip nguồn (Source) vào trong mạng – đặt gần đích (Destination).
+ Extended (ACLs): Lọc địa chỉ ip nguồn và đích của 1 gói tin (packet), giao thức tầng “Network layer header” như TCP, UDP, ICMP…, và port numbers trong tầng “Transport layer header”. Nên đặt gần nguồn (source).

Cách đặt ACLs:
Inbound ACLs – những gói tin sẽ được xử lý thông qua ACL trước khi được định tuyến ra ngoài (outbound interface). Tại đây những gói tin sẽ “dropped” nếu không trùng với bảng định tuyến (routing table), nếu gói tin (packet) được chấp nhận nó sẽ được xử lý trước khi chuyển giao (transmission).
Outbound ACLs – những gói tin sẽ được định tuyến đến outbound interface và xử lý thông qua ACLs, trước khi đưa đến ngoài hàng đợi (outbound queue).

Chú ý:
* Chỉ có thể thiết lập 1 ACL trên giao thức cho mỗi hướng trên mỗi interface. Một interface có thể có nhiều ACL.
* Router không thể lọc traffic mà bắt đầu từ chính nó.
* Câu lệnh nào đặt trước thì xử lý trước. Khi 1 câu lệnh mới thêm vào danh sách, nó sẽ đặt cuối danh sách.
* Standard ACLs: Nên đặt gần đích của traffic.
* Extended ACLs: Nên đặt gần nguồn của traffic.
* Mặc định cả hai lệnh “the Access-Group” hay “the Access-Class” theo chiều “OUT”

2. Cấu hình:
Standard – đặt gần đích:
Có 2 bước để tạo ACLs:
+ Định nghĩa danh sách ACLs để đặt vào interface.
router(config)#access-list [#] [permit deny] [source address] [wildcard mask] [log]
Đặt vào interface

router(config)#interface [interface-number]
router(config-if)#ip access-group [#] [in out] - interface access control
router(config-line)#access-class [#] [in out]- VTY access control

#: Standard ACLs sử dụng số từ 1 -> 99 hay 1300 -> 1999.

Extended ACLs – đặt gần nguồn: giống standard và thêm một số cách lọc gói tin như:
+ Source and destination IP address
+ IP protocol – TCP, UDP, ICMP, and so on
+ Port information (WWW, DNS, FTP, TELNET, etc)

router(config)#access-list [#] [permit deny] [protocol] [source address] [wildcard mask] [operator source port] [destination address] [wildcard mask] [operator destination port] [log]
router(config)#interface [interface-number]
router(config-if)#ip access-group [#] [in out] - interface access control
#: Extanded ACLs sử dụng số từ 100 -> 199 hay 2000 -> 2699.

IP protocol: icmp tcp udp igrp
Operators: port tcp or udp của một ứng dụng nào đó. Sử dụng các kí hiệu so sánh (lt, gt, neq, eq, range) để gán port.

Một số port thông dụng:
-----------------------------------------------------------
Port Number ------TCP port names ----UDP port names
-----------------------------------------------------------
6 ---------------------TCP
17
21-------------------- FTP
23 --------------------TELNET
25 --------------------SMTP
53-------------------------------------------- DNS
69 --------------------------------------------TFTP
80 --------------------WWW
161 -------------------------------------------SNMP
520 -------------------------------------------RIP


3. Named ACLs
Cú pháp vào standard hay extanded ACLs
router(config)#access-list standard extended ACL_name

Cú pháp cấu hình Standard hay Extanded ACLs
router(config-std-acl)#permit deny {source address} {wildcard mask}
router(config-ext-acl)#PERMIT DENY {protocol} {source address and wildcard mask} {operator source_port} {destination address and wildcard mask} {operator destination_port} {LOG}

Cú pháp activate ACLs
router(config)#interface type [modules_#] port_#
router(config-if)#ip access-group {ACL_name} in out

4. Quản lý các ACLs

Hiển thị tất cả ACLs đang sử dụng. Router(config)#show running-config
Xem ACLs hoạt động trên interface nào đó. Router(config)#show interface [ # ]
Xem việc đặt và hướng đi của ip ACLs: Router(config)#show ip interfaces [ # ]
Xem những câu lệnh ACLs: Router(config)#show access-list [ # ]
Hiển thị tất cả ip ACLs: Router#show ip access-list
Hiển thị ip ACL 100: Router#show ip access-list 100
Xóa bộ đếm (to clear the counters use):
Router(config)#show access-list [ # ]
Router(config)#clear access-list counter [ # ]

Deleting ACLs
router(config)#interface [interface-number]
router(config-if)#no access-list [#] [permit deny] [source address] [wildcard mask]



vidu:

Standard ACLs: cấm prevent 192.168.3.1 truy cập 10.0.0.1 đặt ACLs trên Router A : E0 : Outbound.
RouterA(config)#access-list 1 deny 192.168.3.1 0.0.0.0
RouterA(config)#access-list 1 permit any any
RouterA(config)#interface e0
RouterA(config-if)#ip access-group 1 out

Extended ACLs: ngăn 192.168.3.1 truy cập web tại 10.0.0.1 đặt ACLs trên Router C : E1 : Inbound.
RouterC(config)#access-list 100 deny TCP host 192.168.3.1 host 10.0.0.1 eq www
RouterC(config)#access-list 100 permit TCP any any
RouterC(config)#interface e1
RouterC(config-if)#ip access-group 100 in
..............

Share this

Related Posts

Previous
Next Post »