Skip to content

Commit dba3a0b

Browse files
authored
Merge pull request #1254 from kernelkit/ospf-fixes
Improvements to OSPF and BFD operational data and CLI commands
2 parents 57ec2dc + 612ef6e commit dba3a0b

File tree

19 files changed

+1642
-82
lines changed

19 files changed

+1642
-82
lines changed

doc/ChangeLog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ All notable changes to the project are documented in this file.
99
### Changes
1010

1111
- Upgrade Linux kernel to 6.12.57 (LTS)
12+
- Major improvements to OSPF and BFD operational data and CLI commands:
13+
- CLI commands now use data from the operational datastore instead of
14+
calling vtysh directly, providing better integration and consistency
15+
- New `show ip ospf` command family (neighbor, interface, route) to align
16+
with industry standard CLI conventions. Legacy `show ospf` commands are
17+
deprecated but still work with warnings
18+
- The `show ip ospf database` subcommand has been dropped for now, the
19+
advanced user can still use `vtysh` from Bash if necessary, issue #1253
20+
- Extended BFD commands: `show bfd` (status), `show bfd peers` (detailed),
21+
`show bfd peers brief` (table format), and `show bfd peer <address>`
22+
- All command names now use singular form (interface, route, neighbor)
23+
matching Cisco/FRR conventions, as well as configure context naming
24+
- New support for configuring OSPF interface priority for DR/BDR election
1225
- The DHCP client configuration has moved from `/infix-dhcp-client:dhcp-client`
1326
to `/interfaces/interface[name]/ipv4/infix-dhcp-client:dhcp`, issue #1109.
1427
The configuration is automatically migrated on upgrade. The DHCP client is
@@ -28,6 +41,9 @@ All notable changes to the project are documented in this file.
2841
### Fixes
2942

3043
- Fix #855: User admin sometimes fails to be added to `wheel` group
44+
- Fix #1247: Prevent invalid configuration of OSPF backbone area (0.0.0.0) as
45+
stub or NSSA. The backbone must always be a normal area per RFC 2328. Any
46+
existing invalid configurations are automatically corrected during upgrade
3147
- Fix serious regression in boot time, introduced in v25.10, delays the
3248
boot step "Mounting filesystems ..." with up to 30 seconds!
3349

doc/networking.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ In addition to basic status shown in the interface overview, detailed
562562
LAG status can be inspected:
563563

564564
```
565-
admin@example:/> show interfaces name lag0
565+
admin@example:/> show interface lag0
566566
name : lag0
567567
index : 25
568568
mtu : 1500
@@ -582,7 +582,7 @@ out-octets : 2142
582582
Same aggregate, but in LACP mode:
583583

584584
```
585-
admin@example:/> show interfaces name lag0
585+
admin@example:/> show interface lag0
586586
name : lag0
587587
index : 24
588588
mtu : 1500
@@ -624,7 +624,7 @@ Member ports provide additional status information:
624624
Example member port status:
625625

626626
```
627-
admin@example:/> show interfaces name eth7
627+
admin@example:/> show interface eth7
628628
name : eth7
629629
index : 8
630630
mtu : 1500
@@ -755,7 +755,7 @@ The speed and duplex status for the links can be listed as shown
755755
below, assuming the link operational status is 'up'.
756756

757757
```
758-
admin@example:/> show interfaces name eth1
758+
admin@example:/> show interface eth1
759759
name : eth1
760760
index : 2
761761
mtu : 1500
@@ -769,7 +769,7 @@ ipv6 addresses :
769769
in-octets : 75581
770770
out-octets : 43130
771771
...
772-
admin@example:/> show interfaces name eth4
772+
admin@example:/> show interface eth4
773773
name : eth4
774774
index : 5
775775
mtu : 1500
@@ -827,7 +827,7 @@ require auto-negotiation to be enabled.
827827
Ethernet packet statistics[^6] can be listed as shown below.
828828

829829
```
830-
admin@example:/> show interfaces name eth1
830+
admin@example:/> show interface eth1
831831
name : eth1
832832
index : 2
833833
mtu : 1500
@@ -1525,10 +1525,10 @@ currently supported, namely `ipv4` and `ipv6`.
15251525
[^3]: For example, IPv4 groups are mapped to MAC multicast addresses by
15261526
mapping the low-order 23-bits of the IP address in the low-order 23
15271527
bits of the Ethernet address 01:00:5E:00:00:00. Meaning, more than
1528-
one IP multicast group maps to the same MAC multicast group.
1528+
one IP multicast group maps to the same MAC multicast group.
15291529
[^4]: A YANG deviation was previously used to make it possible to set
15301530
`phys-address`, but this has been replaced with the more flexible
1531-
`custom-phys-address`.
1531+
`custom-phys-address`.
15321532
[^5]: MAC bridges on Marvell Linkstreet devices are currently limited to
15331533
a single MAC database, this may be a problem if the same MAC address
15341534
appears in different MAC bridges.

doc/wifi.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Wi-Fi support is primarily tested with Realtek chipset-based adapters.
2727
## Configuration
2828

2929
Add a supported Wi-Fi network device. To verify that it has been
30-
detected, look for `wifi0` in `show interfaces`
30+
detected, look for `wifi0` in `show interface`
3131

3232
```
33-
admin@example:/> show interfaces
33+
admin@example:/> show interface
3434
INTERFACE PROTOCOL STATE DATA
3535
lo loopback UP
3636
ipv4 127.0.0.1/8 (static)
@@ -52,7 +52,7 @@ see the result read the operational datastore for interface `wifi0` or
5252
use the CLI
5353

