booting from non-native(dot1q) VLAN
-
@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?
-
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.
-
@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.
-
Yes sir, i’m using VLAN_ID 2223 here.
-
@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.
-
@george1421 Thank you! Please let me know if you need any more info or for me to test anything here!
-
@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
andvlinit.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... }
-
@Gribbly Look at the forum chat bubble for a few additional hints.
-
Ok after a lengthy discussion in chat we have a working solution with the updated
bzImageVLAN
and the patchedvlinit.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 invlan=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.
- I added the vlan support by Networking support->Networking options-> 802.1Q/802.1ad VLAN Support then recompiled the kernel.
- I unpacked the current inits with the guidance from here: https://wiki.fogproject.org/wiki/index.php/Modifying_the_Init_Image
- 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)
- 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 -
@george1421 Nice work George!!