• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • 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
    last edited by DBCountMan Jun 8, 2021, 1:10 PM Jun 8, 2021, 6:57 PM

    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 which I use for offline imaging over a switch. What I want is to be able to change where the USB boot disk looks for and mounts the NFS share. I have a 2nd interface on my FOG server that is online and I use this for managing FOG and updating Ubuntu Server. I can mount the NFS share through this interface. Would I have to decompile the ipxe.efi file and edit it so it see’s FOGs IP as whatever I set it to?

    EDIT: Had to update my question because we don’t have PXE booting set up on our online/prod network. Guess the ultimate goal is to be able to deploy fog images in other buildings using the USB drive to boot to the fog menu.

    G 2 Replies Last reply Jun 8, 2021, 8:51 PM Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Jun 8, 2021, 8:45 PM

      @brakcounty There is no official USB boot method but a couple of tutorials exist in the forums. Please post the exact link of the information you read or post detailed steps you used to do this.

      What I mean by different methods is that you can boot GRUB bootloader via USB and chainload into FOG tasks directly as well as booting iPXE from USB and chainload into the FOG boot menu.

      Both are different when it comes to the parameters like NFS share mounting.

      On the other hand I am wondering why you can’t use the 10.0.0.10 IP for NFS mounting and imaging? You seem to have a highly customized setup and you need to provide more information.

      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
      • G
        george1421 Moderator @DBCountMan
        last edited by george1421 Jun 8, 2021, 2:52 PM Jun 8, 2021, 8:51 PM

        @brakcounty OK I think you have a few things twisted up, but we CAN get to where you want to be.

        How it works today is if you PXE boot the ipxe.efi file is transferred from the FOG server to the target computer into memory and then its booted. (delivery method via pxe or usb the process is the same the file is loaded into memory then executed). Now the FOG iPXE files are special in that they have… kind of a batch file built in that tells iPXE what to do. That script is here: https://github.com/FOGProject/fogproject/blob/master/src/ipxe/src-efi/ipxescript (remember this because you will need it to build your own). That script sets up the network adapter, sends a dhcp request and then finds the fog server via the dhcp request, dhcp option 66. You will notice in the second line from the bottom it chains back to the fog server but this time load default.ipxe (yet another batch file) to do more things on the fog server.

        Now in your custom ipxe boot file you might update the script from this

        :netboot
        chain tftp://${next-server}/default.ipxe 
        

        to this

        :netboot
        chain tftp://192.168.146.15/default.ipxe 
        

        To point to a specific fog server, ignoring anything provided by the dhcp server.

        The fog installer has the tools needed to build a custom ipxe.efi file. I think Sebastian knows the command off the top of his head (or use rom-o-match). But you will take that custom ipxe.efi with the customized script and load that onto a usb flash drive and boot it from there.

        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 Jun 9, 2021, 1:31 PM Reply Quote 0
        • D
          DBCountMan @george1421
          last edited by DBCountMan Jun 9, 2021, 8:47 AM Jun 9, 2021, 1:31 PM

          @george1421
          Found this link
          https://forums.fogproject.org/topic/12121/compiling-ipxe-boot-kernels?lang=en-US
          Should I follow this?

          D 1 Reply Last reply Jun 9, 2021, 1:41 PM Reply Quote 0
          • D
            DBCountMan @DBCountMan
            last edited by DBCountMan Jun 9, 2021, 9:17 AM Jun 9, 2021, 1:41 PM

            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.

            G 1 Reply Last reply Jun 9, 2021, 4:48 PM Reply Quote 0
            • G
              george1421 Moderator @DBCountMan
              last edited by Jun 9, 2021, 4:48 PM

              @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 Jun 9, 2021, 5:10 PM

                @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 Jun 9, 2021, 6:10 PM Reply Quote 0
                • D
                  DBCountMan @Sebastian Roth
                  last edited by DBCountMan Jun 9, 2021, 12:11 PM Jun 9, 2021, 6:10 PM

                  @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 Jun 9, 2021, 1:32 PM Jun 9, 2021, 7:30 PM

                    @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
                    • G
                      george1421 Moderator @DBCountMan
                      last edited by george1421 Jun 9, 2021, 1:31 PM Jun 9, 2021, 7:30 PM

                      @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 Jun 10, 2021, 1:42 PM

                        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 Jun 10, 2021, 7:54 AM Jun 10, 2021, 1:49 PM

                          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?

                          G 1 Reply Last reply Jun 10, 2021, 2:41 PM Reply Quote 0
                          • D
                            DBCountMan
                            last edited by DBCountMan Jun 10, 2021, 8:21 AM Jun 10, 2021, 2:20 PM

                            @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…?

                            G 1 Reply Last reply Jun 10, 2021, 2:43 PM Reply Quote 0
                            • G
                              george1421 Moderator @DBCountMan
                              last edited by Jun 10, 2021, 2:41 PM

                              @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
                              • G
                                george1421 Moderator @DBCountMan
                                last edited by Jun 10, 2021, 2:43 PM

                                @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 Jun 10, 2021, 2:49 PM Reply Quote 0
                                • D
                                  DBCountMan @george1421
                                  last edited by Jun 10, 2021, 2:49 PM

                                  @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 Jun 10, 2021, 10:11 AM Jun 10, 2021, 3:35 PM

                                    @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 Jun 10, 2021, 10:14 AM Jun 10, 2021, 4:04 PM

                                      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.

                                      G 1 Reply Last reply Jun 10, 2021, 4:30 PM Reply Quote 0
                                      • G
                                        george1421 Moderator @DBCountMan
                                        last edited by Jun 10, 2021, 4:30 PM

                                        @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 Jun 10, 2021, 5:47 PM Reply Quote 0
                                        • D
                                          DBCountMan @george1421
                                          last edited by DBCountMan Jun 10, 2021, 12:25 PM Jun 10, 2021, 5:47 PM

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

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

                                          157

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project