Vyatta Network OS Documentation

Learn how to install, configure and operate the Vyatta NOS, which helps drive our virtual networking & physical platforms portfolio.

Setting up DHCP relay

Configure DHCP relay if you want the vRouter to forward DHCP requests to another DHCP server.

Every interface involved in the DHCP relay must be configured and must be capable of broadcasting. So, for example, if requests are coming in on the dp0p1p1 interface and the DHCP server specified in the configuration is reached through the dp0p1p2 interface, both dp0p1p1 and dp0p1p2 must be configured for DHCP.

Setting up DHCP relay shows how to accomplish the following tasks:

  • Configures both dp0p1p1 and dp0p1p2 for DHCP. The router is expected to receive client requests for the DHCP server through the dp0p1p1 interface. It forwards client-to-server DHCP messages to the DHCP server at 172.16.1.52 out through the dp0p1p2 interface.
  • Enables relay options. This directs the system to add the Relay Agent Information option (option 82) to the DHCP message before forwarding, as specified by RFC 3046.
  • Does not permit reformatting of DHCP messages by this system. If a packet is received that already contains relay information, the packet is discarded.
  • Leaves other relay option parameters at default values. This means that the router uses port 67 for DHCP messaging, allows a maximum DHCP packet size of at most 576 bytes, and has a maximum hop count of 10 hops.

DHCP relay configuration shows the sample DHCP relay configuration.

Figure 1. DHCP relay configuration

To configure DHCP relay, perform the following steps in configuration mode.

Table 1. Setting up DHCP relay

Step

Command

Enable DHCP relay on the dp0p1p1 interface on which client requests are received.


vyatta@R1# set service dhcp-relay listen-interface dp0p1p1 

Enable DHCP relay on the dp0p1p2 interface on which client messages are forwarded to the DHCP server.


vyatta@R1# set service dhcp-relay upstream-interface dp0p1p2 

Specify the IP address of the DHCP server.


vyatta@R1# set service dhcp-relay server 172.16.1.52

Set the router to discard messages containing relay information. Leave other parameters at default values.


vyatta@R1# set service dhcp-relay relay-options relay-agents-packets discard

Commit the changes.


vyatta@R1# commit

Show the configuration.


vyatta@R1# show service dhcp-relay
	listen-interface dp0p1p1 
	upstream-interface dp0p1p2 
	server 172.16.1.52
	relay-options {
		relay-agents-packets discard
	}