CCIE實驗室考試指南(2)

lab 02 -
 
policy routing
the following scenario refers to the diagram below.

scenario:
all routers are configured in a single ospf area.
router_c, based on the cost metric for ospf will send all packets with
a destination network address of 10.4.0.0 out the e0 interface.
problem:
have all packets destined for network 10.4.0.0 exit the serial 0
router_c.
router_c#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
10.0.0.0/16 is subnetted, 3 subnets
c 10.2.0.0 is directly connected,
serial0
c 10.3.0.0 is directly connected,
ethernet0
o 10.4.0.0 [110/74] via 10.3.0.1,
00:00:13, ethernet0

solution:
policy routing will allow you to configure a route map. the route map
will be used by the router in lieu of destination routing.
in this scenario the best route to the destination network 10.4.0.0 is
to go ethernet. we want to force the route to take the serial
connection.
step 1
configure a route map tag. i chose "takeserial".
step 2
point the route map to the tag. don’t let the 10 shake you it is just a
sequence number.
router_c(config)#route-map
takeserial permit ?
<0-65535>
sequence to insert to/delete
from existing route-map entry
step 3
identify which packet should be route mapped. in our example we will
match the ip address of access list 1.
step 4
tell the router where to send the matched packet. we will send the
packets to serial 0.
current configuration:
!
version 11.2
!
hostname router_c
!
!
!
interface ethernet0
ip address 10.3.0.3 255.255.0.0
!
interface ethernet1
ip address 10.1.0.3 255.255.0.0
ip policy route-map takeserial*step 1
!
interface serial0
ip address 10.2.0.1 255.255.0.0
clockrate 38400
!
interface serial1
no ip address
shutdown
!
router ospf 100
network 10.0.0.0 0.255.255.255 area 0

no ip classless
access-list 1 permit 10.1.0.5
route-map takeserial permit 10 *step 2
match ip address 1 *step 3
set interface serial0 *step 4
!
line con 0
line aux 0
line vty 0 4
login
!
end
now we will ping 10.4.0.2 from workstaton a:
router_c#debug ip policy
policy routing debugging is on
router_c#
ip: s=10.1.0.5 (ethernet1), d=10.4.0.2,
len 74, policy match
ip: route map takeserial, item 10,
permit
ip: s=10.1.0.5 (ethernet1),
d=10.4.0.2 (serial0),
len 74, policy routed
ip: ethernet1 to serial0 10.4.0.2
ip: s=10.1.0.5 (ethernet1), d=10.4.0.2,
len 74, policy match
ip: route map takeserial, item 10,
permit
ip: s=10.1.0.5 (ethernet1),
d=10.4.0.2 (serial0),
len 74, policy routed
ip: ethernet1 to serial0 10.4.0.2
ip: s=10.1.0.5 (ethernet1), d=10.4.0.2,
len 74, policy match
ip: route map takeserial, item 10,
permit
ip: s=10.1.0.5 (ethernet1),
d=10.4.0.2 (serial0),
len 74, policy routed
ip: ethernet1 to serial0 10.4.0.2
ip: s=10.1.0.5 (ethernet1), d=10.4.0.2,
len 74, policy match
ip: route map takeserial, item 10,
permit
ip: s=10.1.0.5 (ethernet1),
d=10.4.0.2 (serial0),
len 74, policy routed
ip: ethernet1 to serial0 10.4.0.2