扩展ACL的基本用法

实例二:扩展ACL的基本用法

 

1.限制PC1访问服务器的web

2.把控制列表应用在R2的S0/2/0的in方向





代码如下:

 

R1配置

en
conf t
hostname R1
 
int f0/0
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
int f0/1
ip address 192.168.2.254 255.255.255.0
no shutdown
exit
int s0/2/0
ip address 192.168.3.254 255.255.255.0
no shutdown
clock rate 64000
exit
 
 
 
router rip
version 2
network 192.168.1.0
network 192.168.2.0
network 192.168.3.0
exit
 
end


 

R2配置

en
conf t
hostname R2
 
int s0/2/0
ip address 192.168.3.253 255.255.255.0
ip access-group 101 in
no shutdown
exit
 
int f0/0
ip address 192.168.4.254 255.255.255.0
no shutdown
exit
 
 
access-list 101 deny tcp 192.168.1.0 0.0.0.255 192.168.4.00.0.0.255 eq 80
access-list 101 permit ip any any
 
 
 
 
 
router rip
version 2
network 192.168.3.0
network 192.168.4.0
exit
 
end


 

 

 

 

测试结果:PC1可以ping通,但不能访问web

 

PC>ping 192.168.4.253

 

Pinging 192.168.4.253 with 32 bytes of data:

 

Reply from 192.168.4.253: bytes=32 time=19ms TTL=126

Reply from 192.168.4.253: bytes=32 time=4ms TTL=126

Reply from 192.168.4.253: bytes=32 time=1ms TTL=126

Reply from 192.168.4.253: bytes=32 time=1ms TTL=126

 

Ping statistics for 192.168.4.253:

    Packets:Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 1ms, Maximum= 19ms, Average = 6ms

 

 

http://192.168.4.253

Request Timeout



结果分析:访问列表成功起到过滤作用


  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值