I was wondering if a single machine (with several network interfaces) can be, at the same time, a DHCP server and a DHCP client, that is the server would dynamically attribute an IP address to an other interface ?

  • Yes it is possible (at least with a DHCP relay) but what's the point of such a topology?
    – JFL
    Jan 10, 2019 at 14:33
  • The goal was to use a single virtual machine as part of a course, install the DHCP server and test it in that VM.
    – Greg82
    Jan 10, 2019 at 15:22
  • Considering how easy it is to setup a VM, I would rather go for 2 VMs, this will be much more like a real life case.
    – JFL
    Jan 10, 2019 at 15:56
  • Yes, I agree, and I think I will retain this solution. But my question was only by pure curiosity :)
    – Greg82
    Jan 10, 2019 at 16:00

1 Answer 1


Cetainly it's possible, and indeed moderately common for small routers linking to ISPs.

The external interface to the ISP gets a dynamic address from the ISP (by LCP or DHCP as appropriate), and very often is a DHCP server for the local clients on some internal interface.

This is a portion of a Cisco router configuration with exactly that functionality:

ip dhcp pool 1

interface Vlan1000
 ip address dhcp
 ip nat outside
  • As I read the quesiton, it is about the same machine being both the DHCP client and the DHCP server that will respond for its own request.
    – JFL
    Jan 10, 2019 at 14:26
  • Not exactly "for its own request". I assume the machine has TWO interfaces, one of them being dynamically assigned by the DHCP server that listens on the other one
    – Greg82
    Jan 10, 2019 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.