Tuesday 6 March 2012

Okay, i thought i would now revert the changes back, so that R2 favours going via R1 for the network 10.1.0.0/24 .... but then thought, lets make it interesting, lets get the preferred route back to go via R2 via some policy routing! yeah boi!


So currently, we are still going via R3 to get to 10.1.0.0/24 - due to lower AD change :0)


R2#  show ip route | i 10.1.0.0
D EX    10.1.0.0 [101/6917120] via 10.1.23.3, 00:26:49, Serial0/0

Lets create an ACL that will match any traffic talking to the network 10.1.0.0/24

R2#show run | s NEXT-HOP
ip access-list extended NEXT-HOP
 permit ip any 10.1.0.0 0.0.0.255


then lets have a new route map, match any traffic in that ACL and set the next-hop to R1 :0)

R2#show run | s route-map HOP
route-map HOP permit 10
 match ip address NEXT-HOP
 set ip next-hop 10.1.12.1


Lets apply the new route-map under the serial interface of R2


R2(config)interface Serial0/2
 ip policy route-map HOP



Lets restest:
 
 R4#traceroute 10.1.0.1

Type escape sequence to abort.
Tracing the route to 10.1.0.1

  1 10.1.24.2 44 msec 8 msec 0 msec
  2 10.1.12.1 28 msec *  12 msec
  <---- Our Friend R1

R4#show ip route | i 10.1.0.0
D EX    10.1.0.0 [170/7429120] via 10.1.24.2, 00:35:45, Serial0/0


Lets check the route-map;
R2#show route-map HOP
route-map HOP, permit, sequence 10
  Match clauses:
    ip address (access-lists): NEXT-HOP
  Set clauses:
    ip next-hop 10.1.12.1
  Policy routing matches: 11 packets, 712 bytes


SWEEEEEET

No comments:

Post a Comment