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

booting from non-native(dot1q) VLAN

Scheduled Pinned Locked Moved
General Problems
3
17
1.8k
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.
  • G
    Gribbly
    last edited by Apr 15, 2019, 11:12 PM

    Hi,

    I have an environment where I do not have the ability to configure a native VLAN.

    I have the ability to configure a VLAN for PXE in the BIOS, which is working correctly, but I am struggling to see if it’s possible to then have the system continue to use that VLAN ID for imaging etc. It is failing currently to get an IP as I believe it’s dropping back to native vlan once it’s pulled the ‘udionly.kpxe’ loader.

    Any hints/kernel options etc would be appreciated - or a ‘no, this isn’t possible’.

    1 Reply Last reply Reply Quote 0
    • G
      george1421 Moderator
      last edited by george1421 Apr 15, 2019, 6:02 PM Apr 16, 2019, 12:01 AM

      What does the native vlan, or vlans in general have to do with imaging? FOG doesn’t understand vlan trunking at all. FOS will only understand untagged network traffic.

      How do you have the switch port configured where the target computer is plugged in?

      If I can read between the lines here. Undionly,kpxe is being transferred tot the target computer, but undionly.kpxe (boot kernel) is failing to get an IP address? Is that what you are saying? If so that sounds more like a spanning tree issue than anything related to vlans. Please explain a bit more about what you are seeing happen during booting.

      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!

      G 1 Reply Last reply Apr 16, 2019, 12:14 AM Reply Quote 0
      • G
        Gribbly @george1421
        last edited by Apr 16, 2019, 12:14 AM

        @george1421

        In this example, the target machine is a blade in a chassis. The network which I need to communicate with my fog server from is tagged (on VLAN ID 2223) to the host, not native/untagged.

        My BIOS allows me to configure a VLAN ID for the PXE boot. The machine boots, PXE grabs an IP address via the tagged VLAN, and downloads the undionly.kpxe kernel. This is then attempting to get an IP address via DHCP on eth0 and failing, so unable to continue the communication with the Fog server. Ideally, I would like it to be using eth0.2223 (VLAN 2223 on the eth0 interface).

        G 1 Reply Last reply Apr 16, 2019, 12:41 AM Reply Quote 0
        • G
          george1421 Moderator @Gribbly
          last edited by george1421 Apr 15, 2019, 6:42 PM Apr 16, 2019, 12:41 AM

          @Gribbly said in booting from non-native(dot1q) VLAN:

          The network which I need to communicate with my fog server from is tagged (on VLAN ID 2223) to the host, not native/untagged.

          Hopefully you are using the wrong words for how you have things setup. I’m trying to understand how you have things setup. So to your fog server and your clients they are all on vlan trunk ports where they only communicate over tagged linked? This is somewhat unusual especially with Win10 and its now complexity to setup vlan tagged adapters.

          Just for clarity the native vlan has nothing to do with the VLID of an access port. Are you saying you can’t change the VLID of any network port where the VLID is always set to the native vlan?

          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!

          G 1 Reply Last reply Apr 16, 2019, 12:54 AM Reply Quote 0
          • G
            Gribbly @george1421
            last edited by Apr 16, 2019, 12:54 AM

            @george1421

            The machine I am trying to image is on a trunk port. I am using ubuntu there. The fog server is natively in the vlan no trunking.

            Effectively this is what happens:

            BIOS -> Allows me to configure a VLAN TAG for PXE.
            Machine boots, PXE gets a DHCP address from the configured trunk port - using the configured VLAN TAG, and downloads the kernel.
            The kernel loads and attempts to grab a DHCP address. It does this without the VLAN TAG.
            As the blade only has access via a trunk port, it fails to get the DHCP at this point and is unable to continue accessing the FOG server.

            G 1 Reply Last reply Apr 16, 2019, 1:00 AM Reply Quote 0
            • G
              george1421 Moderator @Gribbly
              last edited by george1421 Apr 15, 2019, 7:05 PM Apr 16, 2019, 1:00 AM

              @Gribbly said in booting from non-native(dot1q) VLAN:

              The kernel loads and attempts to grab a DHCP address. It does this without the VLAN TAG.

              Ok in this case the iPXE boot kernel knows nothing about vlans so it will always communicate untagged to the network switch. We can bypass iPXE, but then we run into the issue of FOS not (currently) supporting vlans. I’ve done some kernel development work and I know that FOS kernel doesn’t have the 802.1q code installed (but could have). Since FOS is linux we could get it to support vlans. That would just require a custom kernel and inits. The root of the issue at the moment then would be to get FOS to boot on this target computer without using iPXE. I can get FOS to boot from usb as well as from an ISO image but I’m not sure if that will help here. You may be out of luck. But let me think about it. I could compile the linux kernel in the AM to include the 802.1q code and then test getting FOS to support vlan trunking. It shouldn’t be too hard ™.

              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!

              G 1 Reply Last reply Apr 16, 2019, 1:05 AM Reply Quote 0
              • G
                Gribbly @george1421
                last edited by Apr 16, 2019, 1:05 AM

                @george1421

                Thank you for your time. This is what my conclusion had been - apologies if I wasn’t clear with what I was trying to get across!

                I’ll go back to my pxe ubuntu install - which I am able to get working, but obviously without the benefit of just imaging!

                G 1 Reply Last reply Apr 16, 2019, 1:05 AM Reply Quote 0
                • G
                  george1421 Moderator @Gribbly
                  last edited by george1421 Apr 15, 2019, 7:06 PM Apr 16, 2019, 1:05 AM

                  @Gribbly said in booting from non-native(dot1q) VLAN:

                  I’ll go back to my pxe ubuntu install

                  How are you doing this? This method supports vlan tagging? Can you load a custom bzImage (linux kernel) and inits with this method?

                  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
                    Gribbly
                    last edited by Apr 16, 2019, 1:07 AM

                    I am able to load the Ubuntu Installer Kernel, which has VLAN support. Using the Expert configuration, it gives me the ability to configure a VLAN ID.

                    G 1 Reply Last reply Apr 16, 2019, 1:09 AM Reply Quote 0
                    • G
                      george1421 Moderator @Gribbly
                      last edited by Apr 16, 2019, 1:09 AM

                      @Gribbly Well then let me see what I can do. The vlid in question is 2223? This sounds just challenging enough to pique my interest to see if I can do it.

                      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!

                      G 1 Reply Last reply Apr 16, 2019, 1:13 AM Reply Quote 0
                      • G
                        Gribbly @george1421
                        last edited by Apr 16, 2019, 1:13 AM

                        @george1421

                        Yes sir, i’m using VLAN_ID 2223 here.

                        G 1 Reply Last reply Apr 16, 2019, 1:15 AM Reply Quote 0
                        • G
                          george1421 Moderator @Gribbly
                          last edited by Apr 16, 2019, 1:15 AM

                          @Gribbly OK let me recompile the FOS kernel and then I’ll load it into by debug environment in the AM. I should know pretty quickly if I can get vlan tagging to work.

                          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!

                          G 1 Reply Last reply Apr 16, 2019, 1:16 AM Reply Quote 0
                          • G
                            Gribbly @george1421
                            last edited by Apr 16, 2019, 1:16 AM

                            @george1421 Thank you! Please let me know if you need any more info or for me to test anything here!

                            G 2 Replies Last reply Apr 16, 2019, 2:57 PM Reply Quote 0
                            • G
                              george1421 Moderator @Gribbly
                              last edited by george1421 Apr 16, 2019, 9:43 AM Apr 16, 2019, 2:57 PM

                              @Gribbly Ok I have a working solution on the FOS/linux side. Below is the grub configuration needed to boot FOS from a USB drive. You will need to take this information and integrate it into your environment.

                              The new FOS kernels and inits are bzImageVLAN and vlinit.xz that will be used to boot FOS. Since you don’t have the tight integration with iPXE the grub there are different kernel parameters for different actions that FOG takes. You shall see the examples of these below. The only thing you really have to remember is that when you go to image with FOG using this method you MUST schedule the task first in the web ui before pxe booting the target computer and selecting #1 from the grub menu.

                              set myfogip=192.168.1.50
                              set myimage=/boot/bzImageVLAN
                              set myinits=/boot/vlinit.xz
                              set myloglevel=4
                              set timeout=-1
                              insmod all_video
                              
                              menuentry "1. FOG Image Deploy/Capture" {
                               echo loading the kernel
                               linux  $myimage loglevel=$myloglevel initrd=vlinit.xz root=/dev/ram0 rw ramdisk_size=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 vlan=2223
                               echo loading the virtual hard drive
                               initrd $myinits
                               echo booting kernel...
                              }
                              
                              menuentry "2. Perform Full Host Registration and Inventory" {
                               echo loading the kernel
                               linux  $myimage loglevel=$myloglevel initrd=vlinit.xz root=/dev/ram0 rw ramdisk_size=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=manreg vlan=2223
                               echo loading the virtual hard drive
                               initrd $myinits
                               echo booting kernel...
                              
                              menuentry "3. Quick Registration and Inventory" {
                               echo loading the kernel
                               linux  $myimage loglevel=$myloglevel initrd=vlinit.xz root=/dev/ram0 rw ramdisk_size=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=autoreg vlan=2223
                               echo loading the virtual hard drive
                               initrd $myinits
                               echo booting kernel...
                              }
                              
                              menuentry "4. Client System Information (Compatibility)" {
                               echo loading the kernel
                               linux  $myimage loglevel=$myloglevel initrd=vlinit.xz root=/dev/ram0 rw ramdisk_size=127000 keymap= web=$myfogip/fog/ boottype=usb consoleblank=0 rootfstype=ext4 mode=sysinfo vlan=2223
                               echo loading the virtual hard drive
                               initrd $myinits
                               echo booting kernel...
                              }
                              
                              menuentry "6. FOG Debug Kernel" {
                               echo loading the kernel
                               linux  $myimage loglevel=7 init=/sbin/init root=/dev/ram0 rw ramdisk_size=127000 keymap= boottype=usb consoleblank=0 rootfstype=ext4 mdraid=true isdebug=yes vlan=2223
                               echo loading the virtual hard drive
                               initrd $myinits
                               echo booting kernel...
                              }
                              
                              

                              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 @Gribbly
                                last edited by Apr 16, 2019, 2:59 PM

                                @Gribbly Look at the forum chat bubble for a few additional hints.

                                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
                                  last edited by Apr 16, 2019, 5:01 PM

                                  Ok after a lengthy discussion in chat we have a working solution with the updated bzImageVLAN and the patched vlinit.xz files. Since ipxe WAS getting an ip address in this configuration we could avoid all of the syslinux configuration stuff and just go into FOG and update the kernel and init with the new names, then under kernel args add in vlan=2223. The OP setup a debug task on the FOG server and pxe booted into FOS. FOS picked up the right IP address on the vlan and we are golden. The OP was going to try to image using this setup, but since FOS got the right IP address the reset should be just normal fog stuff.

                                  @Developers While this is a fringe (one-off) case, I don’t see any real value in integrating it into the FOG kernels, but I’ll document it here.

                                  1. I added the vlan support by Networking support->Networking options-> 802.1Q/802.1ad VLAN Support then recompiled the kernel.
                                  2. I unpacked the current inits with the guidance from here: https://wiki.fogproject.org/wiki/index.php/Modifying_the_Init_Image
                                  3. I updated the /etc/init.d/S40network startup script by adding
                                  # At the top
                                  . /usr/share/fog/lib/funcs.sh
                                  vlid="$vlan"
                                  
                                  #then in the ifaces loop
                                      echo "Starting $iface interface and waiting for the link to come up"
                                  
                                      if [ -z "$vlid" ]; then
                                          echo -e "auto $iface\niface $iface inet dhcp\n\n" >> /etc/network/interfaces
                                      else
                                          echo -e "auto $iface\niface $iface inet manual\n\n" >> /etc/network/interfaces
                                          echo -e "auto $iface.$vlid\niface $iface.$vlid inet dhcp\n    vlan-raw-device $iface\n\n" >> /etc/network/interfaces
                                          echo "Waiting for physical adapter to be ready"
                                          /sbin/ip link set $iface up
                                          sleep 10
                                          echo "Assigning vlan $vlid to interface $iface"
                                          vconfig add $iface $vlid
                                          iface="$iface.$vlid"
                                      fi
                                      echo "Brining up network interface $iface"
                                      /sbin/ip link set $iface up
                                  
                                      # Wait till the interface is fully up and ready (spanning tree)
                                  
                                  1. Then I repacked the inits and sent them with the bzImageVLAN kernel to the OP for testing.

                                  With this method I added a new kernel parameter called vlan which sets the proper vlan and brings up that interface. The only caveat with this code is that if there are multiple interfaces that defined VLAN will be created on each interface until it finds one that works.

                                  Here is the patched S40network startup script.
                                  S40network.txt

                                  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 2
                                  • S
                                    Sebastian Roth Moderator
                                    last edited by Apr 16, 2019, 6:59 PM

                                    @george1421 Nice work George!!

                                    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
                                    • 1 / 1
                                    1 / 1
                                    • First post
                                      7/17
                                      Last post

                                    148

                                    Online

                                    12.0k

                                    Users

                                    17.3k

                                    Topics

                                    155.2k

                                    Posts
                                    Copyright © 2012-2024 FOG Project