ACL实验

 

需求分析

1.R2开通telnet服务

2.pc1可以ping同R2,不能talnetR2

3.pc2可以telnetR2,不能ping通R2

配置

配置ip

[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192,168.2.254 24
                                ^
Error: Wrong parameter found at '^' position.
[r1-GigabitEthernet0/0/0]ip add 192.168.2.254 24
May 17 2023 16:59:41-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.254 24
May 17 2023 17:00:19-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r1-GigabitEthernet0/0/1]q


[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
May 17 2023 17:01:27-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<r2>sys
Enter system view, return user view with Ctrl+Z.
[r2]ip route-s	
[r2]ip route-static 192.168.1.0 24 192.168.2.254

[PC1]int g 0/0/0
[PC1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
May 17 2023 17:02:34-08:00 PC1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[PC1-GigabitEthernet0/0/0]q
[PC1]ip route-static 192.168.2.0 24 192.168.1.254

[PC2]int g 0/0/0
[PC2-GigabitEthernet0/0/0]ip add 192.168.1.2 24
May 17 2023 17:03:41-08:00 PC2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[PC2-GigabitEthernet0/0/0]q
[PC2]ip route-static 192.168.2.0 24 192.168.1.254

telnetR2

[r2]user-interface vty 0 4
[r2-ui-vty0-4]ayt	
[r2-ui-vty0-4]aut	
[r2-ui-vty0-4]authentication-mode aaa
[r2-ui-vty0-4]q
[r2]aaa
[r2-aaa]local-	
[r2-aaa]local-user huawei passw	
[r2-aaa]local-user huawei password ci	
[r2-aaa]local-user huawei password cipher 123456
Info: Add a new user.
[r2-aaa]local-	
[r2-aaa]local-user huawei pr	
[r2-aaa]local-user huawei privilege level 15
[r2-aaa]local-user huawei ser	
[r2-aaa]local-user huawei service-type telnet

pc1可以ping同R2,不能talnetR2

[PC1]int g 0/0/0
[PC1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
May 17 2023 17:02:34-08:00 PC1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
 on the interface GigabitEthernet0/0/0 has entered the UP state. 
[PC1-GigabitEthernet0/0/0]q
[PC1]ip route-static 192.168.2.0 24 192.168.1.254

pc2可以telnetR2,不能ping通R2

[r1-acl-adv-3100]rule deny ip source 192.168.1.2 0.0.0.0 destination 192.168.2.1
 0.0.0.0
[r1-acl-adv-3100]q
[r1]traffic-	
[r1]int g 0/0/1
[r1-GigabitEthernet0/0/1]tra	
[r1-GigabitEthernet0/0/1]tracert
[r1-GigabitEthernet0/0/1]traffic-filter in	
[r1-GigabitEthernet0/0/1]traffic-filter inbound acl 3100

检测

<PC1>ping 192.168.2.1
  PING 192.168.2.1: 56  data bytes, press CTRL_C to break
    Reply from 192.168.2.1: bytes=56 Sequence=1 ttl=254 time=50 ms
    Reply from 192.168.2.1: bytes=56 Sequence=2 ttl=254 time=60 ms
    Reply from 192.168.2.1: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 192.168.2.1: bytes=56 Sequence=4 ttl=254 time=50 ms
    Reply from 192.168.2.1: bytes=56 Sequence=5 ttl=254 time=30 ms

  --- 192.168.2.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/46/60 ms

<PC1>

  Please check whether system data has been changed, and save data in time

  Configuration console time out, please press any key to log on

<PC1>telnet 192.168.2.1
  Press CTRL_] to quit telnet mode
  Trying 192.168.2.1 ...
  Error: Can't connect to the remote host

<PC2>ping 192.168.2.1
  PING 192.168.2.1: 56  data bytes, press CTRL_C to break
    Request time out
    Request time out
    Request time out
    Request time out
    Request time out

  --- 192.168.2.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss


<PC2>telnet 192.168.2.1
  Press CTRL_] to quit telnet mode
  Trying 192.168.2.1 ...
  Connected to 192.168.2.1 ...

Login authentication


Username:


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值