What is EQ in access list?

Hướng dẫn cấu hình Access-list [ACLs] trên thiết bị Cisco

Hướng dẫn nằm trong tutorial các bài hướng dẫn cấu hình thiết bị chuyển mạch switch cisco mà chúng tôi gửi tới khách hàng. Hướng dẫn cấu hình Access-list dành cho dân kỹ thuật hoặc người quản trị hệ thống mạng, chúc các bạn thành công.

Đầu tiên, có thể hiểu Access-list là một danh sách các câu lệnh được áp dụng vào các cổng interface của router hay switch cisco. Danh sách này giúp chỉ cho chúng ta thấy router hay switch sẽ biết được loại packet nào được chấp nhận hay loại bỏ. Việc chấp nhân hay loại bỏ có thể dựa vào các yếu tố như: địa chỉ nguồn, địa chỉ đích hoặc chỉ số cổng [port].

What does permit IP any any mean?

Yup – a permit IP any any statement will allow all IP traffic to flow across the interface. Keep in mind that there is an implicit deny ip any any at the end of any access list, so a permit statement tells the router what to allow across the interface and denies all other IP traffic.

[ASA Firewall] ACL căn bản


1. Topology

2. So sánh giữaIOSACL và ASA ACL

2.1.1. Chỉpacketđầu tiên trongflow[tạm dịch: dòng dữ liệu] là đối tượng bị ASA ACL kiểm tra. Sau khiconnectionhình thành, cácpacketthuộc kết nối đó sẽ không bị đánh giá.

2.1.2. Với IOS ACL, tất cảpacketđều là đối tượng bị kiểm tra.

2.2. ASA ACL thay thếwildcard maskbằngsubnet mask.

3. Các kiểu ACL

4. Cấu hình lọcpacket

ASA ACL có thể dùng để lọcpackettruyền qua ASA hoặc gửi trực tiếp đến ASA.

4.1.Through-the-Box-Traffic Filtering: lọctraffictruyền qua ASA, từinterfacenày đếninterfacekhác. ACL sẽ áp dụng vàointerface.

4.2.To-the-Box-Traffic Filtering: còn gọi làmanagement access rule,lọctrafficgửi trực tiếp đếncontrol plane[tạm dịch: mặt phẳng/mức điều khiển] của ASA.

Note: ACL không tác động đến traffic do chính ASA tạo ra.

5. Luật điều khiển truy nhập mặc định [Default Access Rules]

5.1.Trong hình trên, các bạn thấy có các ACL như sau:

– Tạiportdmz, inside, management: luật ngầm định đối vớiincomingtraffic[implicit incoming rule]làPermit.

– Tạiportoutside: không cóimplicit incoming rule

–Global ACL:luật ngầm định làDenyđối vớiincoming/outcomingtrên tất cả cácinterface

Vì các ACL này chỉ có phát biểu ngầm định [implicit rule]nên khi kiểm tra cấu hình bằng CLI sẽ không thấy gì.

ciscoasa# show running-config access-list

!

ciscoasa# show access-list
access-list cached ACL log flows: total 0, denied 0 [deny-flow-max 4096]
alert-interval 300

5.2.Global ACL

Global ACLcó từOS version8.3.Trafficđi vàoportbất kỳ của ASA nếu không so khớp với ACL cấu hình tại cổng đó [ kể cảimplicit rule]thì sẽ được đánh giá bởiGlobal ACL.

Trong ví dụ ở trên,trafficgửi vào cổngoutsidesẽ bịDenybởiGlobal ACL.

6. Một số cấu hình ví dụ:

6.1. Cho phépICMP-Replytrả về từOutside

6.1.1. Kiểm tra cấu hình

R1#show running-config | inc default-gateway
ip default-gateway 172.16.1.4

R3#show ip route static
Gateway of last resort is 1.1.1.4 to network 0.0.0.0

S* 0.0.0.0/0 [1/0] via 1.1.1.4, FastEthernet0/0

ciscoasa# show running-config access-list
ciscoasa# show running-config nat

6.1.2. R1pingR3

R1#ping 1.1.1.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.3, timeout is 2 seconds:
…..
Success rate is 0 percent [0/5]

R3#debug ip icmp
ICMP packet debugging is on
R3#
*Nov 5 11:07:27.271: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
*Nov 5 11:07:28.275: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
R3#
*Nov 5 11:07:30.271: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
R3#
*Nov 5 11:07:32.271: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
R3#
*Nov 5 11:07:34.271: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0

Nhận xét: ICMP-Reply bị ASA chặn tại cổngoutside

6.1.3. Cấu hình ACL

ciscoasa[config]# access-list OUT-IN-ICMP permit icmp any any echo-reply

ciscoasa[config]# access-group OUT-IN-ICMP in interface outside

