Skip to content

Commit 9eb96b3

Browse files
committed
doc: add section on dummy interfaces
Fixes #769 Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 78591ef commit 9eb96b3

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

doc/iface.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,49 @@ admin@example:/config/interface/veth0a/> <b>set custom-phys-address chassis offs
138138
</code></pre>
139139

140140

141+
## Dummy Interface
142+
143+
A dummy interface is a virtual interface that is always administratively
144+
and operationally UP, regardless of any physical link state. It can
145+
hold IP addresses just like any other interface.
146+
147+
The two most common uses are:
148+
149+
- **Stable OSPF router-ID**: OSPF picks its router-ID from an interface
150+
address. If that interface goes down, adjacencies can flap. Binding
151+
the router-ID to a /32 address on a dummy avoids this.
152+
- **Stable management address**: A /32 on a dummy gives the device a
153+
permanent identity on the network, reachable as long as at least one
154+
uplink is up and the address is redistributed into the routing domain.
155+
156+
> [!TIP]
157+
> WiFi interfaces also use dummies as placeholders when the radio
158+
> hardware is not detected at boot (e.g., a USB dongle that was
159+
> unplugged). See [WiFi](wifi.md) for details.
160+
161+
### Example: Stable OSPF Router-ID
162+
163+
Create a dummy interface with a /32 address and use it as the OSPF
164+
router-ID so that the ID never changes when physical ports bounce:
165+
166+
<pre class="cli"><code>admin@example:/> <b>configure</b>
167+
admin@example:/config/> <b>edit interface lo0</b>
168+
admin@example:/config/interface/lo0/> <b>set type dummy</b>
169+
admin@example:/config/interface/lo0/> <b>set ipv4 address 192.0.2.1 prefix-length 32</b>
170+
admin@example:/config/interface/lo0/> <b>leave</b>
171+
admin@example:/config/> <b>edit routing control-plane-protocol ospfv2 name default ospf</b>
172+
admin@example:/config/routing/…/ospf/> <b>set explicit-router-id 192.0.2.1</b>
173+
admin@example:/config/routing/…/ospf/> <b>leave</b>
174+
admin@example:/> <b>copy running-config startup-config</b>
175+
</code></pre>
176+
177+
To also make the address reachable by other routers, redistribute
178+
connected routes (or add `lo0` as an OSPF interface):
179+
180+
<pre class="cli"><code>admin@example:/config/routing/…/ospf/> <b>set redistribute connected</b>
181+
</code></pre>
182+
183+
141184
[^1]: A YANG deviation was previously used to make it possible to set
142185
`phys-address`, but this has been replaced with the more flexible
143186
`custom-phys-address`.

src/confd/yang/confd/infix-if-type.yang

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ module infix-if-type {
6868
identity dummy {
6969
base infix-interface-type;
7070
base ianaift:other;
71-
description "Linux dummy interface. Useful mostly for testing.";
71+
description "Linux virtual interface that is always UP. Useful for
72+
stable loopback-style addresses, e.g., as a permanent
73+
management address or OSPF router-ID source.";
7274
}
7375
identity ethernet {
7476
base infix-interface-type;

0 commit comments

Comments
 (0)