PXE Chain Loading from PXELinux to iPXE and back again

I recently needed to add a PXE environment to an existing PXE service.

At a high level, the existing PXE service (running on MS Windows WDS with iPXE) needed to remain in place, but the new PXE service needed to integrate with Cobbler on CentOS 7. As cobbler modifies the PXE options per MAC address, I couldn't simply add the boot options to iPXE, I needed to chain load to another PXE system.

PXE (at least these requirements) seems to be extremely poorly documented on the web, so this 'hack' might not be the best way of doing it, all I know is that it works a treat for all the test cases I've thrown at it. Feel free to comment if you have any better approaches

From iPXE (On Windows) to PXELinux

This version of iPXE firmware was compiled with the options built in, as a single boot file (undionly.kpxe), which then sought its configuration from a php file.

The PHP file contained the standard iPXE options. Comments are listed as ### and don't need to be included
The The sections specific to the chain loading are

<?php
### ... Other config before etc

:start
### Item to appear in menu
item --key 7 centos7 CentOS 7 PXELinux 
 
:centos7
### The next 2 lines (I believe) override the options picked up via DHCP (i.e. options 67 etc)
### Set 210 --> configure the destination TFTP server (holding the PXELinux kernel and config files)
set 210:string tftp://192.168.1.40/
### Set 209 --> configure the location to the GRUB-format config files in PXELinux
set 209:string pxelinux.cfg/\${mac}
### Chain --> Load the new PXELinux kernel
chain tftp://192.168.1.40/pxelinux.0

### ... Other config after etc
?>
From PXELinux BACK to iPXE

Note - you will need to obtain (download) a copy of the iPXE kernel and keep it in the TFTP root (e.g. /var/lib/tftpboot/ipxe.krn) on the PXELinux box, so it can find it and load the kernel before passing back to the iPXE system.

### - Default Cobbler-generated header 
DEFAULT menu
PROMPT 0
MENU TITLE Cobbler | http://www.cobblerd.org/
### ...

LABEL iPXEoriginal
        MENU LABEL Back to Original iPXE  
        ### Load the ipxe.krn kernel and chain-load the PHP config script
        KERNEL ipxe.krn dhcp && chain http://192.168.0.63/pxeconf.php

MENU end