Redistribute static command

danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
I have loopbacks on Router 1, where I issued
ip route 172.16.0.0 255.255.255.0 Null0
ip route 172.16.1.0 255.255.255.0 Null0
ip route 172.16.2.0 255.255.255.0 Null0
ip route 172.16.3.0 255.255.255.0 Null0

Then I went into router ospf 1
router-id 1.1.1.1
net 172.16.0.1 255.255.248.0 area 0
net 172.30.0.1 0.0.0.0 area 0 (which is the link to R2)

Then I did redistribute static subnets metric 200 metric-type 2

On R2 I did router ospf 1
net 172.30.0.2 0.0.0.0 area 0

I was expecting to get
O E2 172.16.0.0
O E2 172.16.1.0

Instead I'm getting this readout
E2 172.16.0.0
E2 172.16.1.0
etc...

Can someone help me understand what I did wrong?
On R1 I get the Inter Area route from R2's ospf network assignment for area 10 on the next segment.

Comments

  • networker050184networker050184 Mod Posts: 11,962 Mod
    Can you post the actual output from the routing table?
    An expert is a man who has made all the mistakes which can be made.
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    R1(config-router)#net 172.16.0.0 255.255.248.0 area 0
    R1(config-router)#do sh 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

    172.16.0.0/24 is subnetted, 4 subnets
    C 172.16.0.0 is directly connected, Loopback1
    C 172.16.1.0 is directly connected, Loopback2
    C 172.16.2.0 is directly connected, Loopback3
    C 172.16.3.0 is directly connected, Loopback4
    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:48:43, FastEthernet0/0


    R2#
    Gateway of last resort is not set

    172.16.0.0/32 is subnetted, 4 subnets
    O 172.16.1.1 [110/2] via 172.30.0.1, 00:00:12, FastEthernet0/0
    O 172.16.0.1 [110/2] via 172.30.0.1, 00:00:12, FastEthernet0/0
    O 172.16.3.1 [110/2] via 172.30.0.1, 00:00:12, FastEthernet0/0
    O 172.16.2.1 [110/2] via 172.30.0.1, 00:00:12, FastEthernet0/0
    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    C 172.30.10.0 is directly connected, Serial0/0

    E2 routing is not being recognized from R2 as I have setup with:
    R1(config-router)#redistribute static subnets metric 200 metric-type 2
  • networker050184networker050184 Mod Posts: 11,962 Mod
    So you have those networks as loopbacks and static routes right? If so when you are putting your network command in it is putting those loopback interfaces into OSPF and advertising them. The connected networks are going to be entered into the routing table rather than the statics.
    An expert is a man who has made all the mistakes which can be made.
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    E2 routing is not being recognized from R2 as I have setup with:
    R1(config-router)#redistribute static subnets metric 200 metric-type 2

    Because of the redistribute static, shouldn't I see this on R2 ?
    O E2 172.16.0.0
    O E2 172.16.1.0
  • networker050184networker050184 Mod Posts: 11,962 Mod
    No, the redistribution is not taking place because you have those networks as directly connected and being put into OSPF via your network command. The way redistribution works is it scrapes the routing table. Since those routes are showing as connected they aren't redistributed as static.

    If you don't put a network command for those networks and get ride of the loopbacks then it will work like you are wanting it to.
    An expert is a man who has made all the mistakes which can be made.
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    Okay, I took out net 172.16.0.0 0.0.7.255 area 0 on R1
    And now on R2 I get:
    Gateway of last resort is not set

    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    C 172.30.10.0 is directly connected, Serial0/0
    R2#

    Wonder why redistribute isn't carrying the loopbacks through to R2's table
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    Maybe I haven't mentioned it but the ip route assignments on R1 are as follows:
    ip route 172.16.0.0 255.255.255.0 Null0
    ip route 172.16.1.0 255.255.255.0 Null0
    ip route 172.16.2.0 255.255.255.0 Null0
    ip route 172.16.3.0 255.255.255.0 Null0

    The Null0 as I understand is to prevent loops.
  • networker050184networker050184 Mod Posts: 11,962 Mod
    Because loopbacks are not static routes. Now if you put redistribute connected then you'd be seeing what you want. Remember, redistribution pulls from the routing table so if you don't see the static routes in the routing table they will not be redistributed.
    An expert is a man who has made all the mistakes which can be made.
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    Sorry, I didn't ready fully your first correction. I think I'm understanding now. When they were connected by interface statements:
    172.16.0.0/24 is subnetted, 4 subnets
    C 172.16.0.0 is directly connected, Loopback1
    C 172.16.1.0 is directly connected, Loopback2
    C 172.16.2.0 is directly connected, Loopback3
    C 172.16.3.0 is directly connected, Loopback4
    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:20:19, FastEthernet0/0

    They would be passed up by the redistribute. Simply shown in R2's table as OSPF entries. However without the interface entries:
    172.16.0.0/24 is subnetted, 4 subnets
    S 172.16.0.0 is directly connected, Null0
    S 172.16.1.0 is directly connected, Null0
    S 172.16.2.0 is directly connected, Null0
    S 172.16.3.0 is directly connected, Null0
    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    O IA 172.30.10.0 [110/201] via 172.30.0.2, 00:23:34, FastEthernet0/0

    Obviously, because they are officially Static Routes they are propagated by redistribute command:
    172.16.0.0/24 is subnetted, 4 subnets
    O E2 172.16.0.0 [110/200] via 172.30.0.1, 00:00:31, FastEthernet0/0
    O E2 172.16.1.0 [110/200] via 172.30.0.1, 00:00:17, FastEthernet0/0
    O E2 172.16.2.0 [110/200] via 172.30.0.1, 00:00:14, FastEthernet0/0
    O E2 172.16.3.0 [110/200] via 172.30.0.1, 00:00:04, FastEthernet0/0
    172.30.0.0/24 is subnetted, 2 subnets
    C 172.30.0.0 is directly connected, FastEthernet0/0
    C 172.30.10.0 is directly connected, Serial0/0

    Therefore, It's because of the ip route statements that this is poss isn';t it:
    ip route 172.16.0.0 255.255.255.0 Null0
    ip route 172.16.1.0 255.255.255.0 Null0
    ip route 172.16.2.0 255.255.255.0 Null0
    ip route 172.16.3.0 255.255.255.0 Null0
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    So is it safe to say then that even though these loopbacks are attached to R1, that they are being looked at by R1 as routes coming in from an external source?
  • networker050184networker050184 Mod Posts: 11,962 Mod
    Yes they are external from OSPF's point of view on R1, but for the routing table they will be seen as static or connected depending on how you configure them.
    An expert is a man who has made all the mistakes which can be made.
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    does static and connected only differ from administrative distance being Connected is 0 and Static 1 or is there more to it?
  • networker050184networker050184 Mod Posts: 11,962 Mod
    Not sure what you are asking. Do you not understand the difference between a static route and a connected route?
    An expert is a man who has made all the mistakes which can be made.
  • Dieg0MDieg0M Member Posts: 861
    Because the AD of a loopback is 0 (directly connected interface) and the AD of a Static route is 1, if you have both configured for the same network on the router then only the Connected interface will appear in the routing table. Redistribute static command will only redistribute static routes in your routing table and in this example you only have connected routes. Use redistribute connected if you want the same result or take away the loopbacks.
    Follow my CCDE journey at www.routingnull0.com
  • danyzukodanyzuko Member Posts: 40 ■■□□□□□□□□
    Thank you, And This forum is definitely a great resource.
Sign In or Register to comment.