实验要求:
l         标准访问控制列表
n         不允许<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />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         允许其他所有流量
(方法不唯一,我的只供参考
 
R1 的配置 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

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