dhcp-fwd(1)
๐ dhcp-fwd โ the manual, bestie edition ๐
okay so you found dhcp-fwd(1), the General Commands Manual page, and honestly? iconic. let me walk you through it like we're texting at 2am. ๐ฆ
โจ NAME โจ
dhcp-fwd โ starts the DHCP forwarding agent. that's it, that's the whole vibe. ๐
๐ธ SYNOPSIS ๐ธ
dhcp-fwd [-n] [-N] [-d] [-v] [-h] [-c config_file]
๐ DESCRIPTION ๐
so dhcp-fwd starts a DHCP forwarding agent which relays DHCP messages between subnets with different sublayer broadcast domains. it's giving bridge-between-worlds energy fr fr. ๐ซ
when you call it with no arguments at all, it reads its configuration from /etc/dhcp-fwd.conf and forks itself into the background. a different configfile? that's what the -c option is for, bestie. and if you don't want it to fork at all, hit it with the -n switch. there's also a -d option that's intended for debugging purposes and prevents forking too โ but lowkey, currently it is just an alias for -n. ๐
the way that this program must be started as root but then drops its privileges and goes into a chroot-jail after finishing the initialization?? main character behavior honestly. it gets in, does the job, and locks itself down. periodt. ๐
โจ OPTIONS โจ
-nโ Prevents the daemon from going into background after initialization. this one's useful when you're using advanced init-concepts like minit (http://www.fefe.de/minit/). ๐ซถ-Nโ Like-n, but the program sends aSIGSTOPsignal to itself when initialization has been finished. this is interpreted e.g. by the upstart init system. ๐-dโ Turns on debugging mode and prevents forking; currently it is just an alias for-n. ngl it's the same thing wearing a different hat. ๐-cconfig_file โ Specifies the configfile to use; the default is/etc/dhcp-fwd.conf. ๐-vโ Shows version. quick lil flex. โญ-hโ Shows help. your girl's got your back. ๐
๐ฆ CONFIGURATION FILE ๐ฆ
the default location of the configfile is determined at compilation-time and can be overridden by using the -c option. and when an option needs a boolean parameter, the keywords true, false, 0, 1, yes and no are all possible values. so many ways to say yes. ๐
within the configfile, the following options MUST be set (no skipping, bestie, these are mandatory):
userusername|uid โ The programsetuid()'s to the given user after finishing its initialization. The parameter must be an alphanumeric username or a numeric uid. ๐งgroupgroupname|gid โ The programsetgid()'s to the given group after finishing its initialization. The parameter must be an alphanumeric groupname or a numeric gid. ๐งchrootpath โ The program goes into this directory and calls therechroot()after finishing its initialization. ๐pidfilefilename โ The file where the pid of the daemon will be written into. ๐
๐ธ the optional ones (still slay tho) ๐ธ
beside the mandatory options above, the following options are possible:
ulimitresource limit โ Sets a maximum limit for the given resource by callingsetrlimit()appropriately. Possible values for resource arestack,data,core,rss,nproc,nofile,memlock,asand (if supported by your OS)locks. For the meaning of this values seesetrlimit(2).
limit may be plain unsigned number, a number followed by 'k' (*1000), 'K' (*1024), 'm' (*1000k), 'M' (*1024K) or '-1' to remove the limit for this resource. ๐งฎ
logfilefilename โ Specifies the file where messages will be stored. This file is located relatively to the directory wheredhcp-fwdwas started and not to the directory given at thechrootoption. lowkey important distinction, don't get caught slippin'. ๐จififname has_clients has_servers allow_bcast โ Declares an interface and sets parameter of the network topology. When an interfacename is used in one of the other options, it must have been declared byifalready. no gatekeeping โ declare first, then reference. ๐ช
ifname is the name of the interface as being used e.g. by ifconfig also (e.g. eth0).
has_clients and has_servers tell if messages from clients or servers can be expected on this interface. BOOTREQUESTs are assumed to be client- and BOOTREPLYs are assumed to be server-messages. Unexpected packages will be dropped away. bye felicia. ๐
allow_bcast is/was an experimentell features and will be disappear probably. When not set, the interface will not send packages to IP-broadcast addresses. This affects messages to clients only; when specifying a bcast-server, this option will be ignored. ๐ซฃ
portsifname client-port server-port โ Declares the ports which are used on the specified interface ifname for client resp. server functionality. ๐ช
dhcp-fwd acts as client only, when the has_servers flag has been set and sends from client-port then. Interface will be listen on server-port when the has_clients and/or has_servers flags of the interface have been set.
Omitting this option for an interface or using a value of "0" for the port arguments uses default values. These are port 68/udp (bootpc) for client-port and port 67/udp (bootps) for server-port by default. โจ
NOTE: This option exists to avoid conflicts with already running dhcp servers, clients or relay agents which do not bind to specific interfaces. The DHCP/BOOTP protocol relies on the67/udp+68/udpports and you have e.g. to configure iptable rules which rewrite your custom port numbers to the expected ones. See BUGS below for further restrictions. โ ๏ธ
nameifname agent-id โ specifies the RFC 3046 agent-id for the given interface. When not used explicitly, the interfacename will be assumed as the agent-id. ๐ท๏ธipifname ip โ assigns the ip to be used in the giaddr field. By default to IP of the interface will be assumed but when having multiple IPs for one interface this option may be usefully. ๐
Attention: This IP will not be used in the IP-layer; this means that the UDP packet sent to the server will contain the IP assigned by the system. To setup this address, usual SNAT rulesets in a local packetfilter are recommended. โ ๏ธ
servertype info โ Defines the DHCP server to be used. The following types are supported:server ipaddress [interface] โ address is a dotted IP-address and the optional interface the name of an interface. Please note that mixing declarations without an interface parameter and such ones with this parameter will fail. ๐server bcastinterface โ the DHCP server with be assumed at interface interface and contacted with broadcast messages. ๐ข
suboptioninterface code value โ sets a relay-agent option. The following values for code are supported:compathacktype hack โ Sometimes, new versions ofdhcp-fwdwill contain changes/fixes which might break existing installations. To restore old behavior, compatibility hacks can be activated. These hacks are specified by the hack integer parameter. See theNEWSfile for changes are their corresponding hack value. ๐ฐ๏ธ
For a sample configuration file see the contrib/dhcp-fwd.conf template in the source-tarball. ๐
๐ VARIABLE EXPANSION ๐
It is possible to use $VAR style variable expansion for path, file and interface names, and for ip addresses. Value of $VAR will be taken from the corresponding environment variable which must be defined. Quoting of leading `$ยด characters is possible by prepending a single backslash. โจ
Examples:
pidfile $PIDFILE
if $IFACE t t t
ip $IFACE $IP
๐ BUGS ๐
The ports set up by the ports configuration option are used for binding sockets only. The default DHCP port numbers (67 + 68) appear in the UDP headers of the relayed DHCP responses. so yeah, heads up bestie, the ports don't do what your brain might assume. ๐ญ
๐ FILES ๐
/etc/dhcp-fwd.confโ configuration file ๐/usr/bin/dhcp-fwdโ executable ๐
๐ฆ SEE ALSO ๐ฆ
RFC 2131, 2132, 3046 ๐
๐ AUTHOR ๐
Enrico Scholz <enrico.scholz@ensc.de> โ thank you for your service king ๐ซก
and that's the whole page, bestie!! this was dhcp-forwarder 0.6, dated June 17 2004 โ an absolute classic, we stan a vintage queen. go forth and forward those DHCP messages responsibly. mwah ๐โจ๐ธ
๐ฆ where this page comes from
- fedora 43: dhcp-forwarder 0.11-25.fc43 ยท GPL-3.0-only
- fedora 44: dhcp-forwarder 0.11-27.fc44 ยท GPL-3.0-only
- Copyright (C) 2002, 2003, 2004, 2008, 2014 Enrico Scholz <enrico.scholz@ensc.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms