1dhcrelay(8) System Manager's Manual dhcrelay(8)
2
3
4
6 dhcrelay - Dynamic Host Configuration Protocol Relay Agent
7
9 dhcrelay [ -4 ] [ -dqaD ] [ -p port ] [ -c count ] [ -A length ] [ -pf
10 pid-file ] [ --no-pid ] [ -m append | replace | forward | discard ] [
11 -i interface0 [ ... -i interfaceN ] ] [ -iu interface0 [ ... -iu
12 interfaceN ] ] [ -id interface0 [ ... -id interfaceN ] ] [ -U inter‐
13 face ] server0 [ ...serverN ]
14
15 dhcrelay -6 [ -dqI ] [ -p port ] [ -c count ] [ -pf pid-file ] [ --no-
16 pid ] [ -s subscriber-id ] -l lower0 [ ... -l lowerN ] -u upper0 [ ...
17 -u upperN ]
18
20 The Internet Systems Consortium DHCP Relay Agent, dhcrelay, provides a
21 means for relaying DHCP and BOOTP requests from a subnet to which no
22 DHCP server is directly connected to one or more DHCP servers on other
23 subnets. It supports both DHCPv4/BOOTP and DHCPv6 protocols.
24
26 The DHCP Relay Agent listens for DHCPv4 or DHCPv6 queries from clients
27 or other relay agents on one or more interfaces, passing them along to
28 ``upstream'' servers or relay agents as specified on the command line.
29 When a reply is received from upstream, it is multicast or unicast back
30 downstream to the source of the original request.
31
33 Protocol selection options:
34
35 -6 Run dhcrelay as a DHCPv6 relay agent. Incompatible with the -4
36 option.
37
38 -4 Run dhcrelay as a DHCPv4/BOOTP relay agent. This is the default
39 mode of operation, so the argument is not necessary, but may be
40 specified for clarity. Incompatible with -6.
41
42 Specifying DHCPv4/BOOTP servers
43
44 In DHCPv4 mode, a list of one or more server addresses must be speci‐
45 fied on the command line, to which DHCP/BOOTP queries should be
46 relayed.
47
48 Options available for both DHCPv4 and DHCPv6:
49
50 -c COUNT
51 Maximum hop count. When forwarding packets, dhcrelay discards
52 packets which have reached a hop count of COUNT. Default is 10.
53 Maximum is 255.
54
55 -d Force dhcrelay to run as a foreground process. Useful when run‐
56 ning dhcrelay under a debugger, or running out of inittab on
57 System V systems.
58
59 -p PORT
60 Listen and transmit on port PORT. This is mostly useful for
61 debugging purposes. Default is port 67 for DHCPv4/BOOTP, or
62 port 547 for DHCPv6.
63
64 -q Quiet mode. Prevents dhcrelay6 from printing its network con‐
65 figuration on startup.
66
67 -pf pid-file
68 Path to alternate pid file.
69
70 --no-pid
71 Option to disable writing pid files. By default the program
72 will write a pid file.
73
74 Options available in DHCPv4 mode only:
75
76 -a Append an agent option field to each request before forwarding
77 it to the server. Agent option fields in responses sent from
78 servers to clients will be stripped before forwarding such
79 responses back to the client. The agent option field will con‐
80 tain two agent options: the Circuit ID suboption and the Remote
81 ID suboption. Currently, the Circuit ID will be the printable
82 name of the interface on which the client request was received.
83 The client supports inclusion of a Remote ID suboption as well,
84 but this is not used by default.
85
86 -A LENGTH
87 Specify the maximum packet size to send to a DHCPv4/BOOTP
88 server. This might be done to allow sufficient space for addi‐
89 tion of relay agent options while still fitting into the Ether‐
90 net MTU size.
91
92 -D Drop packets from upstream servers if they contain Relay Agent
93 Information options that indicate they were generated in
94 response to a query that came via a different relay agent. If
95 this option is not specified, such packets will be relayed any‐
96 way.
97
98 -i ifname
99 Listen for DHCPv4/BOOTP traffic on interface ifname. Multiple
100 interfaces may be specified by using more than one -i option.
101 If no interfaces are specified on the command line, dhcrelay
102 will identify all network interfaces, eliminating non-broadcast
103 interfaces if possible, and attempt to listen on all of them.
104
105 -iu ifname
106 Specifies an upstream network interface: an interface from which
107 replies from servers and other relay agents will be accepted.
108 Multiple interfaces may be specified by using more than one -iu
109 option. This argument is
110 intended to be used in conjunction with one or more -i or -id
111 arguments.
112
113 -id ifname
114 Specifies a downstream network interface: an interface from
115 which requests from clients and other relay agents will be
116 accepted. Multiple interfaces may be specified by using more
117 than one -id option. This argument is intended to be used in
118 conjunction with one or more -i or -iu arguments.
119
120 -m append|replace|forward|discard
121 Control the handling of incoming DHCPv4 packets which already
122 contain relay agent options. If such a packet does not have
123 giaddr set in its header, the DHCP standard requires that the
124 packet be discarded. However, if giaddr is set, the relay agent
125 may handle the situation in four ways: It may append its own
126 set of relay options to the packet, leaving the supplied option
127 field intact; it may replace the existing agent option field; it
128 may forward the packet unchanged; or, it may discard it.
129
130 -U ifname
131 Enables the addition of a RFC 3527 compliant link selection sub‐
132 option for clients directly connected to the relay. This RFC
133 allows a relay to specify two different IP addresses: one for
134 the server to use when communicating with the relay (giaddr) the
135 other for choosing the subnet for the client (the suboption).
136 This can be useful if the server is unable to send packets to
137 the relay via the address used for the subnet.
138
139 When enabled, dhcrelay will add an agent option (as per -a
140 above) that includes the link selection suboption to the for‐
141 warded packet. This will only be done to packets received from
142 clients that are directly connected to the relay (i.e. giaddr is
143 zero). The address used in the suboption will be that of the
144 link upon which the inbound packet was received (which would
145 otherwise be used for giaddr). The value of giaddr will be set
146 to that of interface ifname.
147
148 Only one interface should be marked in this fashion. Currently
149 enabling this option on an interface causes the relay to process
150 all DHCP traffic similar to the -i option, in the future we may
151 split the two more completely.
152
153 This option is off by default. Note that enabling this option
154 automatically enables the -a option.
155
156 Keep in mind that using options such as -m replace or -m discard
157 on relays upstream from one using -U can pose problems. The
158 upstream relay will wipe out the initial agent option containing
159 the link selection while leaving the re-purposed giaddr value in
160 place, causing packets to go astray.
161
162
163 Options available in DHCPv6 mode only:
164
165 -I Force use of the DHCPv6 Interface-ID option. This option is
166 automatically sent when there are two or more downstream inter‐
167 faces in use, to disambiguate between them. The -I option
168 causes dhcrelay to send the option even if there is only one
169 downstream interface.
170
171 -s subscriber-id
172 Add an option with the specified subscriber-id into the packet.
173 This feature is for testing rather than production as it will
174 put the same subscriber-id into the packet for all clients.
175
176 -l [address%]ifname[#index]
177 Specifies the ``lower'' network interface for DHCPv6 relay mode:
178 the interface on which queries will be received from clients or
179 from other relay agents. At least one -l option must be
180 included in the command line when running in DHCPv6 mode. The
181 interface name ifname is a mandatory parameter. The link
182 address can be specified by address%; if it isn't, dhcrelay will
183 use the first non-link-local address configured on the inter‐
184 face. The optional #index parameter specifies the interface
185 index.
186
187 -u [address%]ifname
188 Specifies the ``upper'' network interface for DHCPv6 relay mode:
189 the interface to which queries from clients and other relay
190 agents should be forwarded. At least one -u option must be
191 included in the command line when running in DHCPv6 mode. The
192 interface name ifname is a mandatory parameter. The destination
193 unicast or multicast address can be specified by address%; if
194 not specified, the relay agent will forward to the DHCPv6
195 All_DHCP_Relay_Agents_and_Servers multicast address.
196
197 It is possible to specify the same interface with different addresses
198 more than once, and even, when the system supports it, to use the same
199 interface as both upper and lower interfaces.
200
202 dhclient(8), dhcpd(8), RFC3315, RFC2132, RFC2131.
203
205 Using the same interface on both upper and lower sides may cause loops,
206 so when running this way, the maximum hop count should be set to a low
207 value.
208
209 The loopback interface is not (yet) recognized as a valid interface.
210
212 dhcrelay(8) To learn more about Internet Systems Consortium, see
213 https://www.isc.org
214
215
216
217 dhcrelay(8)