ACL实验

  • 实验拓扑

  • 实验需求
    1. 要求PC1可以访问3.0网段,但是PC2不行
    2. PC1可以访问PC3但是不能访问PC4
    3. 要求PC1可以ping通R2,但是不能telnetR2

三、实验过程

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24

[R1-GigabitEthernet0/0/0]

[R1-GigabitEthernet0/0/0]int g0/0/1

[R1-GigabitEthernet0/0/1]ip add 192.168.2.1 24

[R1]ip route-static 192.168.3.0 24 192.168.2.2

[R1]acl name xuqiuer 3000

[R1-acl-adv-xuqiuer]rule deny ip source 192.168.1.2 0.0.0.0 destination 192.168.3.3 0.0.0.0

[R1-acl-adv-xuqiuer]q

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]traffic-filter inbound acl name xuqiuer

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]dis th

[V200R003C00]

#

interface GigabitEthernet0/0/0

 ip address 192.168.1.1 255.255.255.0

 traffic-filter inbound acl name xuqiuer

#

return

[R1-GigabitEthernet0/0/0]undo traffic-filter inbound

[R1-GigabitEthernet0/0/0]q

[R1]acl 3001

[R1-acl-adv-3001]rule deny tcp source 192.168.1.10 0.0.0.0 destination 192.168.2

.2 0.0.0.0 destination-port eq 23

[R1-acl-adv-3001]q

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]traffic-filter inbound acl 3001

[Huawei]sys R2

[R2]int g0/0/0

[R2-GigabitEthernet0/0/0]ip add 192.168.2.2 24

[R2-GigabitEthernet0/0/0]int g0/0/1

[R2-GigabitEthernet0/0/1]ip add 192.168.3.1 24

[R2-GigabitEthernet0/0/1]q

[R2]ip route-static 192.168.1.0 24 192.168.2.1

[R2]acl 2000

[R2-acl-basic-2000]rule deny source 192.168.1.3 0.0.0.0

[R2-acl-basic-2000]rule permit source any

[R2-acl-basic-2000]q

[R2]dis acl 2000

Basic ACL 2000, 2 rules

Acl's step is 5

 rule 5 deny source 192.168.1.3 0

 rule 10 permit

[R2]int g0/0/1

[R2-GigabitEthernet0/0/1]traffic-filter outbound acl 2000

[R2-GigabitEthernet0/0/1]q

[R2]

[R2]aaa

[R2-aaa]local-user xijing privilege level 15 password cipher 123456

Info: Add a new user.

[R2-aaa]local-user xijing service-type telnet

[R2-aaa]q

[R2]use

[R2]user-interface vty 0 4

[R2-ui-vty0-4]authentication-mode aaa

[R2-ui-vty0-4]q

[Huawei]int g0/0/0

[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.10 24

[Huawei-GigabitEthernet0/0/0]q

[Huawei]ip route-static 0.0.0.0 0 192.168.1.1

[Huawei]ping 192.168.2.2

  PING 192.168.2.2: 56  data bytes, press CTRL_C to break

    Reply from 192.168.2.2: bytes=56 Sequence=1 ttl=254 time=230 ms

    Reply from 192.168.2.2: bytes=56 Sequence=2 ttl=254 time=60 ms

    Reply from 192.168.2.2: bytes=56 Sequence=3 ttl=254 time=30 ms

    Reply from 192.168.2.2: bytes=56 Sequence=4 ttl=254 time=40 ms

    Reply from 192.168.2.2: bytes=56 Sequence=5 ttl=254 time=40 ms

  --- 192.168.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 30/80/230 ms

[Huawei]q

<Huawei>telnet 192.168.2.2

  Press CTRL_] to quit telnet mode

  Trying 192.168.2.2 ...

  Error: Can't connect to the remote host

<Huawei>ping 192.168.2.2

  PING 192.168.2.2: 56  data bytes, press CTRL_C to break

    Reply from 192.168.2.2: bytes=56 Sequence=1 ttl=254 time=90 ms

    Reply from 192.168.2.2: bytes=56 Sequence=2 ttl=254 time=70 ms

    Reply from 192.168.2.2: bytes=56 Sequence=3 ttl=254 time=50 ms

    Reply from 192.168.2.2: bytes=56 Sequence=4 ttl=254 time=40 ms

    Reply from 192.168.2.2: bytes=56 Sequence=5 ttl=254 time=70 ms

  --- 192.168.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 40/64/90 ms

  • 17
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值