目的:
让
5.5.5
.0/24
到
4.4.4.0/24
路由:
R5
-
R2
-
R1
-
R4
让
25.0.0.0/24
到
4.4.4
.0/24
路由:
R5
-
R2
-
R3
-
R4
因为默认状态下跌幅:
R5
-
R2
-
R1
-
R4
第一步:全网互通
R5#traceroute
Protocol [ip]:
Target IP address: 4.4.4 .4
Source address: 5.5.5 .5
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 4.4.4 .4
1 25.0.0.2 168 msec 216 msec 144 msec
2 12.0.0 .1 240 msec 216 msec 360 msec
3 14.0.0 .4 456 msec 576 msec *
R5#traceroute
Protocol [ip]:
Target IP address: 4.4.4 .4
Source address: 25.0.0.5
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 4.4.4 .4
1 25.0.0.2 144 msec 120 msec
2 12.0.0 .1 216 msec 264 msec 216 msec
3 14.0.0 .4 444 msec * 392 msec
第二步:用
route-map
在
R2
上做非等价负载均衡
R2(config)#access-list 1 permit 25.0.0.5
R2(config)#route-map PBR permit 10
R2(config-route-map)#match ip add 1
R2(config-route-map)#set ip next-ho p 23.0.0 .3
R2(config)#route-map PBR permit 20
R2(config)#
R2(config)#
R2(config)#int f 0/0
R2(config-if)#ip policy route-map PBR
第三步:在
R2
是查看配制
R2#sh ip policy
Interface Route map
Fa0/0 PBR
R2#sh access-lists
Standard IP access list 1
10 permit 25.0.0.5
R2#sh route-map
route-map PBR, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
ip next-ho p 23.0.0 .3
Policy routing matches: 0 packets, 0 bytes
route-map PBR, permit, sequence 20
Match clauses:
Set clauses:
Policy routing matches: 0 packets, 0 bytes
第四步:用
traceroute
命令进行测试
R5#traceroute
Protocol [ip]:
Target IP address: 4.4.4 .4
Source address: 5.5.5 .5
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 4.4.4 .4
1 25.0.0.2 136 msec 132 msec 156 msec
2 12.0.0 .1 288 msec 288 msec 216 msec
3 14.0.0 .4 408 msec * 480 msec
R5#traceroute
Protocol [ip]:
Target IP address: 4.4.4 .4
Source address: 25.0.0.5
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 4.4.4 .4
1 25.0.0.2 216 msec 144 msec 144 msec
2 23.0.0 .3 216 msec 264 msec 312 msec
3 34.0.0.4 384 msec * 456 msec