5454
```
55-
admin@infix-00-00-00:/> show interfaces name wifi0
55+
admin@infix-00-00-00:/> show interface wifi0
5656
name : wifi0
5757
type : wifi
5858
index : 3
@@ -119,11 +119,11 @@ admin@example:/config/interface/wifi0/> leave
119119

120120
The Wi-Fi negotiation should now start immediately, provided that the
121121
SSID and pre-shared key are correct. You can verify the connection by
122-
running `show interfaces` again.
122+
running `show interface` again.
123123

124124

125125
```
126-
admin@example:/> show interfaces
126+
admin@example:/> show interface
127127
INTERFACE PROTOCOL STATE DATA
128128
lo loopback UP
129129
ipv4 127.0.0.1/8 (static)
@@ -139,14 +139,14 @@ admin@example:/>
139139

140140
## Troubleshooting Connection Issues
141141

142-
Use `show wifi scan wifi0` and `show interfaces` to verify signal strength
142+
Use `show wifi scan wifi0` and `show interface` to verify signal strength
143143
and connection status. If issues arise, try the following
144144
troubleshooting steps:
145145

146146
1. **Verify signal strength**: Check that the target network shows "good" or "excellent" signal
147147
2. **Check credentials**: Verify the preshared key in `ietf-keystore`
148148
3. **Review logs**: Check system logs with `show log` for Wi-Fi related errors
149149
4. **Regulatory compliance**: Ensure the country-code matches your location
150-
5. **Hardware detection**: Confirm the adapter appears in `show interfaces`
150+
5. **Hardware detection**: Confirm the adapter appears in `show interface`
151151

152152
If issues persist, check the system log for specific error messages that can help identify the root cause.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
# Remove area-type from OSPF backbone area (0.0.0.0)
3+
# The backbone area cannot be configured as stub or NSSA per RFC 2328/3101
4+
# Silently drop any area-type setting for area 0.0.0.0
5+
6+
file=$1
7+
temp=${file}.tmp
8+
9+
jq '
10+
if .["ietf-routing:routing"]?."control-plane-protocols"?."control-plane-protocol" then
11+
.["ietf-routing:routing"]."control-plane-protocols"."control-plane-protocol" |= map(
12+
if .["ietf-ospf:ospf"]?.areas?.area then
13+
.["ietf-ospf:ospf"].areas.area |= map(
14+
if (.["area-id"] == "0.0.0.0") and .["area-type"] then
15+
# Remove area-type from backbone area
16+
del(.["area-type"])
17+
else
18+
.
19+
end
20+
)
21+
else
22+
.
23+
end
24+
)
25+
else
26+
.
27+
end
28+
' "$file" > "$temp" && mv "$temp" "$file"
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
migratedir = $(pkgdatadir)/migrate/1.6
22
dist_migrate_DATA = 10-dhcp-client-to-ipv4.sh \
3-
20-autoconf-to-presence.sh
3+
20-autoconf-to-presence.sh \
4+
30-ospf-backbone-area-type.sh

src/confd/src/ietf-routing.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
3838
area_id = lydx_get_cattr(area, "area-id");
3939

