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

    KEA DHCP6 doesn't start/get a prefix at boot

    Scheduled Pinned Locked Moved DHCP and DNS
    15 Posts 2 Posters 1.2k 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.
    • S
      Superpaul209 @Gertjan
      last edited by

      @Gertjan or anyone else

      Is there a command to reinstall the dhcp6c package (only the client) to the default one in PfSense Repository ? It could potentially be a corruption issue or an update issue on my package which makes it no work at boot.

      I don't find other reasons why it doesnt start at boot. There aren't debug logs.

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

        @Superpaul209

        If the file ( /usr/local/sbin/dhcp6c ), an executable, was corrupted, then you would see for sure logs mentioning this.

        Because I have this :

        67a900f4-63db-40cf-a348-47d81afd78f6-image.png

        Check :

        c4d73ea4-251b-4933-9859-a1ea4e1afbf3-image.png

        Again : I'm using ISC, not KEA !

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        S 1 Reply Last reply Reply Quote 0
        • S
          Superpaul209 @Gertjan
          last edited by

          @Gertjan

          My router is up since this morning, there is only the DHCP6 KEA backend running and no dhcp6c

          79657 root 20 0 39M 22M select 0 0:02 0,00% /usr/local/sbin/kea-dhcp6 -c /usr/local/etc/kea/kea-dhcp6.conf{kea-dhcp6}

          a497d35b-e99c-40c5-a321-63ab889ee9d5-image.png

          Then when I reload the WAN interface, it shows up.

          25699 root 55 0 13M 2544K select 1 0:00 0,00% /usr/local/sbin/dhcp6c -D -n -c /var/etc/dhcp6c.conf -p /var/run/dhcp6c.pid mvneta0.832

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

            @Superpaul209

            and when you switch to ISC ?

            7933fcb4-9ae7-4d18-a9a3-6d321fcdfc6b-image.png

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            S 1 Reply Last reply Reply Quote 0
            • S
              Superpaul209 @Gertjan
              last edited by

              @Gertjan I think the issue occurs because im using a "custom" dhcp6c package but this shouldn't be a problem for the client boot.
              ad865a17-2bec-4d73-be20-55a0bb27cfbc-image.png

              Its a compiled dhcp6c package to have new features like raw-options compatibility and ISP requirements. Its used in the OpnSense project.

              e888f7a4-6d45-49e1-960b-5b474e8b7a53-image.png

              There is a redmine ticket opened since 6 years with no answer : https://redmine.pfsense.org/issues/8173

              I had injected the new file into /usr/local/sbin and replaced it with the old version.

              Anyway, the custom package is working so thats not the issue but its more about the automatic start at the boot. Is there a file/parameter which automatically starts packages like other linux dists ?

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

                @Superpaul209

                Here : /usr/local/etc/rc.d/dhcp6c

                You are using 23.09.1 : what is the kernel version ? 14 ?
                What is the kernel version against which your dhcp6c is compiled ? etc etc .

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                S 1 Reply Last reply Reply Quote 0
                • S
                  Superpaul209 @Gertjan
                  last edited by

                  @Gertjan

                  The latest pfSense version uses the kernel 14 of FreeBSD.

                  About the compiled "custom" executable :
                  /usr/local/sbin/dhcp6c: ELF 64-bit LSB shared object, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 12.1, FreeBSD-style, stripped

                  And here is the content of the file /usr/local/etc/rc.d/dhcp6c

                  #!/bin/sh
                  
                  # PROVIDE: dhcp6c
                  # REQUIRE: netif
                  # BEFORE: NETWORKING
                  # KEYWORD: shutdown
                  
                  # Add the following lines to
                  # /etc/rc.conf.d/dhcp6c /etc/rc.conf.local or /etc/rc.conf
                  # to enable this service:
                  #
                  # dhcp6c_enable (bool):			Set to NO by default.
                  #		Set it to YES to enable dhcp6c.
                  # dhcp6c_config (path):			Set to /usr/local/etc/dhcp6c.conf
                  #		by default.
                  # dhcp6c_dhcp6cctlkey (path):		Set to /usr/local/etc/dhcp6cctlkey
                  #		by default.
                  # dhcp6c_pidfile (path):		Set to /var/run/dhcp6c.pid
                  #		by default.
                  # dhcp6c_interfaces (NIC list):		Not defined by default.
                  #		Set it to the network interface(s) where dhcp6c should work on.
                  # dhcp6c_flags (additional arguments):	Not defined by default.
                  #
                  
                  . /etc/rc.subr
                  
                  name="dhcp6c"
                  rcvar=dhcp6c_enable
                  
                  command="/usr/local/sbin/${name}"
                  start_precmd="${name}_precmd"
                  
                  load_rc_config $name
                  
                  : ${dhcp6c_enable="NO"}
                  : ${dhcp6c_config="/usr/local/etc/${name}.conf"}
                  : ${dhcp6c_dhcp6cctlkey="/usr/local/etc/dhcp6cctlkey"}
                  : ${dhcp6c_pidfile="/var/run/${name}.pid"}
                  
                  required_files="${dhcp6c_config}"
                  pidfile="${dhcp6c_pidfile}"
                  command_args="-c ${dhcp6c_config} -p ${dhcp6c_pidfile} ${dhcp6c_interfaces}"
                  
                  dhcp6c_precmd()
                  {
                  	if [ -z ${dhcp6c_interfaces} ]; then
                  		warn "dhcp6c_interfaces is not set."
                  		return 1
                  	fi
                  	if [ ! -s ${dhcp6c_dhcp6cctlkey} ]; then
                  		echo "Creating ${dhcp6c_dhcp6cctlkey}"
                  		(umask 077 ; openssl rand -base64 48 > ${dhcp6c_dhcp6cctlkey})
                  	fi
                  }
                  
                  run_rc_command "$1"
                  
                  
                  GertjanG 1 Reply Last reply Reply Quote 0
                  • GertjanG
                    Gertjan @Superpaul209
                    last edited by

                    @Superpaul209

                    Isn't that asking for troubles, using a kernel 12.1 binary 'dhcp6c' on a version 14 system ??

                    /usr/local/etc/rc.d/dhcp6c : I've the same file, I guess. I left 23.09.1 several weeks ago, using 24.03-RC now.

                    No "help me" PM's please. Use the forum, the community will thank you.
                    Edit : and where are the logs ??

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      Superpaul209 @Gertjan
                      last edited by

                      @Gertjan

                      I will need to compile it again on the new kernel version 14 or 15. I don't that would change anything but I guess I will have to try.

                      About the dhcp6c config /usr/local/etc/rc.d/dhcp6c, is it NO by default for you ?

                      : ${dhcp6c_enable="NO"}
                      

                      Is it the automatic start at boot or something else ?

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

                        @Superpaul209 said in KEA DHCP6 doesn't start/get a prefix at boot:

                        dhcp6c_enable

                        I don't think this 'auto start' script is used by pfSense.
                        It's there s it is part of the standard framework when the dhcp6c package was included into pfSense.
                        Example : it locates the config (dhcp6c.conf) in the default FreeBSD location, not the one used by pfSense.

                        The dhcp6c process is fully controlled from /etc/invc/interfaces.inc :

                        See here, where it is started : https://github.com/pfsense/pfsense/blob/88670c6c167418e7d12b010c0ce8b7d06c2b757f/src/etc/inc/interfaces.inc#L3848 line 3864 with the correct paths (in /var/...).

                        No "help me" PM's please. Use the forum, the community will thank you.
                        Edit : and where are the logs ??

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          Superpaul209 @Gertjan
                          last edited by

                          @Gertjan Hello again, im back after 15 days because I needed to recompile everything with the latest FreeBSD kernel. So everything is now compatible for FreeBSD 15.0 (which is the kernel of pfSense).

                          The new file reports as :

                          /usr/local/sbin/dhcp6c: ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 15.0 (1500012), FreeBSD-style, stripped
                          

                          You can see how I have done the steps to compile it here : https://github.com/Superpaul209/dhcp6c-armv7
                          Everything is up to date and you can find the binaries on this GitHub for arm64 and armv7 (for those who would like them if they are living in France).

                          The installation was successful on each pfSense, after a reboot Im now having an IPv6 ! The problem was therefore one of compatibility with the kernel version which was too old.

                          Thanks for your ideas and your help, it has solved my issue 😊

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