In older IOS Code, there was a specific requirement for redistributing OSPF Subnets. In almost every case, the keyword “subnets” had to be added to the redistribute command.
Older Code Example–
//notice the warning when 'subnets' is omitted R1(config)#router ospf 1 R1(config-router)#redistribute eigrp 1 % Only classful networks will be redistributed //and the configuration is stored exactly as it was typed R1(config-router)#do show run | sec router router ospf 1 log-adjacency-changes redistribute eigrp 1 //we can change the behavior by adding 'subnets' R1(config-router)#redistribute eigrp 1 subnets //after adding, it is stored as one would expect R1(config-router)#do show run | sec router router ospf 1 log-adjacency-changes redistribute eigrp 1 subnets
When I tested this in VIRL running 15.6(1S) running inside of IOS XE 3.17, the warning goes away. The question I had is whether it is still relevant or not.
Current Code Example–
//without the 'subnets' keyword csr1000v-2(config)#router ospf 1 csr1000v-2(config-router)#redistribute eigrp 1 csr1000v-2(config-router)#do show run | sec router router ospf 1 redistribute eigrp 1 //with the 'subnets' keyword csr1000v-2(config-router)#redistribute eigrp 1 subnets csr1000v-2(config-router)#do show run | sec router router ospf 1 redistribute eigrp 1 subnets
I initially spent some time experimenting with this and thought that ‘subnets‘ had completely lost its relevance. However, the keyword kept popping up on its own. What I finally discovered is that IOS adds it later in in some cases. Take a close look at this strange behavior.
//blank out the IGP config csr1000v-2(config)#no router eigrp 1 csr1000v-2(config)#no router ospf 1 router ospf 1 redistribute eigrp 1 network 10.0.0.17 0.0.0.0 area 0 //check the running-config csr1000v-2(config-router)#do show run | sec ospf router ospf 1 redistribute eigrp 1 network 10.0.0.17 0.0.0.0 area 0 //now let's start the EIGRP config and check again //notice the keyword is still missing csr1000v-2(config-router)#router eigrp 1 csr1000v-2(config-router)#do show run | sec router router eigrp 1 router ospf 1 redistribute eigrp 1 network 10.0.0.17 0.0.0.0 area 0 //now let's add a network statement to initiate //the EIGRP process and check once more //now the 'subnets' keyword has magically appeared csr1000v-2(config-router)#router eigrp 1 csr1000v-2(config-router)#network 10.0.0.6 0.0.0.0 csr1000v-2(config-router)#do show run | sec router router eigrp 1 network 10.0.0.6 0.0.0.0 router ospf 1 redistribute eigrp 1 subnets network 10.0.0.17 0.0.0.0 area 0
Notice what happened? After having a completely configured EIGRP process, the OSPF redistribution statement added the ‘subnets’ keyword. How strange is that? What would you even consider the default to be now? The documentation seems to indicate the default to not advertise subnets. However, there are cases that I don’t even think you can get rid of the keyword and behavior.
Disclaimer: This article includes the independent thoughts, opinions, commentary or technical detail of Paul Stewart. This may or may does not reflect the position of past, present or future employers.
Strange, I came across exactly this yesterday, however I was recreating our L3 environment (as best I could) in GNS3. On our Nexus 7000 in the working environemnt we have
redistribute static route-map STATIC
However, in GNS3 (IOS 12.4) if we try this it says:
% Only classful networks will be redistributed
To properly get it working the inclusion of the “subnets” keyword is necessary
It sort of seems silly that it doesn’t just automagically include ‘subnets’ in any redistribution efforts. I guess it works like I would want it to in NX-OS (which is quite different). Thanks for sharing.
Just configuring redistribution and looking for the parameter “subnets” automatically added by IOS 15.3(3) C7200-ADVENTERPRISEK9
I suspected OSPF should add “subnets” if it received LSA from subnetted links, and configured classful networks. But “subnets” still always appears by itself.
Cheers