Tải bản đầy đủ (.pptx) (86 trang)

Nguyên lý cơ bản ACL

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.37 MB, 86 trang )

© 2008 Cisco Systems, Inc. All rights reserved. Cisco ConfidentialPresentation_ID
1
ACL
Quản trị mạng cơ bản
© 2008 Cisco Systems, Inc. All rights reserved. Cisco ConfidentialPresentation_ID
2
Nguyên lý cơ bản
ACL
Quản trị mạng cơ bản
Presentation_ID
3
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Tổng quan

Quản trị viên cần ngăn chặn những truy cập không mong muốn trong
khi vẫn duy trì được các luồng lưu lượng cần thiết

Những chương trình bảo mật như password, thiết bị callback…vẫn có
những thiếu hụt trong việc quản lý mềm dẻo, lọc lưu lượng

Ví dụ như quản trị viên cho phép user truy cập internet, nhưng không
cho các user bên ngoài telnet vào hệ thống mạng bên trong

Router cung cấp thiết bị lọc lưu lượng với khả năng mở rộng, mềm dẻo
cao, đó là access control lists (ACLs).

ACL là một danh sách điều khiển truy cập cho phép quản trị viên có thể
thiết lập các quy tắc truy cập mạng

Bài học này sẽ giới thiệu với các anh chị về khái niêm ACL, các loại


ACL như standard và extended.
Presentation_ID
4
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Tổng quan

Ngoài ra, bài này còn đưa ra:
Các phương pháp, lời khuyên và hướng
dẫn chi tiết cho việc sử dụng ACL
Cấu hình cần thiết để tạo ACL
Ví dụ về standard và extended ACL
Áp dụng ACL như thế nào trên router?
Presentation_ID
5
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
What are ACLs?

Note: bắt đầu bài này sẽ có nhiều khái niệm, các khái niệm này sẽ
được mô tả rõ hơn trong phần sau của bài (cấu hình).

ACL là một tập hợp tuần tự các câu lệnh hay bộ lọc

Mỗi bộ lọc có 2 hành động chính sau:
Deny (từ chối)
Permit (cho phép)

Việc chấp nhận hay từ chối sẽ dựa vào tình huống cụ thể.


ACL sẽ được áp dụng trên interface hoặc line của router
Presentation_ID
6
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
What are ACLs?

Router kiểm tra mỗi gói tin, xác định xem cần phải chuyển
hay hủy gói tin đó dựa trên điều kiện của ACL

Điều kiện có thể xây dựng trên:
IP nguồn
IP đích
UDP or TCP protocols
upper-layer (TCP/UDP) port
Presentation_ID
7
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
What are ACLs?

ACLs cần được xác định:
per-protocol (IP, IPX, AppleTalk)
per direction (in or out)
per port (interface) basis.

ACL điều khiển lưu lượng theo 1 hướng trên router

Các ACL khác nhau cần phải tạo cho các hướng khác nhau: 1 cho in, 1
cho out


Mỗi interface có thể sử dụng nhiều giao thức và hướng khác nhau
Presentation_ID
8
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
ACL làm việc thế nào

ACL là một tập hợp các bộ lọc (statement), mỗi bộ lọc sẽ xác định gói
tin được chấp nhận hay bị từ chối

Mỗi bộ lọc ACL sẽ có 1 số thứ tự

Khi một bộ lọc khớp với gói tin, gói tin dó sẽ kiểm tra xem là cho phép
hay từ chối. Khi đã khớp với một bộ lọc, router sẽ không so khớp gói tin
với các bộ lọc tiếp theo

Mỗi ACL sẽ có một bộ lọc ẩn ở cuối ACL, bộ lọc này sẽ từ chối toàn bộ
các gói tin. Điều này đồng nghĩa với việc, nếu gói tin không khớp với bộ
lọc nào của ACL, nó sẽ bị xóa
Presentation_ID
9
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
ACL làm việc như thế nào?

ACL statement (bộ lọc) hoạt động theo thứ tự logic.

Theo hướng top down


Nếu một gói tin khới với điều kiện, gói tin sẽ được
cho phép đi qua hoặc từ chối

Chỉ có thể sử dụng 1 ACL cho 1 giao thức trên một
interface theo một hướng nhất định

Có một bộ lọc ẩn deny any ở cuối các ACL

ACP không block các gói tin xuất phát từ chính
router đó
Presentation_ID
10
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Hai loại ACL

Standard IP ACLs
Chỉ lọc được theo địa chỉ IP nguồn

Extended IP ACLs
Có thể lọc theo:
IP nguồn
IP đích
Giao thức (TCP, UDP, ICMP…)
Port
Presentation_ID
11
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Tạo Standard ACL – 2 bước

Presentation_ID
12
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Tạo Standard ACL – 2 bước
(Standard IP)
Presentation_ID
13
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ

Yêu cầu:
Chỉ Cho phép host 172.16.30.2 ra ngoài mạng Sales
Các host còn lại không được ra khỏi mạng Sales
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2

