Changing OSPF next hop and metric

wavewave Posts: 342Member
Hi guys,

I did the end of chapter 5 quiz in the ROUTE FLG last night and then went back and reviewed table 5-1 on page 422 (attached).

I've been left scratching my head a little about this:

Characteristic "Next hop" can be changed under OSPF for external routes at redistribution points and for EIGRP "Next hop "Can be set for all routes under various conditions.

I haven't labbed it yet but I'm sure that next-hop could be set in a route-map for ALL OSPF routes during redistribution, not just external routes. Does anyone know the answer to this? Aren't all routes essentially external routes during redistribution (well, after they've been redistributed)...

Also under "Metric" it says this can be changed for OSPF external routes at redistribution points. In the labs I did I was able to change the metrics of all OSPF routes at a redistribution point, not just external routes. For EIGRP Metric "Can be set using route-maps"...I'm reading this thinking that it's done for both OSPF and EIGRP using route-maps. Correct?


ROUTE Passed 1 May 2012
SWITCH Passed 25 September 2012
TSHOOT Passed 23 October 2012
Taking CCNA Security in April 2013 then studying for the CISSP

Comments

  • wavewave Posts: 342Member
    I just tried to set a next-hop ip for an O E2 route redistributed into EIGRP. I created an access list for the route I wanted to change and a route-map using a match on that ACL and a set ip next-hop xxx.xxx.xxx.xxx The route was redistributed but the next-hop wasn't changed.

    Edit: I've tried to set a next-hop IP both ways, from OSPF into EIGRP and EIGRP into OSPF and set ip seems to have no effect.

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    With your route-map use "match route-type external type-1 or type-2" then you can set next hop xxx.xxx.xxx.xxx.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    nomane wrote: »
    With your route-map use "match route-type external type-1 or type-2" then you can set next hop xxx.xxx.xxx.xxx.

    No that doesn't work:

    router eigrp 1
    redistribute ospf 1 metric 100000 100 255 1 1500 match external 1 external 2 route-map TESTER

    access-list 6 permit 172.16.2.0 0.0.0.255
    !
    route-map TESTER permit 10
    match ip address 6
    set ip next-hop 200.200.100.1

    Route appears on the other router as:

    D EX 172.16.2.0 [170/2195456] via 10.10.1.2, 00:01:47, Serial1/1

    So the next-hop parameter has no effect.

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    I think it should be more like this

    router eigrp 1
    redistribute ospf 1 metric 100000 100 255 1 1500 route-map TESTER

    !
    route-map TESTER permit 10
    match route-type external type-2
    set ip next-hop 200.200.100.1

    No need for the access list.

    Edit: This will only match the external OSPF routes
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    Sorry, also tried as you suggested:

    route-map TESTER permit 10
    match route-type external type-1 external type-2
    set ip next-hop 200.200.1.1

    ...that didn't work either

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    Can you show the OSPF route entry that you're trying to redistribution?
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    nomane wrote: »
    Can you show the OSPF route entry that you're trying to redistribution?

    O E2 172.16.2.0 [110/20] via 10.2.1.1, 00:24:18, Serial1/1

    Once I hit enter on the redistribute command line it appears on R1 as:

    D EX 172.16.2.0 [170/2195456] via 10.10.1.2, 00:06:15, Serial1/1

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    Can you show screen grab of your lab?

    I'm at work now but will try lab it up at home later.

    Is 200.200.100.1 a valid route for 172.16.2.0?

    You can set the next-hop with policy based routing on incoming interface.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    Here's a screen shot. Redistribution is happening on R4. From OSPF into EIGRP.

    10 minutes ago I was using an IP that didn't exisit as the next hop, but I just changed it to R2's interface as shown (172.16.12.2).

    When redistribution occurs the route is pushed from R4 to R1 and still has a next-hop of 10.10.1.2 out s1/1 which points to R1. I tried to point it to 172.16.12.2 which would send packets out R1's other serial interface to R2. R2 can successfully ping 172.16.2.1



    EDIT:

    172.16.2.1/24 is looopback0 on R2 redistributed into OSPF using redistribute connected subnets so it is redistributed as an E2 route. It finds is way down to R4 and when it lands on R1 it as a next hop of R4 even though I set the next-hop parameter to be R2's s1/0 interface with ip 172.16.12.2/24

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • wavewave Posts: 342Member
    Also - because this was really annoying me I also posted on the Cisco forums yesterday and got one response: https://learningnetwork.cisco.com/thread/40807?tstart=0

    Whilst I agree that the forward address can be changed in this way, and you will see my comment, the table refers to changing next-hop at the redistribution point.

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    You can't use set ip next-hop with OSPF to EIGRP, ISIS or RIP redistribution.

    It will only work with IGP protocols to BGP redistribution which makes sense with the way BGP next hop address works.

    You can verify the next hop address has changed with route-map with show BGP.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    nomane wrote: »
    You can't use set ip next-hop with OSPF to EIGRP, ISIS or RIP redistribution.

    It will only work with IGP protocols to BGP redistribution which makes sense with the way BGP next hop address works.

    You can verify the next hop address has changed with route-map with show BGP.

    Well in that case the table in the FLG is incorrect just as I suspected! It's also not accurate regarding metric either. By any chance did you find the answer in Cisco documentation?

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    Na, I found it by googling on some random forum. Then got it to work in the same lab as yours but BGP instead of EIGRP.

    I only try it with the set ip next-hop. Will try it again with the set metric with OSFP to EIGRP.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    Ah okay. I've labbed it to death and I can't get it to work so I'll take your word for it.

    They also say that the OSPF Metric can be changed for external routes at redistribution points. Actually it can be changed for ALL routes (External, Internal...Intra-Area) at redistribution points.

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    wave wrote: »
    Ah okay. I've labbed it to death and I can't get it to work so I'll take your word for it.

    Are you redistributing OSPF to BGP? How are you verifing that the next-hop has changed?

    It won't change in the routing table but you can verify that next has changed in BGP table with the show BGP command.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    nomane wrote: »
    Are you redistributing OSPF to BGP? How are you verifing that the next-hop has changed?

    No, sorry, I was meaning OSPF->EIGRP...Haven't tried OSPF -> BGP yet.

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
  • nomanenomane Posts: 15Member ■□□□□□□□□□
    Yeah, I don't think you'll get the set ip next-hop to work.

    The set metric works with redistributing OSPF to EIGRP.

    router eigrp 90
    redistribute ospf 1 metric 1 1 1 1 1 route-map TEST

    route-map TEST permit 10
    match route-type external
    set metric 100 14 2 1 4

    Check show ip eigrp topology before without the route-map and write down the metric.

    Then check again after the route-map is applied.
    CCDA ( ) - Dec 2012
    CCDP ( ) - 2013
  • wavewave Posts: 342Member
    nomane wrote: »
    Yeah, I don't think you'll get the set ip next-hop to work.

    The set metric works with redistributing OSPF to EIGRP.

    router eigrp 90
    redistribute ospf 1 metric 1 1 1 1 1 route-map TEST

    route-map TEST permit 10
    match route-type external
    set metric 100 14 2 1 4

    Check show ip eigrp topology before without the route-map and write down the metric.

    Then check again after the route-map is applied.

    Yep, I have that down...Cisco Press need to fix their table :P

    ROUTE Passed 1 May 2012
    SWITCH Passed 25 September 2012
    TSHOOT Passed 23 October 2012
    Taking CCNA Security in April 2013 then studying for the CISSP
Sign In or Register to comment.