Cisco 路由器 访问控制列表

 

实验:访问控制列表

实验目的:学习使用标准访问控制列表和扩展访问控制列表做基本的安全控制

实验拓扑:如下图

实验要求:

l 标准访问控制列表

n 不允许10.10.2.0访问172.16.1.0

n 不允许10.10.1.0访问172.16.5.0

n 允许其他所有流量

(方法不唯一,我的只供参考)

l 扩展访问控制列表

n 不允许10.10.2.0  telnet  172.16.1.0

n 不允许10.10.1.0  telnet  172.16.5.0

n 允许其他所有流量

(方法不唯一,我的只供参考)

155113_AkIT_238697.png




R1的配置

R1>  en

R1#  config  t

R1(config)#  no   ip  routing

R1(config)#  ip  default-gateway  10.10.1.1

R1(config)#  int  e0/0

R1(config-if)#  ip  add  10.10.1.10  255.255.255.0

R1(config-if)#  no  shut

R1(config-if)#  end

R1#




R2的配置

R2>  en

R2#  config  t

R2(config)#  no   ip  routing

R2(config)#  ip  default-gateway  10.10.2.1

R2(config)#  int  e0/3

R2(config-if)#  ip  add  10.10.2.10  255.255.255.0

R2(config-if)#  no  shut

R2(config-if)#  end

R2#



R3的配置

R3>  en

R3#  config  t

R3(config)#   int  e0/0 

R3(config-if)#  ip  add  10.10.1.1  255.255.255.0

R3(config-if)#  no  shut

R3(config-if)#  int  e0/3

R3(config-if)#  ip  add  10.10.2.1  255.255.255.0

R3(config-if)#  no  shut

R3(config-if)#  int  e0/2

R3(config-if)#  ip  add  192.168.1.10  255.255.255.0

R3(config-if)#  duplex  full

R3(config-if)#  no  shut

R3(config-if)#  exit

R3(config)#  router   ospf   10 

R3(config-router)#  net  0.0.0.0  255.255.255.255  area  0

R3(config-router)#  end

R3#



S1的配置

S1>  en

S1#  config  t

S1(config)#  int   range   f0/0  -  15

S1(config-if-range)#  speed  10

S1(config-if-range)#  duplex   full

S1(config-if-range)#   no  shut

S1(config-if-range)#  end

S1#




R4的配置

R4>  en

R4#  config  t

R4(config)#  int  e0/2

R4(config-if)#  ip  add  192.168.1.1  255.255.255.0

R4(config-if)#  duplex  full

R4(config-if)#  no  shut

R4(config-if)#   int  e0/0

R4(config-if)#  ip  add  172.16.1.1  255.255.255.0

R4(config-if)#  no  shut

R4(config-if)#  exit

R4(config)#  router  ospf  1

R4(config-router)#  net   0.0.0.0  255.255.255.255  area  0

R4(config-router)#  end

R4#



R5的配置

R5>  en

R5#  config  t

R5(config)#  int  e0/2

R5(config-if)#  ip  add  192.168.1.5  255.255.255.0

R5(config-if)#  duplex  full

R5(config-if)#  no  shut

R5(config-if)#  int  e0/3

R5(config-if)#  ip  add  172.16.5.1  255.255.255.0

R5(config-if)#  no  shut

R5(config-if)#  exit

R5(config)#  router  ospf  1

R5(config-router)#  net  0.0.0.0  255.255.255.255  area  0

R5(config-router)#  end

R5#



R6的配置

R6>  en

R6#  config  t

R6(config)#  no  ip   routing

R6(config)#  ip  default-gateway  172.16.1.1

R6(config)#  int  e0/0

R6(config-if)#  ip  add  172.16.1.10  255.255.255.0

R6(config-if)#  no  shut

R6(config-if)#  end

R6#

R7的配置

R7>  en

R7#  config  t

R7(config)#  no  ip   routing

R7(config)#  ip  default-gateway  172.16.5.1

R7(config)#  int  e0/3

R7(config-if)#  ip  add  172.16.5.10  255.255.255.0

R7(config-if)#  no  shut

R7(config-if)#  end

R7#


验证:在R1上ping任意一台路由器的IP,匀能ping通,就成功了!!!


===============================================================

标准访问控制列表的配置


配置路由器R4

R4> en

R4#  config  t

R4(config)#  access-list  1  permit  10.10.1.0  0.0.0.255

R4(config)#  access-list  1  permit  192.168.1.0  0.0.0.255

R4(config)#  access-list  1  permit  172.16.5.0  0.0.0.255

R4(config)#  int  e0/2

R4(config-if)#  ip   access-group  1  in

R4(config-if)#  end

R4#


配置路由器R5

R5> en

R5#  config  t

R5(config)#  access-list  1  permit  10.10.1.0  0.0.0.255

R5(config)#  access-list  1  permit  192.168.1.0  0.0.0.255

R5(config)#  access-list  1  permit  172.16.1.0  0.0.0.255

R5(config)#  int  e0/2

R5(config-if)#  ip   access-group  1  in

R5(config-if)#  end

R5#



验证:在R1上ping 172.16.1.10 和ping  172.16.5.10   能ping通

      在R2上ping 172.16.1.10 和ping  172.16.5.10   不能ping通


===================================================================

扩展访问控制列表的配置


配置路由器R4

R4> en

R4#  config  t

R4(config)#  no  access-list  1

R4(config)#  int  e0/2

R4(config-if)#  no  ip  access-g roup  1  in

R4(config-if)#  exit

R4(config)#  

R4(config)#

R4(config)#  access-list  101  deny  tcp  10.10.2.0  0.0.0.255  172.16.1.0  0.0.0.255  eq  23

R4(config)#  access-list  101  permit  ip  any   any

R4(config)#  int  e0/2

R4(config-if)#  ip   access-group   101  in

R4(config-if)#  end

R4#


配置路由器R5

R5> en

R5#  config  t

R5(config)#  no  access-list  1

R5(config)#  int  e0/2

R5(config-if)#  no  ip  access-g roup  1  in

R5(config-if)#  exit

R5(config)#  

R5(config)#

R5(config)#  access-list  101  deny  tcp  10.10.1.0  0.0.0.255  172.16.5.0  0.0.0.255  eq  23

R5(config)#  access-list  101  permit  ip  any   any

R5(config)#  int  e0/2

R5(config-if)#  ip   access-group   101  in

R5(config-if)#  end

R5#


配置路由器R6

R6>  en

R6#  config  t

R6(config)#  enable  password  123

R6(config)#  line  vty  0  4

R6(config-line)#  password  123

R6(config-line)#  login

R6(config-line)#  end

R6#


配置路由器R7

R7>  en

R7#  config  t

R7(config)#  enable  password  123

R7(config)#  line  vty  0  4

R7(config-line)#  password  123

R7(config-line)#  login

R7(config-line)#  end

R7#


验证:

(1) 在R1上能ping通172.16.1.10和172.16.5.10

(2) 在R1上能telnet到172.16.1.10,不能telnet到172.16.5.10

(3) 在R2上能ping通172.16.1.10和172.16.5.10

(4) 在R2不能telnet到172.16.1.10,能telnet到172.16.5.10



转载于:https://my.oschina.net/it1693/blog/284480

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值