ACL应用之ICMP(ACL详解)

网友投稿 521 2022-09-23


ACL应用之ICMP(ACL详解)

ACL应用之ICMP

测试工具Ping的工作原理是什么?发送icmp报完发送与回应两个方向都要能通。ping是通过什么协议的报文实现的?icmp协议报文 协议号tcp1ACL的默认规则是什么?ACL是不会对设备自己产生的流量起到作用,所有设置acl是在距离源地址最近设备的最近接口上进行设置。如何确定数据包的方向?数据包的方向根据源IP地址和目标地址的传动方向确定是输入还是输出。

案例问题如图配置IP地址,配置路由,确保各设备互通拒绝Client 1 ping 通 R2拒绝 R1 ping 通 Server1其他流量均可以互通

配置思路:1.终端设备配置-客户端(ip)2.网络设备配置-路由器-接口ip3.配置ip地址和路由,确保网络互通-静态路由和默认路由-r1,r3设置默认路由 r2设置静态路由4.配置ACL5.调用ACL6.验证与测试7.测试

在Client1 测试:Ping 192.168.12.2 ,不通;Ping 192.168.23.2 ,不通;Ping 192.168.2.254,不通;在 R1 上测试:Ping 192.168.3.1 , 不通;Ping –a 192.168.1.254 192.168.3.1

在 R1 上配置并调用 ACL,拒绝 Client1 ping R2[R1]acl 3000 [R1-acl-adv-3000]rule 10 deny icmp source 192.168.1.1 0.0.0.0 destination 192.168.12.2 0.0.0.0[R1-acl-adv-3000]rule 20 deny icmp source 192.168.1.1 0.0.0.0 destination 192.168.2.254 0.0.0.0[R1-acl-adv-3000]rule 30 deny icmp source 192.168.1.1 0.0.0.0 destination 192.168.23.2 0.0.0.0[R1-acl-adv-3000]q[R1]dis acl allTotal quantity of nonempty ACL number is 1

Advanced ACL 3000, 3 rulesAcl's step is 5rule 10 deny icmp source 192.168.1.1 0 destination 192.168.12.2 0 rule 20 deny icmp source 192.168.1.1 0 destination 192.168.2.254 0 rule 30 deny icmp source 192.168.1.1 0 destination 192.168.23.2 0

[R1]int g0/0/2 [R1-GigabitEthernet0/0/2]traffic-filter inbound acl 3000[R1-GigabitEthernet0/0/2]q

在 R2 上配置并调用 ACL,拒绝 R1 ping Server1[R2]acl 3000[R2-acl-adv-3000]rule 10 deny icmp source 192.168.1.254 0.0.0.0 destination 192.168.3.1 0.0.0.0[R2-acl-adv-3000]rule 20 deny icmp source 192.168.12.1 0.0.0.0 destination 192.168.3.1 0.0.0.0[R2-acl-adv-3000]q[R2]dis acl allTotal quantity of nonempty ACL number is 1

Advanced ACL 3000, 2 rulesAcl's step is 5rule 10 deny icmp source 192.168.1.254 0 destination 192.168.3.1 0 rule 20 deny icmp source 192.168.12.1 0 destination 192.168.3.1 0 [R2]int g0/0/1[R2-GigabitEthernet0/0/1]traffic-filter inbound acl 3000

3 案例3:ACL 应用之ICMP3.1 问题如图配置IP地址,配置路由,确保各设备互通拒绝Client 1 ping 通 R2拒绝 R1 ping 通 Server1其他流量均可以互通3.2 方案搭建实验环境,如图-3所示。

图-3

3.3 步骤实现此案例需要按照如下步骤进行。

1)配置终端设备 - Client 1

地址:192.168.1.1 掩码:255.255.255.0 网关:192.168.1.254

2)配置终端设备 – Client 2

地址:192.168.2.1 掩码:255.255.255.0 网关:192.168.2.254

配置终端设备 – Server1

地址:192.168.3.1 掩码:255.255.255.0 网关:192.168.3.254

3)配置网络设备 – R1

system-view // 进入系统模式[Huawei]sysname R1 // 更改设备名称[R1]interface gi0/0/2 // 连接 Client1[R1-GigabitEthernet0/0/2] ip address 192.168.1.254 24[R1-GigabitEthernet0/0/2] quit [R1]interface gi0/0/0 // 连接 R2的接口[R1-GigabitEthernet0/0/0] ip address 192.168.12.1 24[R1-GigabitEthernet0/0/0] quit [R1]ip route-static 0.0.0.0 0.0.0.0 192.168.12.2 // 去往其他网段的默认路由4)配置网络设备 – R2

system-view // 进入系统模式[Huawei]sysname R2 // 更改设备名称[R2]interface gi0/0/2 // 连接 PC1 [R2-GigabitEthernet0/0/2] ip address 192.168.2.254 24[R2-GigabitEthernet0/0/2] quit [R2]interface gi0/0/1 // 连接 R1 的接口[R2-GigabitEthernet0/0/1] ip address 192.168.12.2 24[R2-GigabitEthernet0/0/1] quit [R2]interface gi0/0/0 // 连接 R3 的接口[R2-GigabitEthernet0/0/0] ip address 192.168.23.2 24[R2-GigabitEthernet0/0/0] quit [R2]ip route-static 192.168.1.0 255.255.255.0 192.168.12.1 // 去往Client1的网段[R2]ip route-static 192.168.3.0 255.255.255.0 192.168.23.3 // 去往Server1的网段5)配置网络设备 – R3

system-view // 进入系统模式[Huawei]sysname R3 // 更改设备名称[R3]interface gi0/0/2 // 连接 Server1[R3-GigabitEthernet0/0/2] ip address 192.168.3.254 24[R3-GigabitEthernet0/0/2] quit [R3]interface gi0/0/1 // 连接 R2 的接口[R3-GigabitEthernet0/0/1] ip address 192.168.23.3 24[R3-GigabitEthernet0/0/1] quit [R3]ip route-static 0.0.0.0 0.0.0.0 192.168.23.2 // 去往其他网段的默认路由6)在 R1 上配置并调用 ACL,拒绝 Client1 ping R2

[R1] acl 3000[R1-acl-adv-3000]rule 10 deny icmp source 192.168.1.1 0 destination 192.168.12.2 0 [R1-acl-adv-3000]rule 20 deny icmp source 192.168.1.1 0 destination 192.168.23.2 0 [R1-acl-adv-3000]rule 30 deny icmp source 192.168.1.1 0 destination 192.168.2.254 0[R1] interface gi0/0/2[R1-GigabitEthernet0/0/2] traffic-filter inbound acl 3000 // 在该接口入向调用ACL7)在 R2 上配置并调用 ACL,拒绝 R1 ping Server1

[R2]acl 3000[R2-acl-adv-3000]rule 10 deny icmp source 192.168.1.254 0 destination 192.168.3.1 0[R2-acl-adv-3000]rule 20 deny icmp source 192.168.12.1 0 destination 192.168.3.1 0[R2] interface gi0/0/1[R2-GigabitEthernet0/0/1] traffic-filter inbound acl 3000 // 在该接口入向调用ACL8)测试

在Client1 测试:Ping 192.168.12.2 ,不通;Ping 192.168.23.2 ,不通;Ping 192.168.2.254,不通;在 R1 上测试:Ping 192.168.3.1 , 不通;Ping –a 192.168.1.254 192.168.3.1 , 不通


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:ACL应用之Telnet
下一篇:配置高级ACL详解(配置标准acl)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~