中级会员 
 精华: 1
 积分: 376
 帖子: 40  威望: 132 点 金钱: 87 币 贡献: 65 点 经验: 02级
 阅读权限: 30
 注册: 2007-8-17
 状态:
|
1#
大 中
小 发表于 2007-11-14 09:29 只看该作者
offset-list控制单个路由metric
实验offset-list与访问控制列表结合对单个路由的metric控制
offset-list适用于距离矢量路由协议,本实验采用RIPv2以及EIGRP,可对照实验手册二下册16.3进行实验
Topo 如下:
分别控制路由条目1.1.1.0/24,2.2.2.0/24,5.5.5.0/24,3.3.3.0/24
8.8.8.0/24做为比对。
配置如下:
r1#sh ru
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 10.1.1.1 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
!
router eigrp 100
offset-list 21 in 1888256 Ethernet0/0
#对控制列表21 的EIGRP路由度量值修改
offset-list 25 out 1888256 Ethernet0/0
#对控制列表25的EIGRP路由度量值修改
network 1.1.1.0 0.0.0.255
network 10.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
no auto-summary
!
access-list 21 permit 2.2.2.0
access-list 21 permit 5.5.5.0
access-list 21 deny
any
access-list 25 permit 1.1.1.0
access-list 25 deny
any
!
End
r2#sh ru
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Loopback1
ip address 5.5.5.5 255.255.255.0
!
interface Loopback2
ip address 8.8.8.8 255.255.255.0
!
interface Ethernet0/0
ip address 10.1.1.2 255.255.255.0
!
interface Serial1/0
ip address 23.1.1.2 255.255.255.0
!
interface Serial2/0
ip address 12.1.1.2 255.255.255.0
!
router eigrp 100
network 2.2.2.0 0.0.0.255
network 5.5.5.0 0.0.0.255
network 8.8.8.0 0.0.0.255
network 10.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
no auto-summary
!
router rip
version 2
network 23.0.0.0
no auto-summary
!
End
r3#sh ru
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial2/0
ip address 23.1.1.3 255.255.255.0
!
router rip
version 2
offset-list 0 out 10 Serial2/0
#对所有出去的RIP路由度量值修改(0代表所有)
network 3.0.0.0
network 23.0.0.0
no auto-summary
!
End
r1#sh ip eigrp topo
IP-EIGRP Topology Table for AS(100)/ID(1.1.1.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 1.1.1.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 2.2.2.0/24, 2 successors, FD is 2297856
via 12.1.1.2 (2297856/128256), Serial1/0
via 10.1.1.2 (2297856/2016512), Ethernet0/0
P 5.5.5.0/24, 2 successors, FD is 2297856
via 12.1.1.2 (2297856/128256), Serial1/0
via 10.1.1.2 (2297856/2016512), Ethernet0/0
P 8.8.8.0/24, 1 successors, FD is 409600
#8.8.8.0的路由未做控制所以保持不变
via 10.1.1.2 (409600/128256), Ethernet0/0
via 12.1.1.2 (2297856/128256), Serial1/0
P 10.1.1.0/24, 1 successors, FD is 281600
via Connected, Ethernet0/0
P 12.1.1.0/24, 1 successors, FD is 2169856
via Connected, Serial1/0
r1# sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
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
2.0.0.0/24 is subnetted, 1 subnets
D
2.2.2.0 [90/2297856] via 10.1.1.2, 00:42:06, Ethernet0/0
[90/2297856] via 12.1.1.2, 00:42:06, Serial1/0
5.0.0.0/24 is subnetted, 1 subnets
D
5.5.5.0 [90/2297856] via 10.1.1.2, 00:42:06, Ethernet0/0
[90/2297856] via 12.1.1.2, 00:42:06, Serial1/0
8.0.0.0/24 is subnetted, 1 subnets
D
8.8.8.0 [90/409600] via 10.1.1.2, 00:00:14, Ethernet0/0
10.0.0.0/24 is subnetted, 1 subnets
C
10.1.1.0 is directly connected, Ethernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C
12.1.1.0 is directly connected, Serial1/0
r2#sh ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(5.5.5.5)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 1.1.1.0/24, 2 successors, FD is 2297856
via 12.1.1.1 (2297856/128256), Serial2/0
via 10.1.1.1 (2297856/2016512), Ethernet0/0
P 2.2.2.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 5.5.5.0/24, 1 successors, FD is 128256
via Connected, Loopback1
P 8.8.8.0/24, 1 successors, FD is 128256
via Connected, Loopback2
P 10.1.1.0/24, 1 successors, FD is 281600
via Connected, Ethernet0/0
P 12.1.1.0/24, 1 successors, FD is 2169856
via Connected, Serial2/0
r2#sh ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
D
1.1.1.0 [90/2297856] via 12.1.1.1, 00:00:25, Serial2/0
[90/2297856] via 10.1.1.1, 00:00:25, Ethernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C
2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
R
3.3.3.0 [120/11] via 23.1.1.3, 00:00:16, Serial1/0
5.0.0.0/24 is subnetted, 1 subnets
C
5.5.5.0 is directly connected, Loopback1
23.0.0.0/24 is subnetted, 1 subnets
C
23.1.1.0 is directly connected, Serial1/0
8.0.0.0/24 is subnetted, 1 subnets
C
8.8.8.0 is directly connected, Loopback2
10.0.0.0/24 is subnetted, 1 subnets
C
10.1.1.0 is directly connected, Ethernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C
12.1.1.0 is directly connected, Serial2/0
当然,rip也可以做单个路由metric控制,这里就不列举了。
|