Skip to content

Commit 00f69ba

Browse files
authored
Merge pull request #1039 from kernelkit/verify-ieee-group-fwd
Verify ieee group fwd
2 parents fa7c3d0 + aff385f commit 00f69ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+576
-182
lines changed

doc/ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ All notable changes to the project are documented in this file.
1212
- Upgrade netopeer2 (NETCONF) to 2.4.1
1313
- Add documentation on Infix upgrading and downgrading, issue #1009
1414
- Add HDMI and USB support for iMX8MP-evk
15+
- Enforced strict format for LLDP destination MAC address:
16+
- Only accepts colon-separated format: `01:80:C2:00:00:0E`
17+
- Add `show lldp` command to show discovered neighbors per interface.
18+
- Add configuration support for per-interface LLDP administrative status
1519

1620
### Fixes
1721
- Fix containers with multiple mounts
@@ -128,6 +132,7 @@ All notable changes to the project are documented in this file.
128132
- Add support for GRE/GRETAP tunnels
129133
- Add support for STP/RSTP on bridges
130134
- Add support for VXLAN tunnels
135+
- Add support for configuring global LLDP `message-tx-interval`
131136

132137
### Fixes
133138

doc/discovery.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ admin@infix-c0-ff-ee:~$
4646

4747
## LLDP
4848

49-
Infix supports LLDP (IEEE 802.1AB). For a device with factory default
49+
Infix supports LLDP (IEEE 802.1AB). For a device with factory default
5050
settings, the link-local IPv6 address can be read from the Management
5151
Address TLV using *tcpdump* or other sniffing tools[^1]:
5252

