UDHCPC(8)

πŸ“¦ version 0.9.8, in opensuse-leap 16.0

πŸ’– udhcpc(8) from the GNU/Linux Administrator's Manual β€” very small DHCP client πŸ’–


🌸 NAME 🌸

udhcpc β€” very small DHCP client. That's it, that's the girlie. ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

udhcpc [OPTION]...

✨ DESCRIPTION ✨

Okay so the udhcp client negotiates a lease with the DHCP server and executes a script when it is obtained or lost. main character energy, honestly. 🫢

πŸ’… OPTIONS πŸ’…

Bestie, here's the whole flag menu β€” no cap, nothing skipped:

  • -c CLIENTID, --clientid=CLIENTID β€” send the client identifier CLIENTID. πŸ’–
  • -f, --foreground β€” do not fork after obtaining a lease.
  • -H HOSTNAME, --hostname=HOSTNAME β€” send the client hostname HOSTNAME. πŸŽ€
  • -h HOSTNAME β€” alias for -H HOSTNAME. iykyk.
  • -i INTERFACE, --interface=INTERFACE β€” configure INTERFACE. πŸ¦‹
  • -n, --now β€” exit with failure if a lease cannot be obtained.
  • -p FILE, --pidfile=FILE β€” write the process ID of the daemon to FILE. 🌸
  • -q, --quit β€” exit after obtaining a lease.
  • -r ADDRESS, --request=ADDRESS β€” request IP address ADDRESS. ⭐
  • -s FILE, --script=FILE β€” use script FILE. 🫢
  • -v, --version β€” display version.

πŸŽ€ USAGE πŸŽ€

When an event occurs, udhcpc executes a script. There are four possible arguments to this script:

🎬 script arguments

  • deconfig β€” used when udhcpc starts, and when a lease is lost. The script should put the interface in an up, but deconfigured, state. πŸ’…
  • bound β€” used when udhcpc moves from an unbound to a bound state. The script should configure the interface and set any other relevant parameters (e.g., default gateway, dns server, etc.). πŸ”₯
  • renew β€” used when a lease is renewed. The interface is already configured, so the IP address will not change. Other parameters (e.g., default gateway, subnet mask, dns server) may change. 🌈
  • nak β€” used when udhcpc receives a NAK packet from the server. The environment variable $message will contain the reason for the NAK message if the server included one. Processing this message is optional, as the script will also be called with deconfig if need be. πŸ’€

🌱 environment variables

Parameters are passed to the script via the following environment variables:

  • HOME β€” the inherited HOME, or / if it is unset. yes, slash. 🏠
  • PATH β€” the inherited PATH, or /bin:/usr/bin:/sbin:/usr/sbin if it is unset. periodt.
  • interface β€” the interface.
  • ip β€” the client IP address. πŸ‘‘
  • siaddr β€” the BOOTP next server option.
  • sname β€” the BOOTP server name option.
  • boot_file β€” the BOOTP boot file option.
  • subnet β€” the subnet mask.
  • timezone β€” the timezone offset from UTC in seconds.
  • router β€” the list of routers. πŸ›œ
  • timesvr β€” the list of time servers.
  • namesvr β€” the list of IEN 116 name servers.
  • dns β€” the list of DNS servers. ✨
  • logsvr β€” the list of MIT-LCS UDP log servers.
  • cookiesvr β€” the list of RFC 865 cookie servers. πŸͺ
  • lprsvr β€” the list of LPR servers.
  • hostname β€” the host name.
  • bootsize β€” the length in 512-octet blocks of the bootfile.
  • domain β€” the domain name of the network.
  • swapsvr β€” the client's swap server.
  • rootpath β€” the path of the client's root dist.
  • ipttl β€” the TTL.
  • mtu β€” the MTU.
  • broadcast β€” the broadcast address. πŸ“£
  • ntpsrv β€” the list of NTP servers.
  • wins β€” the list of WINS servers.
  • lease β€” the lease time in seconds. ⏳
  • dhcptype β€” the DHCP message type (safely ignored). so don't stress.
  • serverid β€” the server IP address.
  • message β€” reason for a DHCPNAK.
  • tftp β€” the TFTP server name.
  • bootfile β€” the bootfile name.

πŸ“ FILES πŸ“

  • /usr/share/udhcpc/default.script β€” script run when leases are obtained or lost. πŸŽ€

πŸ”” NOTES πŸ””

udhcpc responds to the following signals:

  • SIGUSR1 β€” this signal causes udhcpc to renew the current lease or, if it does not have one, obtain a new lease. πŸ”₯
  • SIGUSR2 β€” this signal causes udhcpc to release the current lease. πŸ’€

mwah πŸ’‹ β€” GNU/Linux, 2001-09-26. periodt. 🌈

πŸ“¦ where this page comes from