Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: DHCP server: how to make a teensy give IP addresses to other devices?

  1. #1

    DHCP server: how to make a teensy give IP addresses to other devices?

    Is it possible to make a Teensy with ethernet adapter to give Ip-adresses to other device(s)?
    I know how to do it with ESP32 in wifi mode. But can't find a solution for wired ethernet.
    Thanks in advance for tips on this.
    Olivier

  2. #2
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    704
    There's two ways:
    1. Use a lower-layer stack such as lwIP or FNET and write the server on top of that. There's a few Teensy 4.1 libraries that include an IP stack: QNEthernet (lwIP) and NativeEthernet (FNET). You'll likely write this in C and conform to the stack's API.
    2. Use the Arduino-style Ethernet API to accept and respond to DHCP messages. You'll likely write this in C++ and conform to the API of whichever library you're using.

    I haven't done a search, but I'm fairly certain you'll find both types of examples if you search for something like "dhcp server lwip" or "dhcp server arduino" or something.

    (I could probably write or adapt one if you need one quickly, but that's a discussion for off-list.)

  3. #3
    Thanks for the tip's. I will try looking for dhcp server lwip.
    I did search for "dhcp server arduino", and got lots of results, all for receiver IP-adress from DHCP server, never the other way around.

  4. #4
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    704
    If you wanted to give it a shot yourself, the protocol specification is in RFC 2131, “Dynamic Host Configuration Protocol.”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •