扩展ACL基本配置

 

要实现R0能够telnet上R2的lo 0,但是不能ping通lo 0的IP

在R0上做以下设置:

R0(config)#int s0/0

R0(config-if)#no shutdown

R0(config-if)#ip add 12.1.1.1 255.255.255.0

R0(config-if)#router ospf 1

R0(config-router)#network 12.1.1.0 0.0.0.255

R0#telnet 3.3.3.3

Trying 3.3.3.3 ... Open

 

R2>                                                   在R2上做了ACL过滤后能够telnet 3.3.3.3

 

R0#ping 3.3.3.3

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

U.U.U

Success rate is 0 percent (0/5)            在R2上做了ACL过滤后不能ping通3.3.3.3

 

 

 

 

在R1上做如下设置:

R1(config)#int s0/0

R1(config-if)#no shutdown

R1(config-if)#ip add 12.1.1.2 255.255.255.0

R1(config-if)#int s0/1

R1(config-if)#no shutdown

R1(config-if)#ip add 23.1.1.2 255.255.255.0

R1(config-if)#router ospf 1

R1(config-router)#network 12.1.1.0 0.0.0.255 a 0

R1(config-router)#network 23.1.1.0 0.0.0.255 a 0

 

在R2上做如下设置:

R2(config)#int s0/0

R2(config-if)#no shutdown

R2(config-if)#ip add 23.1.1.1 255.255.255.0

R2(config-if)#int lo 0

R2(config-if)#no shutdown

R2(config-if)#ip add 3.3.3.3 255.255.255.0

R2(config-if)#router ospf 1

R2(config-router)#network 3.3.3.0 0.0.0.255 a 0

R2(config-router)#network 23.1.1.0 0.0.0.255 a 0

R2(config)#access-list 100 permit tcp host 12.1.1.1 any eq 23         扩展ACL的配置第一步,第一条是允许tcp端口为23的telnet服务通过

R2(config)#access-list 100 deny icmp any any                                   第二条是禁止icmp

R2(config)#access-list 100 permit ip any any                                      第三条是允许数据包通过

R2(config)#int s0/0                                                                            配置扩展ACL的第二步

R2(config-if)#ip access-group 100 in

 

你可能感兴趣的:(小赖皮的CCNA学习笔记)