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 ] 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
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.  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
69              requires 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
86              responses back to the client.  The agent option field will  con‐
87              tain  two agent options: the Circuit ID suboption and the Remote
88              ID suboption.  Currently, the Circuit ID will be  the  printable
89              name  of the interface on which the client request was received.
90              The client supports inclusion of a Remote ID suboption as  well,
91              but 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
101              response 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       -i ifname
106              Listen for DHCPv4/BOOTP traffic on interface  ifname.   Multiple
107              interfaces  may  be  specified by using more than one -i option.
108              If no interfaces are specified on  the  command  line,  dhcrelay
109              will  identify all network interfaces, eliminating non-broadcast
110              interfaces if possible, and attempt to listen on all of them.
111
112       -iu ifname
113              Specifies an upstream network interface: an interface from which
114              replies  from  servers  and other relay agents will be accepted.
115              Multiple interfaces may be specified by using more than one  -iu
116              option.  This argument is
117               intended  to  be used in conjunction with one or more -i or -id
118              arguments.
119
120       -id ifname
121              Specifies a downstream  network  interface:  an  interface  from
122              which  requests  from  clients  and  other  relay agents will be
123              accepted.  Multiple interfaces may be specified  by  using  more
124              than  one  -id  option.  This argument is intended to be used in
125              conjunction with one or more -i or -iu arguments.
126
127       -m append|replace|forward|discard
128              Control the handling of incoming DHCPv4  packets  which  already
129              contain  relay  agent  options.   If such a packet does not have
130              giaddr set in its header, the DHCP standard  requires  that  the
131              packet be discarded.  However, if giaddr is set, the relay agent
132              may handle the situation in four ways:  It may  append  its  own
133              set  of relay options to the packet, leaving the supplied option
134              field intact; it may replace the existing agent option field; it
135              may forward the packet unchanged; or, it may discard it.
136
137       -U ifname
138              Enables the addition of a RFC 3527 compliant link selection sub‐
139              option for clients directly connected to the  relay.   This  RFC
140              allows  a  relay  to specify two different IP addresses: one for
141              the server to use when communicating with the relay (giaddr) the
142              other  for  choosing  the subnet for the client (the suboption).
143              This can be useful if the server is unable to  send  packets  to
144              the relay via the address used for the subnet.
145
146              When  enabled,  dhcrelay  will  add  an  agent option (as per -a
147              above) that includes the link selection suboption  to  the  for‐
148              warded  packet.  This will only be done to packets received from
149              clients that are directly connected to the relay (i.e. giaddr is
150              zero).   The  address  used in the suboption will be that of the
151              link upon which the inbound packet  was  received  (which  would
152              otherwise  be  used for giaddr). The value of giaddr will be set
153              to that of interface ifname.
154
155              Only one interface should be marked in this fashion.   Currently
156              enabling this option on an interface causes the relay to process
157              all DHCP traffic similar to the -i option, in the future we  may
158              split the two more completely.
159
160              This  option  is off by default.  Note that enabling this option
161              automatically enables the -a option.
162
163              Keep in mind that using options such as -m replace or -m discard
164              on  relays  upstream  from  one using -U can pose problems.  The
165              upstream relay will wipe out the initial agent option containing
166              the link selection while leaving the re-purposed giaddr value in
167              place, causing packets to go astray.
168
169
170       Options available in DHCPv6 mode only:
171
172       -I     Force use of the DHCPv6 Interface-ID  option.   This  option  is
173              automatically  sent when there are two or more downstream inter‐
174              faces in use, to  disambiguate  between  them.   The  -I  option
175              causes  dhcrelay  to  send  the option even if there is only one
176              downstream interface.
177
178       -s subscriber-id
179              Add an option with the specified subscriber-id into the  packet.
180              This  feature  is  for testing rather than production as it will
181              put the same subscriber-id into the packet for all clients.
182
183       -l [address%]ifname[#index]
184              Specifies the ``lower'' network interface for DHCPv6 relay mode:
185              the  interface on which queries will be received from clients or
186              from other relay  agents.   At  least  one  -l  option  must  be
187              included  in  the command line when running in DHCPv6 mode.  The
188              interface name  ifname  is  a  mandatory  parameter.   The  link
189              address can be specified by address%; if it isn't, dhcrelay will
190              use the first non-link-local address configured  on  the  inter‐
191              face.   The  optional  #index  parameter specifies the interface
192              index.
193
194       -u [address%]ifname
195              Specifies the ``upper'' network interface for DHCPv6 relay mode:
196              the  interface  to  which  queries  from clients and other relay
197              agents should be forwarded.  At least  one  -u  option  must  be
198              included  in  the command line when running in DHCPv6 mode.  The
199              interface name ifname is a mandatory parameter. The  destination
200              unicast  or  multicast  address can be specified by address%; if
201              not specified, the  relay  agent  will  forward  to  the  DHCPv6
202              All_DHCP_Relay_Agents_and_Servers multicast address.
203
204       It  is  possible to specify the same interface with different addresses
205       more than once, and even, when the system supports it, to use the  same
206       interface as both upper and lower interfaces.
207

SEE ALSO

209       dhclient(8), dhcpd(8), RFC3315, RFC2132, RFC2131.
210

BUGS

212       Using the same interface on both upper and lower sides may cause loops,
213       so when running this way, the maximum hop count should be set to a  low
214       value.
215
216       The loopback interface is not (yet) recognized as a valid interface.
217

AUTHOR

219       dhcrelay(8)  To  learn  more  about  Internet  Systems  Consortium, see
220       https://www.isc.org
221
222
223
224                                                                   dhcrelay(8)
Impressum