Setup DHCP Relay on HP V1910

Setup DHCP Relay on HP V1910

April 27, 2015 4 By Eric Shanks

Setting up a DHCP relay is a pretty common task that performed by network administrators when setting up a new LAN.  If you’re not familiar with a DHCP Relay, take a look at the example below.

In order for a client to get an IP Address from a DHCP Server, it sends out a broadcast once it’s plugged into the network.  The broadcast is asking for any servers that are DHCP servers to reply.  Remember that a broadcast is a frame that is forwarded to all hosts on a Local Area Network.  The DHCP Server will reply and the client will get it’s IP Address.

DHCPRelaydiag1

 

Now assume that you have  DHCP server setup, but it’s on a different network.  What happens then?  Broadcasts don’t traverse the local network so how is this accomplished?  The answer is that a DHCP relay agent is used on an appliance on the clients LAN that can pass that traffic to the DHCP server.  Usually this relay agent is a Layer 3 Switch or Router since it has access to both networks.

The broadcast still happens from the client and then the relay agent forwards a unicast frame to the DHCP server on behalf of the client.

DHCPRelaydiag2

 

Setup

To set this up on an HP v1910-24G switch like the one in my home lab we can do the following.   In the Menu, go to the Network Section –> DHCP.  From here we first enable the DHCP Service.  This doesn’t mean that the switch will start handing out IP Addresses, it just starts the service.

DHCPRelay1

 

Now we add the IP Address of our DHCP Server to a server group.  This is to allow the agent to know where to send the relay frames.  Click Add, and enter a server group ID and an IP Address of the DHCP Server.

 

DHCPRelay6

Next, take a look at the Interfaces and their Relay State.  My Clients are on VLAN170 and my DHCP server is on VLAN 150.  Notice that I only had to enable the DHCP Relay State on the Vlan170, where the clients live.  Click the [looks like email] icon in the “Operation” column to enable this.

DHCPRelay2

We we enable the DHCP Relay.  You can add the “Address Match Check” as well, but beware.  If any of your clients on this network don’t match a DHCP lease, they won’t be able to communicate.  Meaning that even if you set a static IP Address on your client, the switch won’t respond to it because there is not matching address.  Also enter a server group ID.  This ID should match the server group that was added when adding the DHCP Server IP Address earlier.

DHCPRelay3

Next, go to the DHCP Snooping screen to “trust” the physical interfaces that might have a DHCP Server on them.  Notice that I have multiple physical ports trusted, because my DHCP Server might vMotion between ports on different hosts since it’s a virtual machine.  Don’t forget to add all of them or you’ll have a fun time hunting down issues.  Again, click the icon in the operations column to configure the port.

DHCPRelay4

Change the interface state to “trust” and click Apply.  Your clients should now be able to request IP Addresses from your DHCP Server.

DHCPRelay5