@@ -131,6 +131,10 @@ tcpdump: listening on tap0, link-type EN10MB (Ethernet), snapshot length 262144
131131
linux-pc:#
132132
```
133133

134+
The following capabilities are available via NETCONF/RESTCONF or the Infix CLI.
135+
136+
### LLDP Enable/Disable
137+
134138
The LLDP service can be disabled using the following commands.
135139

136140
```
@@ -140,6 +144,59 @@ admin@infix-c0-ff-ee:/config/> leave
140144
admin@infix-c0-ff-ee:/>
141145
```
142146

147+
To reenable it from the CLI config mode:
148+
149+
```
150+
admin@test-00-01-00:/config/> set lldp enabled
151+
admin@test-00-01-00:/config/> leave
152+
```
153+
154+
### LLDP Message Transmission Interval
155+
156+
By default, LLDP uses a `message-tx-interval` of 30 seconds, as defined
157+
by the IEEE standard. Infix allows this value to be customized.
158+
To change it using the CLI:
159+
160+
```
161+
admin@test-00-01-00:/config/> set lldp message-tx-interval 1
162+
admin@test-00-01-00:/config/> leave
163+
```
164+
165+
### LLDP Administrative Status per Interface
166+
167+
Infix supports configuring the LLDP administrative status on a per-port
168+
basis. The default mode is `tx-and-rx`, but the following options are
169+
also supported:
170+
171+
- `rx-only` – Receive LLDP packets only
172+
- `tx-only` – Transmit LLDP packets only
173+
- `disabled` – Disable LLDP on the interface
174+
175+
Example configuration:
176+
177+
```
178+
admin@test-00-01-00:/config/> set lldp port e8 dest-mac-address 01:80:C2:00:00:0E admin-status disabled
179+
admin@test-00-01-00:/config/> set lldp port e5 dest-mac-address 01:80:C2:00:00:0E admin-status rx-only
180+
admin@test-00-01-00:/config/> set lldp port e6 dest-mac-address 01:80:C2:00:00:0E admin-status tx-only
181+
admin@test-00-01-00:/config/> leave
182+
```
183+
184+
> [!NOTE]
185+
> The destination MAC address must be the standard LLDP multicast
186+
> address: `01:80:C2:00:00:0E`.
187+
188+
### Displaying LLDP Neighbor Information
189+
190+
In CLI mode, Infix also provides a convenient `show lldp` command to
191+
list LLDP neighbors detected on each interface:
192+
193+
```
194+
admin@test-00-01-00:/> show lldp
195+
INTERFACE REM-IDX TIME CHASSIS-ID PORT-ID
196+
e5 1 902 00:a0:85:00:04:01 00:a0:85:00:04:07
197+
e6 3 897 00:a0:85:00:03:01 00:a0:85:00:03:07
198+
e8 2 901 00:a0:85:00:02:01 00:a0:85:00:02:05
199+
```
143200

144201
## mDNS-SD
145202

src/confd/yang/confd.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ MODULES=(
2525
2626
2727
28-
"infix-lldp@2025-01-08.yang"
28+
"infix-lldp@2025-05-05.yang"
2929
3030
3131

src/confd/yang/confd/infix-lldp.yang

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ module infix-lldp {
1111
contact "[email protected]";
1212
description "Infix augments and deviations to ieee-dot1ab-lldp.";
1313

14+
revision 2025-05-05 {
15+
description
16+
"Restrict 'dest-mac-address' to only allow the LLDP multicast MAC
17+
address (01:80:C2:00:00:0E).";
18+
reference "internal";
19+
}
20+
1421
revision 2025-01-08 {
1522
description "Enable std. /lldp:lldp/message-tx-interval";
1623
}
@@ -32,6 +39,22 @@ module infix-lldp {
3239
}
3340
}
3441

42+
deviation "/lldp:lldp/lldp:port/lldp:dest-mac-address" {
43+
deviate replace {
44+
type string {
45+
pattern "([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}";
46+
}
47+
}
48+
}
49+
50+
deviation "/lldp:lldp/lldp:port/lldp:dest-mac-address" {
51+
deviate add {
52+
must "translate(., 'abcdef', 'ABCDEF') = '01:80:C2:00:00:0E'" {
53+
error-message "Only the LLDP Multicast MAC (01:80:C2:00:00:0E) is allowed.";
54+
}
55+
}
56+
}
57+
3558
deviation "/lldp:lldp/lldp:message-fast-tx" {
3659
deviate not-supported;
3760
}

src/klish-plugin-infix/xml/infix.xml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@
373373
</ACTION>
374374
</COMMAND>
375375

376+
<COMMAND name="lldp" help="Show LLDP neighbors">
377+
<ACTION sym="script">
378+
show lldp
379+
</ACTION>
380+
</COMMAND>
381+
376382
<COMMAND name="hardware" help="Show hardware information">
377383
<ACTION sym="script" in="tty" out="tty" interrupt="true">
378384
show hardware |pager
@@ -471,22 +477,22 @@
471477
<ACTION sym="script">sysinfo</ACTION>
472478
</COMMAND>
473479
-->
474-
<COMMAND name="version" help="Show software version">
475-
<ACTION sym="script" in="tty" interrupt="true">cat /etc/version</ACTION>
476-
</COMMAND>
480+
<COMMAND name="version" help="Show software version">
481+
<ACTION sym="script" in="tty" interrupt="true">cat /etc/version</ACTION>
482+
</COMMAND>
477483

478-
<COMMAND name="factory-config" help="Show factory-config">
479-
<ACTION sym="script" in="tty" out="tty" interrupt="true">jq -C . /etc/factory-config.cfg |pager</ACTION>
480-
</COMMAND>
484+
<COMMAND name="factory-config" help="Show factory-config">
485+
<ACTION sym="script" in="tty" out="tty" interrupt="true">jq -C . /etc/factory-config.cfg |pager</ACTION>
486+
</COMMAND>
481487

482-
<COMMAND name="running-config" help="Show running-config">
483-
<ACTION sym="script" in="tty" out="tty" interrupt="true">sysrepocfg -X -f json | jq -C . |pager</ACTION>
484-
</COMMAND>
488+
<COMMAND name="running-config" help="Show running-config">
489+
<ACTION sym="script" in="tty" out="tty" interrupt="true">sysrepocfg -X -f json | jq -C . |pager</ACTION>
490+
</COMMAND>
485491

486-
<COMMAND name="startup-config" help="Show startup-config">
487-
<ACTION sym="script" in="tty" out="tty" interrupt="true">jq -C . /cfg/startup-config.cfg |pager</ACTION>
488-
</COMMAND>
492+
<COMMAND name="startup-config" help="Show startup-config">
493+
<ACTION sym="script" in="tty" out="tty" interrupt="true">jq -C . /cfg/startup-config.cfg |pager</ACTION>
489494
</COMMAND>
495+
490496
<COMMAND name="factory-reset" help="Restore the system to factory default state">
491497
<ACTION sym="script" in="tty" out="tty" interrupt="true">
492498
/bin/yorn "This will restore the device to factory defaults"
@@ -581,6 +587,7 @@
581587
</ACTION>
582588
</COMMAND>
583589

590+
</COMMAND>
584591
</VIEW>
585592

586593
<VIEW name="config">

src/show/show.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,15 @@ def routes(args: List[str]):
154154
return
155155
cli_pretty(data, "show-routing-table", "-i", ip_version)
156156

157+
def lldp(args: List[str]):
158+
data = run_sysrepocfg("/ieee802-dot1ab-lldp:lldp")
159+
if not data:
160+
print("No lldp data retrieved.")
161+
return
162+
if RAW_OUTPUT:
163+
print(json.dumps(data, indent=2))
164+
return
165+
cli_pretty(data, "show-lldp")
157166

158167
def execute_command(command: str, args: List[str]):
159168
command_mapping = {
@@ -162,6 +171,7 @@ def execute_command(command: str, args: List[str]):
162171
'interface': interface,
163172
'ntp': ntp,
164173
'routes': routes,
174+
'lldp': lldp,
165175
'software' : software,
166176
'stp': stp,
167177
}

0 commit comments

Comments
 (0)