思科实验:策略路由的实现

一、准备工作
1、画好实验拓朴图

2、配置三个路由器的端口IP。
3、配置三个路由器的路由(这里使用OSPF)。确认两端路由可达。

二、配置策略路由
1、在R2上配置access-list

[quote]
access-list 1 permit 1.1.1.0 0.0.0.255
[/quote]

2、在R2上配置 route-map
[quote]
route-map lan1 permit 10
match ip address 1
set ip next-hop 23.23.23.2
[/quote]

3、在R2的入口上配置 IP Policy
[quote]
ip policy route-map lan1
[/quote]

三、验证
1、启用OSPF后的R2路由表
[quote]
r2#sho 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
O 1.1.1.0 [110/74] via 12.12.12.1, 00:40:43, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0 [110/20] via 10.0.0.2, 00:40:43, Ethernet0/3
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial1/3
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Ethernet0/3
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial1/0
[/quote]

2、未启用策略路由时的路径
[quote]
r1#trace
r1#traceroute
Protocol [ip]:
Target IP address: 3.3.3.1
Source address: 1.1.1.1
Numeric display [n]:
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 3.3.3.1

1 12.12.12.2 92 msec 84 msec 20 msec
2 10.0.0.2 88 msec * 112 msec
[/quote]

3、启用策略路由时的路径
[quote]
r1#traceroute
Protocol [ip]:
Target IP address: 3.3.3.1
Source address: 1.1.1.1
Numeric display [n]:
Timeout in seconds [3]:
Probe count [3]:
Minimum Time to Live [1]:
Maximum Time to Live [30]:
Port Number [33434]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Type escape sequence to abort.
Tracing the route to 3.3.3.1

1 12.12.12.2 64 msec 100 msec 32 msec
2 23.23.23.2 152 msec * 160 msec
[/quote]

发表评论

电子邮件地址不会被公开。 必填项已用*标注