{"id":645,"date":"2025-12-24T09:30:09","date_gmt":"2025-12-24T01:30:09","guid":{"rendered":"https:\/\/www.axeuh.com\/?p=645"},"modified":"2025-12-24T09:32:28","modified_gmt":"2025-12-24T01:32:28","slug":"%e6%a0%87%e5%87%86acl","status":"publish","type":"post","link":"https:\/\/www.axeuh.com\/index.php\/2025\/12\/24\/%e6%a0%87%e5%87%86acl\/","title":{"rendered":"\u6807\u51c6ACL"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/image-2.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"654\" height=\"294\" data-original=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/image-2.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-650\" style=\"width:826px;height:auto\"  sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/div><\/figure>\n<\/div>\n\n\n<div class=\"wp-block-jetpack-markdown\"><p>\u4e3a\u4e86\u5728 Cisco Packet Tracer \u4e2d\u5b9e\u73b0\u4f60\u63cf\u8ff0\u7684\u7f51\u7edc\u62d3\u6251\u53ca\u9700\u6c42\uff0c\u6211\u4eec\u9700\u8981\u5206\u4e09\u4e2a\u6b65\u9aa4\u8fdb\u884c\uff1a<strong>\u57fa\u7840\u914d\u7f6e\uff08IP \u5206\u914d\uff09<\/strong>\u3001<strong>\u5b9e\u73b0\u5168\u7f51\u901a\uff08\u9759\u6001\u8def\u7531\uff09<\/strong>\u3001\u4ee5\u53ca<strong>\u5e94\u7528\u8bbf\u95ee\u63a7\u5236\u5217\u8868\uff08ACL\uff09<\/strong>\u3002<\/p>\n<h3>1. \u57fa\u7840 IP \u5730\u5740\u5206\u914d<\/h3>\n<p>\u9996\u5148\uff0c\u8bf7\u786e\u4fdd\u6240\u6709\u63a5\u53e3\u5df2\u6253\u5f00 (<code>no shutdown<\/code>) \u5e76\u914d\u7f6e\u4e86\u6b63\u786e\u7684 IP \u5730\u5740\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u8bbe\u5907<\/th>\n<th>\u63a5\u53e3<\/th>\n<th>IP \u5730\u5740<\/th>\n<th>\u5b50\u7f51\u63a9\u7801<\/th>\n<th>\u9ed8\u8ba4\u7f51\u5173<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>PC0<\/strong><\/td>\n<td>NIC<\/td>\n<td>192.168.1.2<\/td>\n<td>255.255.255.0<\/td>\n<td>192.168.1.1<\/td>\n<\/tr>\n<tr>\n<td><strong>PC1<\/strong><\/td>\n<td>NIC<\/td>\n<td>192.168.2.2<\/td>\n<td>255.255.255.0<\/td>\n<td>192.168.2.1<\/td>\n<\/tr>\n<tr>\n<td><strong>PC2<\/strong><\/td>\n<td>NIC<\/td>\n<td>192.168.4.2<\/td>\n<td>255.255.255.0<\/td>\n<td>192.168.4.1<\/td>\n<\/tr>\n<tr>\n<td><strong>RA<\/strong><\/td>\n<td>Fa0\/0<\/td>\n<td>192.168.1.1<\/td>\n<td>255.255.255.0<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<tr>\n<td><strong>RA<\/strong><\/td>\n<td>Fa1\/0<\/td>\n<td>192.168.2.1<\/td>\n<td>255.255.255.0<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<tr>\n<td><strong>RA<\/strong><\/td>\n<td>Se2\/0<\/td>\n<td>192.168.3.1<\/td>\n<td>255.255.255.0<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<tr>\n<td><strong>RB<\/strong><\/td>\n<td>Se2\/0<\/td>\n<td>192.168.3.2<\/td>\n<td>255.255.255.0<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<tr>\n<td><strong>RB<\/strong><\/td>\n<td>Fa0\/0<\/td>\n<td>192.168.4.1<\/td>\n<td>255.255.255.0<\/td>\n<td>&#8211;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h3>2. \u5b9e\u73b0\u5168\u7f51\u901a\uff08\u9759\u6001\u8def\u7531\uff09<\/h3>\n<p>\u8981\u8ba9 1.0\u30012.0 \u548c 4.0 \u7f51\u6bb5\u4e92\u901a\uff0c\u8def\u7531\u5668\u5fc5\u987b\u77e5\u9053\u5982\u4f55\u5230\u8fbe\u5bf9\u65b9\u7684\u7f51\u6bb5\u3002<\/p>\n<p><strong>\u5728 RA \u4e0a\u914d\u7f6e\uff1a<\/strong>\uff08\u544a\u77e5 RA \u5982\u4f55\u53bb\u5f80 4.0 \u7f51\u6bb5\uff09<\/p>\n<pre><code class=\"language-bash\">RA(config)# ip route 192.168.4.0 255.255.255.0 192.168.3.2\n\n<\/code><\/pre>\n<p><strong>\u5728 RB \u4e0a\u914d\u7f6e\uff1a<\/strong>\uff08\u544a\u77e5 RB \u5982\u4f55\u56de\u5305\u7ed9 1.0 \u548c 2.0 \u7f51\u6bb5\uff09<\/p>\n<pre><code class=\"language-bash\">RB(config)# ip route 192.168.1.0 255.255.255.0 192.168.3.1\nRB(config)# ip route 192.168.2.0 255.255.255.0 192.168.3.1\n\n<\/code><\/pre>\n<p><em>\u6b64\u65f6\uff0c\u6240\u6709 PC \u4e4b\u95f4\u5e94\u8be5\u53ef\u4ee5\u4e92\u76f8 Ping \u901a\u3002<\/em><\/p>\n<hr>\n<h3>3. \u914d\u7f6e ACL \u8bbf\u95ee\u63a7\u5236<\/h3>\n<p><strong>\u9700\u6c42\uff1a<\/strong><\/p>\n<ol>\n<li>\u5141\u8bb8 <code>192.168.1.0<\/code> \u8bbf\u95ee <code>192.168.4.0<\/code><\/li>\n<li>\u62d2\u7edd <code>192.168.2.0<\/code> \u8bbf\u95ee <code>192.168.4.0<\/code><\/li>\n<\/ol>\n<p><strong>\u6700\u4f73\u5b9e\u8df5\u5efa\u8bae\uff1a<\/strong>\n\u5bf9\u4e8e\u7b80\u5355\u7684\u6e90\u5730\u5740\u8fc7\u6ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<strong>\u6807\u51c6 ACL\uff08Standard ACL\uff09<\/strong>\u3002\u6807\u51c6 ACL \u5efa\u8bae\u653e\u7f6e\u5728<strong>\u79bb\u76ee\u7684\u5730\u6700\u8fd1<\/strong>\u7684\u8def\u7531\u5668\u4e0a\u3002\u5728\u8fd9\u4e2a\u6848\u4f8b\u4e2d\uff0c\u5c31\u662f\u5728 <strong>RB<\/strong> \u4e0a\u914d\u7f6e\u3002<\/p>\n<p><strong>\u5728 RB \u4e0a\u914d\u7f6e\u6807\u51c6 ACL\uff1a<\/strong><\/p>\n<pre><code class=\"language-bash\">RB(config)# access-list 1 permit 192.168.1.0 0.0.0.255\nRB(config)# access-list 1 deny 192.168.2.0 0.0.0.255\nRB(config)# access-list 1 permit any  # \u5141\u8bb8\u5176\u4ed6\u6240\u6709\u6d41\u91cf\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\n\n# \u5c06 ACL \u5e94\u7528\u5230\u63a5\u53e3\n# \u6211\u4eec\u8981\u4fdd\u62a4 4.0 \u7f51\u6bb5\uff0c\u6240\u4ee5\u5728 RB \u7684 Fa0\/0 \u51fa\u53e3\u65b9\u5411\u62e6\u622a\nRB(config)# interface FastEthernet0\/0\nRB(config-if)# ip access-group 1 out\n\n<\/code><\/pre>\n<blockquote>\n<p><strong>\u6ce8\u610f\uff1a<\/strong> ACL \u672b\u5c3e\u9690\u85cf\u4e86\u4e00\u8df3 <code>deny any<\/code>\uff0c\u6240\u4ee5\u5982\u679c\u4f60\u4e0d\u52a0\u4e0a <code>permit any<\/code>\uff0c\u9664\u4e86 1.0 \u4ee5\u5916\u7684\u6240\u6709\u7f51\u6bb5\u90fd\u5c06\u65e0\u6cd5\u901a\u8fc7\u8be5\u63a5\u53e3\u3002<\/p>\n<\/blockquote>\n<hr>\n<h3>4. \u9a8c\u8bc1\u6d4b\u8bd5<\/h3>\n<ol>\n<li><strong>PC0 (1.0 \u7f51\u6bb5) -&gt; PC2 (4.0 \u7f51\u6bb5)\uff1a<\/strong> * \u5728 PC0 \u7684 Command Prompt \u8f93\u5165 <code>ping 192.168.4.2<\/code>\uff0c\u7ed3\u679c\u5e94\u4e3a <strong>Success<\/strong>\u3002<\/li>\n<li><strong>PC1 (2.0 \u7f51\u6bb5) -&gt; PC2 (4.0 \u7f51\u6bb5)\uff1a<\/strong> * \u5728 PC1 \u7684 Command Prompt \u8f93\u5165 <code>ping 192.168.4.2<\/code>\uff0c\u7ed3\u679c\u5e94\u4e3a <strong>Destination host unreachable<\/strong> (\u7531 RB \u62e6\u622a)\u3002<\/li>\n<li><strong>\u67e5\u770b ACL \u72b6\u6001\uff1a<\/strong><\/li>\n<\/ol>\n<ul>\n<li>\u5728 RB \u4e0a\u8f93\u5165 <code>show access-lists<\/code>\uff0c\u4f60\u53ef\u4ee5\u770b\u5230\u5339\u914d\u6210\u529f\u7684\u6b21\u6570\uff08matches\uff09\u3002<\/li>\n<\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-930a4568-d8cb-4aad-97f0-b7712993aa6a\" href=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/\u5b9e\u8bad16-\u6807\u51c6ACL\uff081\uff09.zip\">\u5b9e\u8bad16 \u6807\u51c6ACL\uff081\uff09<\/a><a href=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/\u5b9e\u8bad16-\u6807\u51c6ACL\uff081\uff09.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-930a4568-d8cb-4aad-97f0-b7712993aa6a\">\u4e0b\u8f7d<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16],"tags":[17],"class_list":["post-645","post","type-post","status-publish","format-standard","hentry","category-16","tag-17"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/comments?post=645"}],"version-history":[{"count":4,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/645\/revisions"}],"predecessor-version":[{"id":652,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/645\/revisions\/652"}],"wp:attachment":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/media?parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/categories?post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/tags?post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}