From 70f91821b5e0383db547436f67cbea500b1aaaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=99=E7=82=9C=E5=BB=B7?= <1160093753@qq.com> Date: Thu, 24 Apr 2025 18:23:10 +0800 Subject: [PATCH] 35 --- ...350\241\250ACL\350\256\276\347\275\256.md" | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 "40\351\230\231\347\202\234\345\273\267/20250424\350\267\257\347\224\261\345\231\250IP\346\216\247\345\210\266\345\210\227\350\241\250ACL\350\256\276\347\275\256.md" diff --git "a/40\351\230\231\347\202\234\345\273\267/20250424\350\267\257\347\224\261\345\231\250IP\346\216\247\345\210\266\345\210\227\350\241\250ACL\350\256\276\347\275\256.md" "b/40\351\230\231\347\202\234\345\273\267/20250424\350\267\257\347\224\261\345\231\250IP\346\216\247\345\210\266\345\210\227\350\241\250ACL\350\256\276\347\275\256.md" new file mode 100644 index 0000000..cb05057 --- /dev/null +++ "b/40\351\230\231\347\202\234\345\273\267/20250424\350\267\257\347\224\261\345\231\250IP\346\216\247\345\210\266\345\210\227\350\241\250ACL\350\256\276\347\275\256.md" @@ -0,0 +1,34 @@ +# 路由器IP控制列表ACL配置 + +**1.应用** + +访问控制列表(ACL,Access Control List)是思科设备中用于**流量过滤**和**安全策略**的核心技术,广泛应用于: + +- **网络安全**:限制非法访问(如阻止攻击流量) +- **流量控制**:允许/拒绝特定服务(如HTTP、SSH) +- **策略路由**:结合路由映射(Route-map)实现高级选路 + +**2.ACL类型** + +| 类型 | 编号范围 | 匹配依据 | 特点 | +| ----------- | ------------------ | ------------------------ | ------------------- | +| **标准ACL** | 1-99, 1300-1999 | 仅源IP地址 | 简单,效率低 | +| **扩展ACL** | 100-199, 2000-2699 | 源IP、目的IP、协议、端口 | 精细控制,推荐使用- | + +**3.核心代码** + +```cmd +access-list <编号> <动作> <源IP> <通配符掩码> +# 编号范围 1-99 +# 动作:permit 允许 、 deny 拒绝 + +access-list <编号> <动作> <源IP> <通配符掩码> +# 编号范围 1-99 +# 动作:permit 允许 、 deny 拒绝 + +# 语法分两步骤# 步骤1:先选择要应用ACL的端口 如 interface g0/0# 步骤2:通过ACL编号及方向来应用ACL,格式如下ip access-group <编号> <方向>    ## 方向 in / out 代表流量流入/流出路由器的方向# 示例:interface GigabitEthernet0/0 # 第一步,进入G0/0端口 ip access-group 10 in   # 第二步,在G0/0端口的入口方向应用编号为10的ACL +``` + +![image-20250424182111552](https://gitee.com/que-weiting/picture/raw/master/img/upgit_20250424_1745490073.png) + +![image-20250424182206041](https://gitee.com/que-weiting/picture/raw/master/img/upgit_20250424_1745490126.png) -- Gitee