Well, there is no best practice. This is mainly depending on your design. You need to provide us with some more details about your networks and the goals you want to achieve in order to compare and contrast the two options. There is no right or wrong.
Generally, "redistribute xxx" commands are mainly - but no exclusively - used to advertise routes coming from other routing procotols such as BGP or static routing into OSPF. A network command, however, advertises prefixes which you have directly on your router (e.g. have a (vlan) interface).
Redistribution generated Type-5 LSAs and makes your router an ASBR (autonomous system border router). Depending on your design you may or may not want this. Cost/Metric control is different with external routes. Behavior in a multi-area design is also different, especially in cases with stub areas.
So in sum, for simple networks you can go either way with no notable difference. I suggest you go the "internal" way, meaning you use the "network" statement for "connected" routes. In more complex scenarios you should maybe read through the OSPF theory in more detail and decide afterwards what's the best way for you or provide us with some more insights to your entire network and ask for specific advise.
Regards,
Thomas
------------------------------
Thomas Siegenthaler
------------------------------
Original Message:
Sent: Apr 27, 2022 12:53 PM
From: richard ford
Subject: OSPF and DHCP Server instances
Thank you, I am trying to figure out which would be the better, my understanding is the redistribute is good if you have multiple routing protocols, but the network command gives more control...
------------------------------
rford1219
Original Message:
Sent: Apr 26, 2022 04:40 AM
From: Thomas Siegenthaler
Subject: OSPF and DHCP Server instances
Hi there
I assume your two switches do not share the same L2 networks (e.g. the ones where the laptops are connected) and routing is involved to get from one side to the other. If that's the case, you need to advertise the subnets behind each router to the other OSPF routers in order to get end-to-end connectivity between hosts in the networks.
Whether that be internal OSPF routes ("network x.x.x.x") or external routes ("redistribute XXXX") depends on your OSPF planning and preferences. Either option would work but may be different when it comes to choosing paths out of many.
In the end you want to see a route to the destination network in your router's routing table ("show ip route" [vrf xxx]).
I hope this helps.
Best,
Thomas
------------------------------
Thomas Siegenthaler
Original Message:
Sent: Apr 25, 2022 03:08 PM
From: richard ford
Subject: OSPF and DHCP Server instances
I am setting up some switches on a bench that I am going to be installing/ replacing others with. I am using OSPF for routing and each switch I am setting up to do their own DHCP services.
I have OSPF configured and I am able to ping all the IPs I am using (It is a point to point setup). I have DHCP set up on two switches right now. I have a laptop connected to each switch. Each laptop picks up an IP from the pools I made.
I was wondering, would I need to use the redistribute connected command or add the network command for each pool I make so that the two laptops can talk to each other?
------------------------------
rford1219
------------------------------