需求:
0、确保全网互通
1、client1访问server web服务器
2、client1访问192.168.2.0
3、client1禁止访问其它网络
实验图:
理解:
ACL: 是应用在路由器接口的指令列表 规则
ACL: 读取第三层第 四层报文头部信息 对报文进行过滤
五元组: 源IP 目标IP 源端口号 目标端口号 协议号
实验配置:
[ar1]int g0/0/0
[ar1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
[ar1-GigabitEthernet0/0/0]un shu
[ar1]int g0/0/1
[ar1-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[ar1-GigabitEthernet0/0/1]un shutdown
[ar1]rip
[ar1-rip-1]version 2
[ar1-rip-1]network 192.168.1.0
[ar1-rip-1]network 192.168.4.0
[ar2-GigabitEthernet0/0/0]ip add 192.168.4.2 24
[ar2-GigabitEthernet0/0/0]un shutdown
[ar2]int g0/0/1
[ar2-GigabitEthernet0/0/1]ip add 192.168.5.1 24
[ar2-GigabitEthernet0/0/1]un shutdown
[ar2]int g0/0/2
[ar2-GigabitEthernet0/0/2]ip add 192.168.2.254 24
[ar2-GigabitEthernet0/0/2]un shutdown
[ar2]rip
[ar2-rip-1]version 2
[ar2-rip-1]network 192.168.2.0
[ar2-rip-1]network 192.168.4.0
[ar2-rip-1]network 192.168.5.0
[ar3]int g0/0/0
[ar3-GigabitEthernet0/0/0]ip add 192.168.5.2 24
[ar3-GigabitEthernet0/0/0]un shu
[ar3]int g0/0/1
[ar3-GigabitEthernet0/0/1]ip add 192.168.3.254 24
[ar3-GigabitEthernet0/0/1]un shutdown
[ar3]rip
[ar3-rip-1]version 2
[ar3-rip-1]network 192.168.5.0
[ar3-rip-1]network 192.168.3.0
-------------------------------------------------------------------------------
高级ACL配置:
[AR1-acl-adv-3000]rule permit tcp source 192.168.1.1 0 destination 192.168.3.1 0
destination-port eq 80
//规则 {默认5}允许 TCP 源IP 目标IP {均等}协议号
[AR1-acl-adv-3000]rule permit ip source 192.168.1.1 0 destination 192.168.2.0
0.0.0.255
//规则 {默认5}允许 IP 源IP 目标IP 匹配{网段}
[AR1-acl-adv-3000]rule deny ip source any
//规则 {默认5}禁止 源ip 访问其他网络
[AR1-GigabitEthernet0/0/1]traffic-filter inbound acl 3000
//{流量}过滤 接口内部 应用
验证display acl 3000 或display acl all
验证接口是否UP display ip interface brief
删除高级ACL配置:
[ar1-GigabitEthernet0/0/0]undo traffic-filter inbound
[ar1-acl-adv-3000]undo rule 5 source
[ar1]un acl 3000