I know it's a bad practice, but I would like to know why it is not recommended. I tried to find it in RFC2328. It only said 0.0.0.0 indicates lack of DR/BDR. Does that mean I can use 0.0.0.0 on Point-to-point network?
1 Answer
I think you are confusing what the RFC says. While the Router ID is often written like an IPv4 address, it is really just a 32-bit number, and it can be written or configured as a number without the IPv4 dotted-decimal notation. I think the dotted-decimal notation to which you refer in the RFC is actually meaning an IPv4 address, not the Router ID:
Designated Router
The Designated Router selected for the attached network. The Designated Router is selected on all broadcast and NBMA networks by the Hello Protocol. Two pieces of identification are kept for the Designated Router: its Router ID and its IP interface address on the network. The Designated Router advertises link state for the network; this network-LSA is labelled with the Designated Router's IP address. The Designated Router is initialized to 0.0.0.0, which indicates the lack of a Designated Router.
As far as the Router ID in the RFC, it only says that it is an arbitrary 32-bit number. I don't see anything to prevent it from being anything in the 32-bit number range of 0
(0.0.0.0
) to 4294967295
(255.255.255.255.255
). Remember that you can put it in as a number or in dotted-decimal notation, but it is not an IPv4 address and does not follow IPv4 rules about the value, despite looking like an IPv4 address when using the dotted-decimal notation.
-
So theoretically router id 0 would work with other routers in OSPF? Though most vendors define router id 0 as no router id. .-.– Pue-TsuâCommented Jan 21, 2016 at 1:31
-
1By the RFC, I don't see any reason not to use
0
as the Router ID. Whether or not individual vendors allow you to configure it is up to each vendor and its implementation of OSPF. My guess is that most vendors don't allow you to configure it, but I don't have any evidence of that.– Ron Maupin ♦Commented Jan 21, 2016 at 1:37