Ubuntu: Instlal lldpd (Link Layer Discovery Protocol)

sudo apt-add-repository universe
sudo apt install -y lldpd
 
# optional: enable Cisco CDP protocol
cat <<EOF> /etc/default/lldpd 
DAEMON_ARGS="-c"
EOF
service lldpd restart
 
# get info
lldpctl
 
# get interface / switch / port
lldpctl | egrep "Interface|SysName|PortID"
 
lldpctl | egrep "Interface|SysName|PortID" | awk -F  ' *: *' '{print $2}' | awk -F  ',' '{print $1}' | paste - - - | \
  egrep "^e" | awk '{print "'"$NODE"'",$1,$2,$4}' | column -t | sort -u -k 1,2