1dhcrelay(8)                 System Manager's Manual                dhcrelay(8)
2
3
4

NAME

6       dhcrelay - Dynamic Host Configuration Protocol Relay Agent
7

SYNOPSIS

9       dhcrelay  [  -4 ] [ -dqaD ] [ -p port | -rp relay-port ] [ -c count ] [
10       -A length ] [ -pf pid-file ] [ --no-pid ] [ -m append | replace |  for‐
11       ward  | discard ] [ -i interface0 [ ...  -i interfaceN ] ] [ -iu inter‐
12       face0 [ ...  -iu interfaceN ] ] [ -id interface0 [ ...  -id  interfaceN
13       ] ] [ -U interface ] [ -g ipaddr ] server0 [ ...serverN ]
14
15       dhcrelay  -6  [  -dqI ] [ -p port | -rp relay-port ] [ -c count ] [ -pf
16       pid-file ] [ --no-pid ] [ -s subscriber-id ] -l lower0 [ ...  -l lowerN
17       ] -u upper0 [ ...  -u upperN ]
18

DESCRIPTION

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

OPERATION

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

COMMAND LINE

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  re‐
46       layed.
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 de‐
61              bugging purposes.  Default is port 67 for DHCPv4/BOOTP, or  port
62              547 for DHCPv6.  Incompatible with -rp.
63
64       -rp relay-port
65              Alternative  source  port  for  upstream (i.e toward the server)
66              messages with DHCPv4 RAI relay-port sub-option or DHCPv6  relay-
67              source-port  option. Relay port support is only available if the
68              code was compiled with (./configure --enable-relay-port) and re‐
69              quires LPF or BPF link layer access.
70
71       -q     Quiet  mode.   Prevents dhcrelay6 from printing its network con‐
72              figuration on startup.
73
74       -pf pid-file
75              Path to alternate pid file.
76
77       --no-pid
78              Option to disable writing pid files.   By  default  the  program
79              will write a pid file.
80
81       Options available in DHCPv4 mode only:
82
83       -a     Append  an  agent option field to each request before forwarding
84              it to the server.  Agent option fields in  responses  sent  from
85              servers  to  clients will be stripped before forwarding such re‐
86              sponses back to the client.  The agent option field will contain
87              two  agent  options:  the Circuit ID suboption and the Remote ID
88              suboption.  Currently, the Circuit ID will be the printable name
89              of  the interface on which the client request was received.  The
90              client supports inclusion of a Remote ID suboption as well,  but
91              this is not used by default.
92
93       -A length
94              Specify  the  maximum  packet  size  to  send  to a DHCPv4/BOOTP
95              server.  This might be done to allow sufficient space for  addi‐
96              tion  of relay agent options while still fitting into the Ether‐
97              net MTU size.
98
99       -D     Drop packets from upstream servers if they contain  Relay  Agent
100              Information  options  that  indicate  they were generated in re‐
101              sponse to a query that came via a  different  relay  agent.   If
102              this  option is not specified, such packets will be relayed any‐
103              way.
104
105       -g ipaddr
106              When a package gets sent back to the client, replace  the  gate‐
107              way's  IP  address  (giaddr)  with the given ipaddr. This can be
108              used as a workaround for bogus clients  like  Solaris  11  grub,
109              which  use  the  giaddr  instead  of the announced router (3) to
110              setup its default route.
111
112       -i ifname
113              Listen for DHCPv4/BOOTP traffic on interface  ifname.   Multiple
114              interfaces  may  be  specified by using more than one -i option.
115              If no interfaces are specified on  the  command  line,  dhcrelay
116              will  identify all network interfaces, eliminating non-broadcast
117              interfaces if possible, and attempt to listen on all of them.
118
119       -iu ifname
120              Specifies an upstream network interface: an interface from which
121              replies  from  servers  and other relay agents will be accepted.
122              Multiple interfaces may be specified by using more than one  -iu
123              option.  This argument is
124               intended  to  be used in conjunction with one or more -i or -id
125              arguments.
126
127       -id ifname
128              Specifies a downstream  network  interface:  an  interface  from
129              which  requests  from clients and other relay agents will be ac‐
130              cepted.  Multiple interfaces may be specified by using more than
131              one  -id  option.   This argument is intended to be used in con‐
132              junction with one or more -i or -iu arguments.
133
134       -m append|replace|forward|discard
135              Control the handling of incoming DHCPv4  packets  which  already
136              contain relay agent options.  If such a packet does not have gi‐
137              addr set in its header, the  DHCP  standard  requires  that  the
138              packet be discarded.  However, if giaddr is set, the relay agent
139              may handle the situation in four ways:  It may  append  its  own
140              set  of relay options to the packet, leaving the supplied option
141              field intact; it may replace the existing agent option field; it
142              may forward the packet unchanged; or, it may discard it.
143
144       -U ifname
145              Enables the addition of a RFC 3527 compliant link selection sub‐
146              option for clients directly connected to the  relay.   This  RFC
147              allows  a  relay  to specify two different IP addresses: one for
148              the server to use when communicating with the relay (giaddr) the
149              other  for  choosing  the subnet for the client (the suboption).
150              This can be useful if the server is unable to  send  packets  to
151              the relay via the address used for the subnet.
152
153              When  enabled,  dhcrelay  will  add  an  agent option (as per -a
154              above) that includes the link selection suboption  to  the  for‐
155              warded  packet.  This will only be done to packets received from
156              clients that are directly connected to the relay (i.e. giaddr is
157              zero).   The  address  used in the suboption will be that of the
158              link upon which the inbound packet  was  received  (which  would
159              otherwise  be  used for giaddr). The value of giaddr will be set
160              to that of interface ifname.
161
162              Only one interface should be marked in this fashion.   Currently
163              enabling this option on an interface causes the relay to process
164              all DHCP traffic similar to the -i option, in the future we  may
165              split the two more completely.
166
167              This  option  is off by default.  Note that enabling this option
168              automatically enables the -a option.
169
170              Keep in mind that using options such as -m replace or -m discard
171              on relays upstream from one using -U can pose problems.  The up‐
172              stream relay will wipe out the initial agent  option  containing
173              the link selection while leaving the re-purposed giaddr value in
174              place, causing packets to go astray.
175
176
177       Options available in DHCPv6 mode only:
178
179       -I     Force use of the DHCPv6 Interface-ID option.  This option is au‐
180              tomatically  sent  when  there are two or more downstream inter‐
181              faces in use, to  disambiguate  between  them.   The  -I  option
182              causes  dhcrelay  to  send  the option even if there is only one
183              downstream interface.
184
185       -s subscriber-id
186              Add an option with the specified subscriber-id into the  packet.
187              This  feature  is  for testing rather than production as it will
188              put the same subscriber-id into the packet for all clients.
189
190       -l [address%]ifname[#index]
191              Specifies the ``lower'' network interface for DHCPv6 relay mode:
192              the  interface on which queries will be received from clients or
193              from other relay agents.  At least one -l  option  must  be  in‐
194              cluded in the command line when running in DHCPv6 mode.  The in‐
195              terface name ifname is a mandatory parameter.  The link  address
196              can be specified by address%; if it isn't, dhcrelay will use the
197              first non-link-local address configured on the  interface.   The
198              optional #index parameter specifies the interface index.
199
200       -u [address%]ifname
201              Specifies the ``upper'' network interface for DHCPv6 relay mode:
202              the interface to which queries  from  clients  and  other  relay
203              agents  should be forwarded.  At least one -u option must be in‐
204              cluded in the command line when running in DHCPv6 mode.  The in‐
205              terface  name  ifname  is a mandatory parameter. The destination
206              unicast or multicast address can be specified  by  address%;  if
207              not  specified,  the  relay  agent  will  forward  to the DHCPv6
208              All_DHCP_Relay_Agents_and_Servers multicast address.
209
210       It is possible to specify the same interface with  different  addresses
211       more  than once, and even, when the system supports it, to use the same
212       interface as both upper and lower interfaces.
213

SEE ALSO

215       dhclient(8), dhcpd(8), RFC3315, RFC2132, RFC2131.
216

BUGS

218       Using the same interface on both upper and lower sides may cause loops,
219       so  when running this way, the maximum hop count should be set to a low
220       value.
221
222       The loopback interface is not (yet) recognized as a valid interface.
223

AUTHOR

225       dhcrelay(8) To  learn  more  about  Internet  Systems  Consortium,  see
226       https://www.isc.org
227
228
229
230                                                                   dhcrelay(8)
Impressum