Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How do I edit per host DHCP options?

    Scheduled Pinned Locked Moved DHCP and DNS
    9 Posts 3 Posters 4.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tuaris
      last edited by

      With a regular DCHP server I am able to specify per host options like router, hostname, domain name, DNS servers, etc… to override global options.  How can I do this in pFsense?

      1 Reply Last reply Reply Quote 0
      • T
        trix
        last edited by

        I'd like to do a per host option as well. In particular, assign a set of hosts to use opendns rather than my normal dns provider.

        This is so I can better manage blocked sites. Opendns has a lot of pre defined blocks for IM. I can simply check a box rather than hunt down everything manually. From meebo.com to blocking gmail chat (http://mail.google.com/support/bin/answer.py?hl=en&answer=34330).

        I'd like a certain set of clients to use 8.8.8.8 and a certain set to use 208.67.222.222 as dns servers. I highly doubt this is possible.

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          It isn't currently possible, but it probably would not be that difficult to add to services_dhcp_edit.php by someone who knows a little about PHP and the config format of ISC-DHCPD.

          Since there are already per-host options for static IP mappings, it would just be a matter of adding some fields and logic to that page and to the code of the file that writes out the DHCP configuration file.

          I imagine if someone were to sponsor a bounty it could probably done very reasonably if there were no volunteers.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • T
            tuaris
            last edited by

            @jimp:

            It isn't currently possible, but it probably would not be that difficult to add to services_dhcp_edit.php by someone who knows a little about PHP and the config format of ISC-DHCPD.

            Since there are already per-host options for static IP mappings, it would just be a matter of adding some fields and logic to that page and to the code of the file that writes out the DHCP configuration file.

            I imagine if someone were to sponsor a bounty it could probably done very reasonably if there were no volunteers.

            I could probably do the PHP and DHCPD config stuff, but I think their is more to it.  The configuration has to get saved to an XML file (if I understand correctly).

            1 Reply Last reply Reply Quote 0
            • jimpJ
              jimp Rebel Alliance Developer Netgate
              last edited by

              @tuaris:

              I could probably do the PHP and DHCPD config stuff, but I think their is more to it.  The configuration has to get saved to an XML file (if I understand correctly).

              That is all handled internally, just follow the format that the other fields use and it should be fine. It's a lot easier to get into programming this stuff than people realize :)

              The only extra bit that I didn't mention would likely be some input validation, but as those fields are already on the other screen, that functionality could be pulled from there as well.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • T
                trix
                last edited by

                @jimp:

                Since there are already per-host options for static IP mappings, it would just be a matter of adding some fields and logic to that page and to the code of the file that writes out the DHCP configuration file.

                I had not realized one could have per host options for static ips. Is this done by editing dhcpd.conf in /var/dhcpd/etc ? If so, would I simply add option option domain-name-servers 208.67.222.222 inside the brackets for the host I want to use that dns server?

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  You cannot directly edit dhcpd.conf. It will be overwritten the next time DHCP options are sync'd from the GUI.

                  As I've been saying throughout the thread, you must edit the PHP files which generate the dhcpd.conf file and teach them how to use these settings.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • T
                    trix
                    last edited by

                    Ok, I understand.

                    So when this was said:

                    @jimp:

                    Since there are already per-host options for static IP mappings, it would just be a matter of adding some fields and logic to that page and to the code of the file that writes out the DHCP configuration file.

                    It implied that the PHP files would need to be edited anyways.

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      Yeah, the per-host options I was talking about were the IP address, hostname, and MAC address, nothing more. However, since those are already there it shouldn't be hard to shoe-horn some more directives into that block.

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.