基础ACL小练习

1.配置ip和网关(太简单不演示)

2.R1的配置:

<Huawei>u t m 
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.100.254 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/1]int g 0/0/2
[R1-GigabitEthernet0/0/2]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/2]q

 如此一来,全网互通

3.配置ACL

R1上配置:
[R1]acl 2000
[R1-acl-basic-2000]rule ?
  INTEGER<0-4294967294>  ID of ACL rule
  deny                   Specify matched packet deny
  permit                 Specify matched packet permit
[R1-acl-basic-2000]rule 10 ?
  deny         Specify matched packet deny
  description  Specify rule description
  permit       Specify matched packet permit
[R1-acl-basic-2000]rule 10 deny source 192.168.1.1 0.0.0.255
[R1-acl-basic-2000]q
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]traffic-filter ?
  inbound   Apply ACL to the inbound direction of the interface 
  outbound  Apply ACL to the outbound direction of the interface 
[R1-GigabitEthernet0/0/0]traffic-filter outbound ?
  acl   Specify ACL to match
  ipv6  Specify IPv6 
[R1-GigabitEthernet0/0/0]traffic-filter outbound acl 2000
至此,PC1无法访问server,但可以访问PC2
  • 12
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值