6.1.4. R1pingR3

R1#ping 1.1.1.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent [5/5], round-trip min/avg/max = 8/30/88 ms

R3#debug ip icmp
*Nov 5 11:11:59.451: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
*Nov 5 11:11:59.499: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
*Nov 5 11:11:59.527: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
*Nov 5 11:11:59.543: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0
*Nov 5 11:11:59.567: ICMP: echo reply sent, src 1.1.1.3, dst 172.16.1.1, topology BASE, dscp 0 topoid 0

ciscoasa# show access-list
access-list cached ACL log flows: total 0, denied 0 [deny-flow-max 4096]
alert-interval 300
access-list OUT-IN-ICMP; 1 elements; name hash: 0x3104a047
access-list OUT-IN-ICMP line 1 extended permit icmp any any echo-reply [hitcnt=1] 0x7577b33f

6.2. Nếutrafficđược giám sát [đã hình thànhconnection]thì không bị ACL lọc

6.2.1. Sử dụng ACL ở ví dụ 6.1

ciscoasa# show running-config access-list
access-list OUT-IN-ICMP extended permit icmp any any echo-reply
ciscoasa# show running-config access-group
access-group OUT-IN-ICMP in interface outside

R1#telnet 1.1.1.3
Trying 1.1.1.3 … Open

User Access Verification

Password:
R3>

ciscoasa# show conn
1 in use, 2 most used
TCP outside 1.1.1.3:23 inside 172.16.1.1:12739, idle 0:00:39, bytes 102, flags UIO

6.2.2. Sử dụng một ACL khác

ciscoasa[config]# show running-config access-list
access-list IN-OUT-TELNET extended deny tcp any eq telnet any
ciscoasa[config]# show running-config access-group
access-group IN-OUT-TELNET in interface outside
R1#telnet 1.1.1.3
Trying 1.1.1.3 … Open

User Access Verification

Password:
R3>

ciscoasa[config]# show conn
1 in use, 2 most used
TCP outside 1.1.1.3:23 inside 172.16.1.1:38484, idle 0:00:06, bytes 102, flags UIO

ciscoasa[config]# show access-list
access-list cached ACL log flows: total 0, denied 0 [deny-flow-max 4096]
alert-interval 300
access-list IN-OUT-TELNET; 1 elements; name hash: 0xdf3345c9
access-list IN-OUT-TELNET line 1 extended deny tcp any eq telnet any [hitcnt=0] 0x9f28ba28

6.3. Nếutraffic chưa được giám sát [chưa hình thànhconnection]thì bị ACL lọc

6.3.1. Lọc tại cổnginside

ciscoasa[config]# show running-config access-list
access-list IN-OUT-TELNET extended deny tcp any any eq telnet
access-list IN-OUT-TELNET extended permit ip any any
ciscoasa[config]# show running-config access-group
access-group IN-OUT-TELNET in interface inside

R1#telnet 1.1.1.3
Trying 1.1.1.3 …
% Connection refused by remote host

ciscoasa[config]# show access-list
access-list cached ACL log flows: total 0, denied 0 [deny-flow-max 4096]
alert-interval 300
access-list IN-OUT-TELNET; 2 elements; name hash: 0xdf3345c9
access-list IN-OUT-TELNET line 1 extended deny tcp any any eq telnet [hitcnt=1] 0x0cd8cfc4
access-list IN-OUT-TELNET line 2 extended permit ip any any [hitcnt=0] 0xe911cce5
ciscoasa[config]# show conn

6.3.2. Lọc tại cổngoutside

ciscoasa[config]# show running-config access-list
access-list IN-OUT-TELNET extended deny tcp any any eq telnet
access-list IN-OUT-TELNET extended permit ip any any
ciscoasa[config]# show running-config access-group
access-group IN-OUT-TELNET out interface outside

R1#telnet 1.1.1.3
Trying 1.1.1.3 …
% Connection refused by remote host

ciscoasa[config]# show access-list
access-list cached ACL log flows: total 0, denied 0 [deny-flow-max 4096]
alert-interval 300
access-list IN-OUT-TELNET; 2 elements; name hash: 0xdf3345c9
access-list IN-OUT-TELNET line 1 extended deny tcp any any eq telnet [hitcnt=2] 0x0cd8cfc4
access-list IN-OUT-TELNET line 2 extended permit ip any any [hitcnt=0] 0xe911cce5
ciscoasa[config]# show conn
0 in use, 2 most used

[to be continued]

Tham khảo:

– CCNA Security Curriculum

Cisco.Press.CCNP.Security.FIREWALL.642-618.Official.Cert.Guide.May.2012

– Cisco ASA All-in-One Next-Generation Firewall, IPS, and VPN Services, Third Edition

31 Tháng Bảy, 2018

Video liên quan

Chủ Đề