ACL学习:自反访问列表引入和配置

豆豆网   技术应用频道   2007年09月18日  【字号: 收藏本文

内容摘要:本文介绍自反访问列表引入和配置

  三台路由器串联,要求阻止R3对R1的远程访问(telnet),但只能在R2上做。R1可以对R3进行telnet登陆。

  1 底层配置

  R1

interface Serial2/1
ip address 12.0.0.1 255.255.255.0
router eigrp 90
network 12.0.0.0 0.0.0.255
no auto-summary

  R2

interface Serial2/1
ip address 12.0.0.2 255.255.255.0
interface Serial2/2
ip address 23.0.0.2 255.255.255.0
router eigrp 90
network 0.0.0.0
no auto-summary

  R3

interface Serial2/1
ip address 23.0.0.3 255.255.255.0
router eigrp 90
network 23.0.0.0 0.0.0.255
no auto-summary

  2 在R2上做ACL 拒绝R3对R1的所有TCP连接,但不能影响R1对R3的telnet

  在这里我们先用扩展访问列表做一下,看能不能实现。

r2(config)#access-list 100 deny tcp host 23.0.0.3 host 12.0.0.1
r2(config)#access-list 100 permit ip any any
r2(config)#int s2/2
r2(config-if)#ip access-group 100 in  / 将ACL应用到接口

  为了验证将R1和R3的VTY线路配置成直接登陆,无需密码。

r1(config)#line vty 0 4
r1(config-line)#no login
r3(config)#line vty 0 4
r3(config-line)#no login

  现在进行验证。

r3#telnet 12.0.0.1
Trying 12.0.0.1 ...
% Destination unreachable; gateway or host down

  在R3上无法telnetR1,访问列表起了作用。我们再去R1做一下验证。

r1#telnet 23.0.0.3
Trying 23.0.0.3 ...
% Connection timed out; remote host not responding

责编:豆豆技术应用

正在加载评论...