Chinaunix

标题: ACL访问控制列表 [打印本页]

作者: fsea    时间: 2007-05-16 22:09
标题: ACL访问控制列表

R1配置:
Router>en
Router#conf t
Router(config)#host R1
R1(config)#int loopback0
R1(config-if)#ip add 1.1.1.1  255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s1/2
R1(config-if)#ip add 12.0.0.1 255.255.255.0
Bad mask /24 for address 12.0.0.1
R1(config-if)#ip subnet-zero
R1(config)#int s1/2
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#^Z
R1#
R1#confi t
R1(config)#metric weight 5 4 3 2 1
R1(config)#router rip
R1(config-router)#net 1.0.0.0
R1(config-router)#net 12.0.0.0
R1(config-router)#^Z
R1#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:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 204/445/896 ms
R1#ping 23.0.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 296/704/1260 ms

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
R    3.0.0.0/8 [120/2] via 12.0.0.2, 00:00:22, Serial1/2
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.0.0 is directly connected, Serial1/2
R    23.0.0.0/8 [120/1] via 12.0.0.2, 00:00:22, Serial1/2

R2配置:
Router>en
R2(config)#int s2/1
R2(config-if)#ip add 12.0.0.2 255.255.255.0
R2(config-if)#no shut
R2(config)#int s2/3
R2(config-if)#ip add 23.0.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#^Z
R2#conf t
R2(config)#access-list 3 permit 1.0.0.0

R2(config)#router rip
R2(config-router)#net 12.0.0.0
R2(config-router)#net 23.0.0.0
R2(config-router)#offset 3 out 8 s2/3
R2(config-router)#exit
R2(config)#acc
R2(config)#access-list 3 permit 1.1.1.1
R2(config)#^Z

R3配:
Router>en
Router#conf t
Router(config)#host R3
R3(config)#int s3/2
R3(config-if)#ip add 23.0.0.3 255.255.255.0
Bad mask /24 for address 23.0.0.3
R3(config-if)#ip subnet-zero
R3(config)#int s3/2
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#int loopback1
R3(config-if)#ip add  3.3.3.3  255.255.255.0
R3(config)#router rip
R3(config-router)#net  3.0.0.0
R3(config-router)#net  23.0.0.0
R3(config-router)#^Z
R3#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 188/372/720 ms
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is not set
R    1.0.0.0/8 [120/5] via 23.0.0.2, 00:00:21, Serial3/2
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback1
R    12.0.0.0/8 [120/4] via 23.0.0.2, 00:00:21, Serial3/2
     23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial3/2








本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38497/showart_302914.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2