]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
lldpd: Set green address as management address
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 11 Nov 2025 20:01:23 +0000 (21:01 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Nov 2025 15:23:59 +0000 (15:23 +0000)
At default the first available IP address (which heavily depends on your
and your ISP assigned addresses) will be used as management address.

This patch changes this behaviour to set the address of the green zone
as management address and broadcast it.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/lldpd

index 42b0cb9d7fba910e38cfd094f8447a2b9d6471c8..9b2cbcaf43d7766b2b5725e097c56534d6adaca2 100755 (executable)
@@ -27,6 +27,9 @@ LLDPDARGS=""
 # Read the configuration
 readhash CONFIG "/var/ipfire/lldp/settings"
 
+# Read-in network settings
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
+
 generate_config() {
        # Set the description (if given)
        if [ -n "${CONFIG["DESCRIPTION"]}" ]; then
@@ -53,6 +56,11 @@ case "${1}" in
                        exit 1
                fi
 
+               # Set green address as management address if there is one.
+               if [ -n ${GREEN_ADDRESS} ]; then
+                       LLDPDARGS+=" -m ${GREEN_ADDRESS}"
+               fi
+
                boot_mesg "Starting Link-Layer Discovery Protocol Daemon..."
                loadproc /usr/sbin/lldpd ${LLDPDARGS}
                ;;