🖥️dhcpd
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the dhcpd command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██╗ ██╗ ██████╗██████╗ ██████╗
# ██╔══██╗██║ ██║██╔════╝██╔══██╗██╔══██╗
# ██║ ██║███████║██║ ██████╔╝██║ ██║
# ██║ ██║██╔══██║██║ ██╔═══╝ ██║ ██║
# ██████╔╝██║ ██║╚██████╗██║ ██████╔╝
# ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═════╝
# Alle Leases - öfter vorkommende IP's ausgefiltert
grep ^lease /var/lib/dhcp/dhcpd.leases | cut -d ' ' -f 2 | sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n | uniq
# Alle Leases, Einfacher jedoch ohne doppelte IP Ausfilterung
egrep "^lease" /var/lib/dhcp/db/dhcpd.leases |awk '{ print $2 }'
# Syntaxcheck, dann DHCP Stoppen, alles Leases Nullen, anschließend DHCP neustart und statuscheck (ops läuft)
/etc/init.d/dhcpd check-syntax
systemctl dhcpd stop
:> /var/lib/dhcp/db/dhcpd.lease
systemctl dhcpd start
systemctl dhcpd status
#!/bin/bash
# dhcp_pretty.sh
# Awk script to make the dhcp.leases more readable
awk ' { out = ""} \
{ $1=="lease"||$1=="client-hostname" ? out=" " $2 : out=out } \
{ $1=="binding"||$1=="hardware" ? out= " " $3: out=out } \
{ $1=="ends"? out=" " $3 " " $4: out=out } \
{ $1=="}"? out="\n": out=out } \
{ printf out," " }' dhcpd.leases \
| grep active \
| sed -e s/'[{};" ]'/\ /g \
| awk '{ printf "%-15s %-17s %-10s %-5s\n", $1, $5, $2, $3 }'
########################
awk 'BEGIN { RS="}" } { for(i=1;i<=NF;i++) if ($i~"192.168") print $2,$i }' /etc/dhcpd.conf|sed 's/;//g'|sort -n -t. -k4
###############################
#==============================##==============================#
# CMD dhcpd #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command dhcpd in a clear format. This allows users to quickly access the needed information for dhcpd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for dhcpd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.