Skip to content

WagoL/ProxLLDPConfig

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proxmox LLDP Configuration Guide

This guide provides detailed instructions on how to set up the Link Layer Discovery Protocol (LLDP) on a Proxmox server, enable additional protocols such as Cisco Discovery Protocol (CDP), and configure automated updates for network interface descriptions based on LLDP data.

screenshot

Prerequisites

Before starting, ensure that you have administrative access to your Proxmox server and are familiar with basic Linux command line operations.

Automated Installation

For convenience, an automated installation script is available to set up everything described in this guide. This script installs lldpd, configures it, and sets up a cron job to update network interface descriptions automatically.

Using the Install Script

To use the automated install script, follow these steps:

  1. Clone the repository to your Proxmox server: To get started, clone the repository from GitHub by running the following command:

    git clone https://github.com/abdellbar1/ProxLLDPConfig.git
    cd ProxLLDPConfig
  2. Make the script executable:

    chmod +x install.sh
  3. Run the script as root:

    sudo ./install.sh

This script handles all the configurations and setups automatically, enhancing your Proxmox server's network management capabilities with minimal manual intervention.

Installation of LLDP

LLDP is not installed by default on Proxmox. You will need to install the lldpd package, which supports LLDP and other discovery protocols.

  1. Update your package list:

    sudo apt update
  2. Install lldpd:

    sudo apt install lldpd

Configuration of LLDPD

After installation, configure lldpd to enable additional discovery protocols and set it to recognize specific interface patterns.

Enabling Additional Protocols

  1. Open the lldpd default configuration file:

    sudo nano /etc/default/lldpd
  2. Add or modify the following line to enable CDP and other protocols:

    DAEMON_ARGS="-x -c -s -e"
    
    • -x: Enable LLDP.
    • -c: Enable CDP (Cisco Discovery Protocol).
    • -s: Enable SONMP (Foundry Discovery Protocol).
    • -e: Enable EDP (Extreme Discovery Protocol).
  3. Save and close the file.

Restart LLDPD

Restart the lldpd service to apply the changes:

sudo systemctl restart lldpd

Configuring Interface Pattern

Configure lldpd to monitor only interfaces that match a specific pattern, such as en* for Ethernet interfaces. This is especially useful in environments with multiple interface types where you want to target a specific subset.

Set the Interface Pattern

  1. Use lldpcli to configure the system to monitor interfaces that match the en* pattern. This command tells lldpd to apply its configuration only to interfaces whose names start with en.

    sudo lldpcli configure system interface pattern en*
  2. To verify that the interface pattern has been set correctly, you can display the current configuration of lldpd:

    sudo lldpcli show configuration

This setup ensures that lldpd will focus on Ethernet interfaces (like eno0, ens2f1, etc.), which are typically used in server environments, and will ignore other types of interfaces that do not match the specified pattern.

Automating Interface Description Updates

Create a cron script that updates the network interface descriptions based on LLDP information.

Creating the Script

  1. Create a new script file: Open a terminal and use the following command to create a new script file:

    sudo nano /usr/local/bin/update_interface_desc.sh
  2. Paste the code from the update_interface_desc.sh file, adjusting paths and commands as necessary. Here is a basic example of what the script might include:

  3. Make the script executable: Grant execute permissions to the script using the following command:

    sudo chmod +x /usr/local/bin/update_interface_desc.sh

Updating the Cron Job

  1. Edit the root's crontab: Access the cron job editor for the root user by executing:

    sudo crontab -e
  2. Add the following line to run the script every hour: Schedule the script to run at the start of every hour, and direct the output to a log file for later review:

    0 * * * * /usr/local/bin/update_interface_desc.sh >> /var/log/update_interface_desc.log 2>&1
    

This setup ensures that your Proxmox server's network interface descriptions are regularly updated based on the latest LLDP data, enhancing network management and documentation.

About

Proxmox LLDP Configuration Guide for automated interface description sync

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%