4040
LY_LIST_FOR(lyd_child(interfaces), interface) {
41-
const char *hello, *dead, *retransmit, *transmit, *interface_type, *cost;
41+
const char *hello, *dead, *retransmit, *transmit, *interface_type, *cost, *priority;
4242

4343
if (lydx_get_bool(interface, "enabled")) {
4444
int passive = 0, bfd_enabled = 0;
@@ -57,6 +57,7 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
5757
transmit = lydx_get_cattr(interface, "transmit-delay");
5858
interface_type = lydx_get_cattr(interface, "interface-type");
5959
cost = lydx_get_cattr(interface, "cost");
60+
priority = lydx_get_cattr(interface, "priority");
6061

6162
fprintf(fp, " ip ospf area %s\n", area_id);
6263
if (dead)
@@ -67,6 +68,8 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
6768
fprintf(fp, " ip ospf retransmit-interval %s\n", retransmit);
6869
if (transmit)
6970
fprintf(fp, " ip ospf transmit-delay %s\n", transmit);
71+
if (priority)
72+
fprintf(fp, " ip ospf priority %s\n", priority);
7073
if (bfd_enabled)
7174
fputs(" ip ospf bfd\n", fp);
7275
if (passive)

src/confd/yang/confd.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ MODULES=(
1111
1212
1313
"[email protected] -e bfd -e explicit-router-id"
14+
15+
16+
17+
1418
1519
# NOTE: ietf-tls-client must be version matched with ietf-tls-server, used by netopeer2!
1620
@@ -22,7 +26,7 @@ MODULES=(
2226
2327
2428
25-
"infix-routing@2024-11-27.yang"
29+
"infix-routing@2025-11-12.yang"
2630
2731
2832
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
module ietf-bfd-ip-sh {
2+
yang-version 1.1;
3+
namespace "urn:ietf:params:xml:ns:yang:ietf-bfd-ip-sh";
4+
prefix bfd-ip-sh;
5+
6+
import ietf-bfd-types {
7+
prefix bfd-types;
8+
reference
9+
"RFC 9314: YANG Data Model for Bidirectional Forwarding
10+
Detection (BFD)";
11+
}
12+
import ietf-bfd {
13+
prefix bfd;
14+
reference
15+
"RFC 9314: YANG Data Model for Bidirectional Forwarding
16+
Detection (BFD)";
17+
}
18+
import ietf-interfaces {
19+
prefix if;
20+
reference
21+
"RFC 8343: A YANG Data Model for Interface Management";
22+
}
23+
import ietf-inet-types {
24+
prefix inet;
25+
reference
26+
"RFC 6991: Common YANG Data Types";
27+
}
28+
import ietf-routing {
29+
prefix rt;
30+
reference
31+
"RFC 8349: A YANG Data Model for Routing Management
32+
(NMDA Version)";
33+
}
34+
35+
organization
36+
"IETF BFD Working Group";
37+
contact
38+
"WG Web: <https://datatracker.ietf.org/wg/bfd/>
39+
WG List: <mailto:[email protected]>
40+
41+
Editor: Reshad Rahman
42+
43+
44+
Editor: Lianshu Zheng
45+
46+
47+
Editor: Mahesh Jethanandani
48+
<mailto:[email protected]>";
49+
description
50+
"This module contains the YANG definition for BFD IP single-hop
51+
as per RFC 5881.
52+
53+
Copyright (c) 2022 IETF Trust and the persons identified as
54+
authors of the code. All rights reserved.
55+
56+
Redistribution and use in source and binary forms, with or
57+
without modification, is permitted pursuant to, and subject
58+
to the license terms contained in, the Revised BSD License
59+
set forth in Section 4.c of the IETF Trust's Legal Provisions
60+
Relating to IETF Documents
61+
(https://trustee.ietf.org/license-info).
62+
63+
This version of this YANG module is part of RFC 9314; see the
64+
RFC itself for full legal notices.";
65+
reference
66+
"RFC 5881: Bidirectional Forwarding Detection (BFD)
67+
for IPv4 and IPv6 (Single Hop)
68+
RFC 9314: YANG Data Model for Bidirectional Forwarding
69+
Detection (BFD)";
70+
71+
revision 2022-09-22 {
72+
description
73+
"Updating reference to RFC 9314.";
74+
reference
75+
"RFC 9314: YANG Data Model for Bidirectional Forwarding
76+
Detection (BFD).";
77+
}
78+
revision 2021-10-21 {
79+
description
80+
"Initial revision.";
81+
reference
82+
"RFC 9127: YANG Data Model for Bidirectional Forwarding
83+
Detection (BFD)";
84+
}
85+
86+
augment "/rt:routing/rt:control-plane-protocols/"
87+
+ "rt:control-plane-protocol/bfd:bfd" {
88+
description
89+
"BFD augmentation for IP single-hop.";
90+
container ip-sh {
91+
description
92+
"BFD IP single-hop top-level container.";
93+
uses bfd-types:session-statistics-summary;
94+
container sessions {
95+
description
96+
"BFD IP single-hop sessions.";
97+
list session {
98+
key "interface dest-addr";
99+
description
100+
"List of IP single-hop sessions.";
101+
leaf interface {
102+
type if:interface-ref;
103+
description
104+
"Interface on which the BFD session is running.";
105+
}
106+
leaf dest-addr {
107+
type inet:ip-address;
108+
description
109+
"IP address of the peer.";
110+
}
111+
leaf source-addr {
112+
type inet:ip-address;
113+
description
114+
"Local IP address.";
115+
}
116+
uses bfd-types:common-cfg-parms;
117+
uses bfd-types:all-session;
118+
}
119+
}
120+
list interfaces {
121+
key "interface";
122+
description
123+
"List of interfaces.";
124+
leaf interface {
125+
type if:interface-ref;
126+
description
127+
"BFD information for this interface.";
128+
}
129+
uses bfd-types:auth-parms;
130+
}
131+
}
132+
}
133+
134+
notification singlehop-notification {
135+
description
136+
"Notification for BFD single-hop session state change. An
137+
implementation may rate-limit notifications, e.g., when a
138+
session is continuously changing state.";
139+
uses bfd-types:notification-parms;
140+
leaf interface {
141+
type if:interface-ref;
142+
description
143+
"Interface to which this BFD session belongs.";
144+
}
145+
leaf echo-enabled {
146+
type boolean;
147+
description
148+
"Indicates whether Echo was enabled for BFD.";
149+
}
150+
}
151+
}

0 commit comments

Comments
 (0)