.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Presentation_ID
14
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
RouterB(config)#access-list 10 permit 172.16.30.2
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2

.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Bước 1: bộ lọc ẩn “deny any” được tạo ra ở cuối ACL
(Standard IP)
Test Condition
Presentation_ID
15
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
Applying ACLs

Bạn có thể tạo ACL mà không sử dụng nó.

ACL chỉ có hiệu lực khi nó được gắn lên interface mà thôi.

Một trong những kinh nghiệm hay là đối với standard ACL, bạn nên gắn nó càng gần
đích càng tốt (later)
Xác định: In, Out, Source, and Destination

Out – khớp với những lưu lượng đã qua quá trình định tuyến

In – lưu lượng mới đến router, chưa qua quá trình định tuyến.
172.16.10.2/24
172.16.10.3/24

172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Presentation_ID
16
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
RouterB(config)#access-list 10 permit 172.16.30.2
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface e 0
RouterB(config-if)# ip access-group 10 in

172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Step 2 – Apply to an interface(s)
Presentation_ID
17
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
RouterB(config)#access-list 10 permit 172.16.30.2
Implicit “deny any” -do not need to add this, discussed later

RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface s 0
RouterB(config-if)# ip access-group 10 out
RouterB(config)# interface s 1
RouterB(config-if)# ip access-group 10 out
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Step 2 – Or the outgoing interfaces… Which is preferable and why?
Presentation_ID
18

© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
RouterB(config)#access-list 10 permit 172.16.30.2
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface s 0
RouterB(config-if)# ip access-group 10 out
RouterB(config)# interface s 1
RouterB(config-if)# ip access-group 10 out
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC

Administration
Sales Engineering
Vì có một bộ lọc ẩn “deny any” cũng sẽ ảnh Hưởng luồng dữ liệu từ
Admininistration tới Engineering
Presentation_ID
19
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ
RouterB(config)#access-list 10 permit 172.16.30.2
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface e 0
RouterB(config-if)# ip access-group 10 in
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2

s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Presentation_ID
20
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ 2

Yêu cầu:
Chỉ cho phép các host 172.16.30.2, 172.16.30.3, 172.16.30.4,
172.16.30.5 đi ra khỏi được mạng Sales
Từ chối toàn bộ các host khác ra khỏi mạng Sales
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1

.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Presentation_ID
21
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ 2
RouterB(config)#access-list 10 permit 172.16.30.2
RouterB(config)#access-list 10 permit 172.16.30.3
RouterB(config)#access-list 10 permit 172.16.30.4
RouterB(config)#access-list 10 permit 172.16.30.5
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface e 0
RouterB(config-if)# ip access-group 10 in
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0

e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Vì ACL đã có sẵn bộ lọc ẩn “deny any”, vì vậy nó có thể đáp ứng được yêu cầu đề
bài
Presentation_ID
22
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ 2
RouterB(config)#no access-list 10
RouterB(config)# interface e 0
RouterB(config-if)# no ip access-group 10 in
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24

172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Để xóa ACL, thực hiện như sau:
Presentation_ID
23
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ 3

Yêu cầu:
Chỉ từ chối host 172.16.30.2 đi từ Sales ra ngoài,
Cho phép toàn bộ các host còn lại

Từ khóa “any” ám chỉ toàn bộ các địa chỉ IP
172.16.10.2/24
172.16.10.3/24
172.16.30.2/24

172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Presentation_ID
24
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Ví dụ 3
RouterB(config)#access-list 10 deny 172.16.30.2
RouterB(config)#access-list 10 permit any
Implicit “deny any” -do not need to add this, discussed later
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface e 0
RouterB(config-if)# ip access-group 10 in

172.16.10.2/24
172.16.10.3/24
172.16.30.2/24
172.16.30.3/24
172.16.50.2/24
172.16.50.3/24
172.16.20.0/24
172.16.40.0/24
e0 e0
e0
.1
.1
.1
.1 .1
.2
.2
s0 s0
s1 s0
RouterA RouterB
RouterC
Administration
Sales Engineering
Chú ý: vì mặc định có statement ẩn “deny any” ở cuối mỗi ACL, nên bạn phải thêm
statement “ Access-list 10 permit any” để đảm bảo yêu cầu đề bài
Presentation_ID
25
© 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential
BKACAD
Chú ý với IN access-list


Khi access list áp dụng theo chiều IN trên interface, các gói tin sẽ được
check trước khi tham gia quá trình định tuyến

OUT ACL sẽ hoạt động, check sau khi gói tin được định tuyến bởi
router

Khi gói tin bị từ chối bới ACL, router sẽ gửi bản tin ICMP “Destination
unreachable”, với giá trị code là “Administratively Prohibited” tới nguồn
gói tin
RouterB(config)#access-list 10 deny 172.16.30.2
RouterB(config)#access-list 10 permit any
Implicit “deny any” (do not need to add this, discussed later):
RouterB(config)#access-list 10 deny 0.0.0.0 255.255.255.255
RouterB(config)# interface e 0
RouterB(config-if)# ip access-group 10 in

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×