• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    USB Boot and point to custom FOG server IP

    Scheduled Pinned Locked Moved
    General
    3
    25
    4.0k
    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.
    • D
      DBCountMan @DBCountMan
      last edited by DBCountMan

      I’m wondering if this will work, because the script is still calling for tftp which isn’t enabled on my prod network, as stated in the OP.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @DBCountMan
        last edited by

        @brakcounty If you have the git fog installer package then you have everything you need to build a custom iPXE boot loader. What you will need to do is replace the build in script with one of your own. We are taking about the the same thing . you just need to adjust the file before you compile it. I’m in the office today so I can touch my fog server. Let me see what exactly needs to be done for this.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by

          @brakcounty As posted before there are different ways of booting via USB. You can load iPXE (with modified script as suggested by George) or GRUB from USB to boot into FOG tasks. Not sure what your final aim is.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          D 1 Reply Last reply Reply Quote 0
          • D
            DBCountMan @Sebastian Roth
            last edited by DBCountMan

            @sebastian-roth
            I do have the installer and followed the instructions, when I run “make bin-x86_64-efi/ipxe.efi EMBED=~/fogproject/src/ipxe/src/ipxescript” I get “make: *** No rule to make target ‘bin-x86_64-efi/ipxe.efi’. Stop.” Which directory should I be running this command from? I tried running it from ~/fogproject/src/ipxe/src and ~/ipxe/src with the same result.

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by Sebastian Roth

              @brakcounty Did you manually download and extract the iPXE code or clone the iPXE github repo? There should be a subdirectory called src. You need to run the make command from within that directory.

              Should be ~/ipxe/src in your case I reckon. Make sure there is no typo in that command.

              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

              1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @DBCountMan
                last edited by george1421

                @brakcounty said in USB Boot and point to custom FOG server IP:

                So I read through the instructions to create a USB bootable disk that uses ipxe.efi, which I assume is preconfigured to point to the FOG server’s main IP, which in my case is 10.0.0.10

                Just to be clear where I’m driving here. What I propose is to build a custom iPXE boot loader. In this custom boot loader we will replace the standard method to locate the FOG server (via dhcp) with a static and unique IP address when booting from the usb flash drive. You will need one of these custom iPXE boot files for each FOG server you want to redirect the client to. The FOG git installer has the needed stuff for the OP to do this hacker’s way to get results.

                In the git installer file (typically /root/fogproject if you followed the standard install method) there is /root/fogproject/src/ipxe/src-efi directory in there are the standard scripts that FOG integrates into the standard FOG iPXE files. All you need to do is edit the ipxescript with the hack I mentioned before pointing the chain call directly to the FOG server of your choice.

                Then change to /root/fogproject/utils/FOGiPXE directory and then run the installer script in /root/fogproject/utils/FOGiPXE called ./buildipxe.sh That will build the modified version of iPXE and drop the files into /root/fogproject/packages/tftp once the compile is done then grab the ipxe.efi file from that directory DO NOT rerun the FOG installer or you will replace your fog server ipxe files with the modified ones. You will want to do a git pull to reset the FOG supplied ipxe files when you are done.

                OK now you have the fixed iPXE files then you can follow the tutorial I provided before: https://forums.fogproject.org/topic/6350/usb-boot-uefi-client-into-fog-menu-easy-way
                This will create a usb bootable version of iPXE with the fog server hard coded into startup script.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                1 Reply Last reply Reply Quote 0
                • D
                  DBCountMan
                  last edited by

                  I missed the very first step, my bad. I didn’t have the source ipxe code. I’m compiling it now. I’ll test it out usb boot and see if I can deploy an image. Will report back.

                  1 Reply Last reply Reply Quote 0
                  • D
                    DBCountMan
                    last edited by DBCountMan

                    So it booted, read from tftp://customip, then tried to load the menu boot.php from http://10.0.0.10, so somewhere in the config is still pointing to the offline ip. I will check the code.

                    Just realized something. The USB boot is pulling instructions from the default.ipxe. Maybe I should tell it to pull a custom file from the fog server with the updated IP?

                    george1421G 1 Reply Last reply Reply Quote 0
                    • D
                      DBCountMan
                      last edited by DBCountMan

                      @george1421 @Sebastian-Roth
                      Turns out this might be more complicated than I thought. I got up to boot fog menu, after it tried to download bg.png from the offline http://url. Tried to deploy an image, logged in, then it tried to load http://10.0.0.10/fog/service/ipxe.boot.php. Before that though, it successfully loaded boot.php from the external ip. Sounds like I will have to comb through all the config files and make new versions to point to external IP but keep the 10.0.0.10 functionality…?

                      george1421G 1 Reply Last reply Reply Quote 0
                      • george1421G
                        george1421 Moderator @DBCountMan
                        last edited by

                        @brakcounty said in USB Boot and point to custom FOG server IP:

                        The USB boot is pulling instructions from the default.ipxe. Maybe I should tell it to pull a custom file from the fog server with the updated IP

                        It should be pulling from default.ipxe on the server you defined. Now if that is pointing back to the HQ fog server that’s a different issue.

                        Is the wanted FOG server a full fog server or a storage node?

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                        1 Reply Last reply Reply Quote 0
                        • george1421G
                          george1421 Moderator @DBCountMan
                          last edited by

                          @brakcounty said in USB Boot and point to custom FOG server IP:

                          Turns out this might be more complicated than I thought. I got up to boot fog menu, after it tried to download bg.png from the offline

                          You may need to draw a picture on a napkin with IP addresses of exactly what you are shooting for. It sounds like you have the basis working, but missing something in your expectations.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                          D 1 Reply Last reply Reply Quote 0
                          • D
                            DBCountMan @george1421
                            last edited by

                            @george1421
                            Let me do that on a digital napkin then I’ll upload it here in a bit 🙂

                            1 Reply Last reply Reply Quote 0
                            • D
                              DBCountMan
                              last edited by DBCountMan

                              @george1421 It is a full FOG server.

                              So far I changed the ip address in ipxeconfig.ipxe (embedded into the ipxe.efi image) and default.ipxe to point to the online IP 192.168.1.50. I renamed default.ipxe to default_usb.ipxe and referenced that filename in ipxeconfig.ipxe before I compiled the image.
                              FOG Topology.png

                              1 Reply Last reply Reply Quote 0
                              • D
                                DBCountMan
                                last edited by DBCountMan

                                My guess is that somewhere along the chain, a reference to ${fog-ip} is made that breaks the chain. So I would have to find a spot to fork the process by setting a new ${fog-ip}, duplicating files naming them “whatever_usb” like I’ve been doing so far with success. Does that make sense? I think the fork would have to be at the boot.php part. Since default.ipxe points to the boot.php, I’d have to make a custom boot.php file that points the process to the online interface. I’m looking at boot.php now but don’t see any IP addresses or files being referenced. I also don’t know much about php.

                                george1421G 1 Reply Last reply Reply Quote 0
                                • george1421G
                                  george1421 Moderator @DBCountMan
                                  last edited by

                                  @brakcounty I’m still trying to get my head wrapped around the flow here, but 2 things pop out at me.

                                  1. If you only have 1 fog server then it isn’t designed to support imaging over 2 different interfaces. Everything will point back to its defined imaging network IP.
                                  2. Possibly if dns names were being used instead of IP addresses you could create a split horizon DNS configuration where internally fog.server.com would point to the 10.x network and externally fog.server.com would point to the 192.168.x interface. You would need to replace all of the static entries in the fog server web ui with DNS name. But that might be an option too.

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                  D 1 Reply Last reply Reply Quote 0
                                  • D
                                    DBCountMan @george1421
                                    last edited by DBCountMan

                                    @george1421
                                    A split horizon DNS config huh? I will investigate this. Thanks!

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      Sebastian Roth Moderator
                                      last edited by

                                      @brakcounty While a split DNS config will help you to get a few steps ahead it’s as George said, FOG wasn’t made to be used with more than one interface. Not exactly sure if single cast deploy ( over NFS share) will work but I imagine it does. But multicast will definitely not work in both networks without major code changes I am sure.

                                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                      1 Reply Last reply Reply Quote 1
                                      • D
                                        DBCountMan
                                        last edited by DBCountMan

                                        @Sebastian-Roth
                                        I read through this tutorial and others https://www.slashroot.in/how-to-configure-split-horizon-dns-in-bind
                                        Seems like it isn’t practical since it handles requests coming from specific subnets, which we have a very large number of. I’d have to put each known subnet into the bind config. I want requests coming from the interfaces to be handled the way you described above.

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          DBCountMan
                                          last edited by

                                          @Sebastian-Roth
                                          Single cast is the goal when imaging PCs remotely. This is really for times when we have to reimage a few or a single PC and we need to bring it back to hq to image. I could put fog servers at each site loaded with dept specific images. Do the web files reference 10.0.0.10 or does something else do that? Because I could make two fog sources under /var/www and have each dedicated to the interfaces.

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            Sebastian Roth Moderator
                                            last edited by

                                            @brakcounty said in USB Boot and point to custom FOG server IP:

                                            Do the web files reference 10.0.0.10 or does something else do that? Because I could make two fog sources under /var/www and have each dedicated to the interfaces.

                                            It’s stored in the database (storage node settings in the web UI). FOG was not made for this and you will have to dig pretty deep even to get unicast to work.

                                            When machines PXE boot they load a generated iPXE configuration (via URL http://x.x.x.x/fog/service/ipxe/boot.php) and that is build using the values from the database.

                                            As I said earlier I imagine it might be easier for you to use George’s USB boot method where you manually specify the values using Kernel parameters instead of using the auto-generated iPXE configuration.

                                            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                            D 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            254

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project