PXE booting with Ubiquiti EdgeRouter

This tutorial will walk you through setting up a Ubiquiti EdgeRouter to allow PXE booting. This tutorial assumes that you have a TFTP & NFS Server running on `192.168.69.100`. [[pxe-server-ubuntu|A complete PXE setup guide is located here]].
# Login to router via ssh, enter configure mode
{{{ lang=bash
configure
}}}
# Add `bootfile-server` option to DHCP config
{{{ lang=bash
edit service dhcp-server shared-network-name dlasley.net subnet 192.168.69.0/24
set bootfile-server 192.168.69.100
}}}
# Add `filename` option to DHCP config. **Make sure to encapsulate the file path in `"`**
{{{ lang=bash
set subnet-parameters “filename "/pxe-boot/pxelinux.0";”
}}}
# Depending on your configuration, you may also need to add the `bootfile-name` parameter
{{{ lang=bash
set bootfile-name /pxe-boot/pxelinux.0
}}}
# Commit and save
{{{ lang=bash
commit
save
}}}

**Note: If your DHCP server stops handing out new leases after making this change, [[http://www.ubnt.com/download#EdgeRouter:Lite|Upgrade your OS]] to at least [[http://www.ubnt.com/eula/?BACK=/downloads/ER-e100-v1.3.0.build4605130.tar|1.3.0]]**


Posted

in

by

Comments

8 responses to “PXE booting with Ubiquiti EdgeRouter”

  1. Euphoria Avatar
    Euphoria

    Thx. soo much, this help me a lot!!!

    1. dlasley Avatar

      Happy to assist, thanks for reading my blog!

  2. Eric Brown Avatar

    Thanks for this guide…I had to tweak this a bit to get it to work on my system running EdgeOS 1.4.1. The tweaks are below.

    On Step 2 and Step 3:

    Set bootfile-server 192.168.69.100
    Set bootfile-name pxelinux.0
    Set subnet-parameters "filename "pxelinux.0";"

    1. David Lasley Avatar

      Thanks for the reply, I haven’t updated to 1.4.1 yet… I should probably get on that ;). Once I do, I’ll test out the changes to make sure that it’s a version issue and not something different in our configurations, and will update the post accordingly. Thanks again!

    2. Dave Lasley Avatar

      Just as a followup, I have updated and did not require the change. I think this has something to do with a difference in our PXE servers. I’ll add a note to the post to reflect this. Thanks again!

  3. MIke Avatar

    Dave, just wanted to thank you for this writeup.

    I successfully used this on my Edgerouter lite version1.9.0 without error.

    I only changed the locations of my pxelinux.0 as Eric Brown reported.

    Thanks again!

  4. Travus Elm Avatar
    Travus Elm

    setup like this on another firewall looking to replace with edgerouter

    dhcp-option=66,,192.168.30.2
    dhcp-match=x86PC, option:client-arch, 0
    dhcp-match=BC_EFI, option:client-arch, 7
    dhcp-boot=tag:x86PC,pxelinux.0,TFTP_Server_Name,192.168.30.2
    dhcp-boot=tag:BC_EFI,\diagefi\QTSBPC.efi,TFTP_Server_Name,192.168.30.2

    what would I do to take that and put in to the edgerouter ?

  5. Travus Elm Avatar
    Travus Elm

    I found this for uefi but if this works will csm still work? or will this overwrite the csm boot information ?

    So I thought I would share what I was able to get to work for me, with the caveat that I actually don’t know what I am doing.

    configure
    set service dhcp-server global-parameters “option client-arch code 93 = unsigned integer 16;”
    edit service dhcp-server shared-network-name LAN1 subnet 172.24.0.0/16
    set bootfile-server 172.24.0.11
    set subnet-parameters “if exists user-class and option user-class = "iPXE" {filename "ipxe.conf";} else if option client-arch = 00:07 {filename "ipxe.efi";} else {filename "undionly.kpxe";}”
    commit
    save

    Though the wizard I setup a network with DHCP with the default name of LAN1 using the subnet of 172.24.0.0/16.

    My TFTP Server IP Address is 172.24.0.11. I have 3 key files on my TFTP Server:

    http://boot.ipxe.org/ipxe.efi
    http://boot.ipxe.org/undionly.kpxe
    And an iPXE configuration file I made called “ipxe.conf” (See http://ipxe.org/scripting)

    Note: ipxe.efi will not work with Secure Boot, as it is not signed. (http://forum.ipxe.org/showthread.php?tid=7533)

    This part is for chainloading iPXE to avoid a DHCP loop by pointing to ipxe.conf:

    if exists user-class and option user-class = "iPXE" {filename "ipxe.conf";}
    If not, this part detects if it is an efi system and points to ipxe.eif: (http://ipxe.org/cfg/platform)

    else if option client-arch = 00:07 {filename "ipxe.efi";}
    If not, this part just points to the regular bios iPXE boot file undionly.kpxe

    else {filename "undionly.kpxe";}

    REF
    https://community.ubnt.com/t5/EdgeMAX/UEFI-BIOS-network-booting/td-p/1610059

Leave a Reply

Your email address will not be published. Required fields are marked *