Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    pfSense+ 24.11: DHCP IPv4 fails after overwriting script

    Scheduled Pinned Locked Moved DHCP and DNS
    dhcppfsense 24.11
    6 Posts 3 Posters 226 Views 3 Watching
    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.
    • N Offline
      NoobUser1
      last edited by

      Hello,
      I am running pfSense+ 24.11-RELEASE. As I am new to pfSense, I accidentally ran the command "script /usr/local/sbin/pfSense-dhclient-script" while editing the WAN interface to mimic my ISP’s box behavior. However I changed my mind and decided to place pfSense in the DMZ of the ISP box instead. After reconfiguring the WAN interface, I successfully obtained an IPv6 address, but no IPv4 address was assigned.
      In the system logs I see that pfSense is sending DHCPDISCOVER requests and receiving DHCPOFFER responses. Just after that, the following errors appear:
      'unknown dhcp option value 0x7d'
      'execve (/usr/local/sbin/pfSense-dhclient-script, ...): Exec format error'.
      I realized the issue might be caused by the pfSense-dhclient-script file, which I overwrote the day before by running the script command. From what I understand and saw, this command wrote the terminal output into the file, corrupting it. As a result, DHCP fails, and I cannot obtain an IPv4 address. My question is: How can I fix this issue? Should I reinstall pfSense, or is there a way to restore the original pfSense-dhclient-script file to resolve the problem?
      Thank you in advance for your time and help.

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG Offline
        Gertjan @NoobUser1
        last edited by Gertjan

        @NoobUser1 said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

        I am running pfSense+ 24.11-RELEASE. As I am new to pfSense, I accidentally ran the command "script /usr/local/sbin/pfSense-dhclient-script" while editing the WAN interface to mimic my ISP’s box behavior. However I changed my mind and decided to place pfSense in the DMZ of the ISP box instead. After reconfiguring the WAN interface, I successfully obtained an IPv6 address, but no IPv4 address was assigned.
        In the system logs I see that pfSense is sending DHCPDISCOVER requests and receiving DHCPOFFER responses. Just after that, the following errors appear:
        'unknown dhcp option value 0x7d'

        If you remove the "ISP router", and hookup up pfSense directly to your ISP connection, then pfSense has to know have to communicate with ISP; something that was done before by the ISP box.
        Your ISP might use the good old 'DHCP' to connect, but that's rarely the case.
        It's DHCP (client) + extras.
        My ISP as an example : I have to send also in the DHCP IPv4 ( and IPv6 request !) request an encoded user ID and a encoded password, and some other semi static flags.
        After all, maybe you know that your ISP 'line' goes to your ISP (let's hope it des ^^) but your ISP doesn't know what is calling in. They presume it's you ? Maybe they don't and you have to identify yours self ?
        So, in short, maybe DHCP to talk to the ISP, but a DHCP with extra options.
        The fact the ISP send back "'unknown dhcp option value 0x7d'" tells me they want something from you .... maybe 'unknown dhcp option value 0x7d' tells you "Hello there, you're doing it wrong, now your connection is limited".

        You have to know all about this WAN negotiations with your ISP, and the details are rarely published by your ISP. They will reply with the classic :
        "Don't do that if you don't know what is needed - your OUR ISP box, and you'll be fine."
        After all, they are not (! like never!) going to support your 'ABC router', in this case pfSense.

        And that don't worry, running the"pfSense-dhclient-script " didn't break anything.
        Restart the connection with the ISP router and all will be fine.
        What might ahppen is : the ISP knows the MAC address of it's their own router. You removed it, and let pfSense talk to the ISP directly ... with another MAC, the pfSense WAN MAC. And that can confuse the ISP. It signals them some one is doing something 'not normal' ^^

        @NoobUser1 said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

        My question is: How can I fix this issue? Should I reinstall pfSense, or is there a way to restore the original pfSense-dhclient-script file to resolve the problem?

        You didn't change a file, right ?
        pfSense is nothing more as a huge "config file creator" : when a process starts, just before it's launched, it's config is set up according to the GUI settings.
        Restart the process, or restart pfSense (rarely needed) : all config is re created according to your GU config.
        You are of course allowed to change whatever you want. There is juts one rule : know how to get back to square zero = undo your changes. A worst case is : re install, and that's the biggest punishment there is : you just lost 10 minute of your live ^^

        edit :

        or is there a way to restore the original

        That's why, when you edit something, you make a copy first.
        This rule was valid in the past, and is valid to today, and will be valid tomorrow.
        In the early days, you could get a copy of the file you've modified from github. That's less an option today. So plan B : Installer and re install.

        No "help me" PM's please. Use the forum, the community will thank you.

        N 1 Reply Last reply Reply Quote 0
        • N Offline
          NoobUser1 @Gertjan
          last edited by NoobUser1

          @Gertjan Thank you for helping. Actually, you're right that the ISP is asking specific information to let me communicate with them. However what's strange is that even after placing pfSense behind the ISP router and not connecting directly to the modem, basically he should get a private IP address, something between 192.168.1.1-254 in my case. But it doesnt, (I tried to get back to the 'normal' configuration of the WAN interface and I also recreated it). Also I know that it's not the ISP router fault neither a problem from a port because when I hooked up my laptop to the exact same port that pfSense was connected, this time I got both IPv4 and v6 address.

          @Gertjan said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

          You didn't change a file, right ?

          as I said in OP, I overwrote by mistake (didnt know immediately) the "pfSense-dhclient-script" with the 'script' command. It interpreted that the file was the output destination for my terminal session and not a script to run (apparently). Obviously i checked the actual content of the file and indeed it was not something expected, instead it had the text displayed on the CLI showing the Netgate welcome message and interface menu. So I think my dhclient is not working because of that.

          I'm not even trying to replace my isp router by pfsense anymore, just trying to communicate through WAN interface with the isp router to reach the internet. But at this point I just can't get an IPv4 although I have both DISCOVER request and OFFER from isp.
          And yeah it was dumb not to copy before the change, but the thing is that I didn't know it will change this file

          Not sure I explained very well but anyway thank you again for your time

          SteveITSS GertjanG 2 Replies Last reply Reply Quote 0
          • SteveITSS Offline
            SteveITS Rebel Alliance @NoobUser1
            last edited by

            @NoobUser1 if IPv6 is working you may still be able to upgrade…24.x is multiple versions old anyway.

            Since you’re on plus you could revert to an older boot environment though that would presumably leave you with an older configuration and pfSense version. Or reinstall a current version.

            https://docs.netgate.com/pfsense/en/latest/install/upgrade-guide.html

            https://docs.netgate.com/pfsense/en/latest/backup/restore-during-install.html

            https://docs.netgate.com/pfsense/en/latest/backup/zfsbe/index.html

            To upgrade, select your branch in System/Update/Update Settings. When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
            Only install packages for your version of pfSense.
            Upvote 👍 helpful posts!

            1 Reply Last reply Reply Quote 0
            • GertjanG Offline
              Gertjan @NoobUser1
              last edited by Gertjan

              @NoobUser1 said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

              basically he should get a private IP address, something between 192.168.1.1-254 in my case

              That's the most common IPv4 RFC1918 network. It's also the pfSense LAN default setup, where the pfSense LAN interface is set up static to 192.168.1.1/24
              This is nearly plug and play, but beware, if your ISP upstream router also uses 192.168.1.0/24 as its LAN, the you have conflict. pfSense WAN and LAN can't have both 192.168.1.0/24, as in that case there is nothing to route.
              The solution : change the DHCP server settings of the ISP router, so it uses 192.168.10.1/24 where '10' is your choice.
              From now on, the pfSense will be 192.168.10.x/24, where x is something between 192.168.10.2 and 192.168.10.254, depending on the pool of the DHCP server of the ISP router

              @NoobUser1 said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

              But it doesnt,

              It should. pfSense WAN use by default 'DHCP', pfSense uses a dhcp-client process to obtain an lease from the upstream DHCP server, the ISP router.

              No "help me" PM's please. Use the forum, the community will thank you.

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                NoobUser1 @Gertjan
                last edited by

                @Gertjan said in pfSense+ 24.11: DHCP IPv4 fails after overwriting script:

                It should.

                That was the point of the post... Anyway, I upgraded pfSense and dhclient seems to be working fine.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
                Privacy Policy · Cookie Policy