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

    DHCP option 121/249 please help.(provide static routes via DHCP to win clients)

    DHCP and DNS
    4
    15
    28.6k
    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.
    • M
      mxx
      last edited by

      I tried with 20:c0:a8:6f:1:c0:a8:0:1e and with FF:FF:FF:FF:c0:a8:6f:1:c0:a8:0:1e but no luck :( the dhcp client on a win server 2008 testmachine just gives and error about malformed data..

      Update: the first option actually doesn't produce any error, but it doesn't have any effect at all either..

      1 Reply Last reply Reply Quote 0
      • M
        mxx
        last edited by

        Ok, because I don't need a subnet, I tried it with option 33
        This did not work either.

        This time I took a look into dhcpd.conf.

        The entry looked like:
        option custom-lan-0 code 33 = text;
        option custom-lan-0 "192.168.111.1 192.168.0.30";

        However I edited dhcpd.conf to use the option "static-routes" instead of the option code which did work!

        dhcp-option static-routes    192.168.111.1 192.168.0.30;

        1 Reply Last reply Reply Quote 0
        • M
          mxx
          last edited by

          I tried it again with using the option code and using hex. This time without the colons.

          This did something, but I get completely wrong results :D
          Something to watch out for when converting to hex in this case?

          192.168.112.1 -> C0A87001
          192.168.0.30 -> C0A8001E

          I entered it like this: C0A87001C0A8001E
          ..but got: 67.48.65.56  255.255.255.255      48.48.49.69

          Does anyone know what's my mistake?

          Thanks very much!

          1 Reply Last reply Reply Quote 0
          • M
            mxx
            last edited by

            It does work if the option type is set to string instead of text… I wonder how I should format the data if its set to text though..

            1 Reply Last reply Reply Quote 0
            • M
              MrKoen
              last edited by

              Hi mxx, I'm running into the same issue. Did you ever figure this out? I couldn't get it to work in pfSense 2.0 beta 5. I now switched to Windows 2008 R2 DHCP in which it does work using option 121. Check the attachted screenshot.

              StaticDhcpRoutesWindows.png
              StaticDhcpRoutesWindows.png_thumb

              1 Reply Last reply Reply Quote 0
              • M
                mxx
                last edited by

                Hi,

                This is a few months back now and I only remember very vague.
                For me it did work when I set option type to string in dhcpd.conf. But before I tried that I switched to option type 33, 'cause it's a less complex expression and I didn't need classless routing anyway. But I guess it should work for 121 too.

                http://forum.pfsense.org/index.php/topic,26777.msg139676.html#msg139676

                Never looked into it again since I went a different route for my setup.
                I don't know for sure but didn't pfsense 2 got an option in the meanwhile where you can define the option data type yourself?

                Good luck to you!

                1 Reply Last reply Reply Quote 0
                • M
                  MrKoen
                  last edited by

                  Thanks for sharing your thoughts. I've tried many different things. Both via the webinterface as well as hacking directly into the config files. It kept giving me invalid DHCP data errors on my Windows 7 client. I didn't understand from your postings what you did to get it to work finally. You clearly tried a lot of different things as well and from your postings I can not distinguish exactly what you did when it worked. The Windows DHCP option suits me well for now.

                  If somebody else reading this topic has dealt with this before, please do reply as I am still curious in how to get it to work.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mxx
                    last edited by

                    Hi again,

                    for option 33 to work I had to set the data type to string. Previously it wasn't possible to do this via the gui. But now I see it's finally possible..
                    After that it worked. Just needed to figure out the correct format for the option. Once I figured out that I needed type string I had already abandoned the idea to use option 121, since I only needed a static host route.
                    So I only tried it with option 33.. this worked for any winxp host..

                    Good luck to you!

                    1 Reply Last reply Reply Quote 0
                    • M
                      MrKoen
                      last edited by

                      Interesting. Can you recall what you put in as a string? Was it in hexadecimals? With or without the : separators?

                      1 Reply Last reply Reply Quote 0
                      • M
                        mxx
                        last edited by

                        Hi,

                        I'm sorry for the late reply.

                        I just tested it again. This time it worked perfectly straight through the web interface (selecting type string, which wasn't possible back then).
                        I entered in the following: number: 33, type: string, value: C0:A8:70:01:C0:A8:00:1E

                        This resulted in the following host route: dst:192.168.112.1  mask:255.255.255.255     gw:192.168.0.30

                        Did you already succeed with your option 121 issue?

                        Greets,

                        Max

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