Skip to content

Instantly share code, notes, and snippets.

@skottler
Last active November 3, 2022 08:47
Show Gist options
  • Select an option

  • Save skottler/80a18086991367566aa54b24a11bb8d2 to your computer and use it in GitHub Desktop.

Select an option

Save skottler/80a18086991367566aa54b24a11bb8d2 to your computer and use it in GitHub Desktop.

Revisions

  1. skottler revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -43,7 +43,7 @@ Download the kpxe image for netboot.xyz and set the permissions properly:

    ```
    sudo curl -o /srv/tftp/netboot.xyz.kpxe https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe
    sudo chown tftp:ftp /srv/tftp/netboot.xyz.kpxe
    sudo chown tftp:tftp /srv/tftp/netboot.xyz.kpxe
    ```

    At this point you should be able to use a TFTP client from a client in
  2. skottler revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ exit

    Update the apt cache with our newly configured repo using `sudo apt-get update`.

    Next, install TFTPD: `sudo apt-get instal tftpd-hpa`. The service will be
    Next, install TFTPD: `sudo apt-get install tftpd-hpa`. The service will be
    running once the package is installed. It doesn't require any further
    configuration.

  3. skottler revised this gist Nov 25, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    # Setting up netboot.xyz with an EdgeRouter

    This document covers how to setup netboot.xyz, a service that provides
    iPXE-based installation and live boot of a bunch of operating systems.
    iPXE-based installation and live boot of a bunch of operating systems,
    on a Ubiquiti EdgeRouter.

    ### Assumptions

  4. skottler revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -63,7 +63,7 @@ clients:
    configure
    set service dhcp-server global-parameters "option client-arch code 93 = unsigned integer 16;"
    edit service dhcp-server shared-network-name LAN subnet 10.10.2.1/24
    edit service dhcp-server shared-network-name LAN subnet 10.10.2.0/24
    set bootfile-server 10.10.2.1
    set bootfile-name netboot.xyz.kpxe
  5. skottler revised this gist Nov 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ Received 354972 bytes in 2.0 seconds

    ### Configure dhcpd

    We're gonna configure DHCP on the EdgeRouter to serve `tftp-server-name` to
    We're gonna configure DHCP on the EdgeRouter to serve the right parameters to
    clients:

    ```
  6. skottler created this gist Nov 25, 2017.
    92 changes: 92 additions & 0 deletions netboot.xyz-edgerouter.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    # Setting up netboot.xyz with an EdgeRouter

    This document covers how to setup netboot.xyz, a service that provides
    iPXE-based installation and live boot of a bunch of operating systems.

    ### Assumptions

    I've made a few assumptions throughout this document that will probably be
    different for your setup:

    * There is a DHCP pool called `LAN`
    * The `LAN` pool manages `10.10.2.0/24`

    ### Basic setup

    With that out of the way, let's get started.

    First, we're going to configure the main and contrib components with a mirror
    for Wheezy:

    ```
    configure
    set system package repository wheezy components 'main contrib'
    set system package repository wheezy distribution wheezy
    set system package repository wheezy url http://http.us.debian.org/debian
    commit
    save
    exit
    ```

    Update the apt cache with our newly configured repo using `sudo apt-get update`.

    Next, install TFTPD: `sudo apt-get instal tftpd-hpa`. The service will be
    running once the package is installed. It doesn't require any further
    configuration.

    ### Setup TFTP components

    Download the kpxe image for netboot.xyz and set the permissions properly:

    ```
    sudo curl -o /srv/tftp/netboot.xyz.kpxe https://boot.netboot.xyz/ipxe/netboot.xyz.kpxe
    sudo chown tftp:ftp /srv/tftp/netboot.xyz.kpxe
    ```

    At this point you should be able to use a TFTP client from a client in
    `10.10.2.0/24` to fetch the image:

    ```
    $ tftp 10.10.2.1
    tftp> get netboot.xyz.kpxe
    Received 354972 bytes in 2.0 seconds
    ```

    ### Configure dhcpd

    We're gonna configure DHCP on the EdgeRouter to serve `tftp-server-name` to
    clients:

    ```
    configure
    set service dhcp-server global-parameters "option client-arch code 93 = unsigned integer 16;"
    edit service dhcp-server shared-network-name LAN subnet 10.10.2.1/24
    set bootfile-server 10.10.2.1
    set bootfile-name netboot.xyz.kpxe
    commit
    save
    ```

    The configuration for the `LAN` pool should now look something like the following:

    ```
    skottler@edge1# show service dhcp-server shared-network-name LAN
    authoritative enable
    subnet 10.10.2.0/24 {
    bootfile-name netboot.xyz.kpxe
    bootfile-server 10.10.2.1
    default-router 10.10.2.1
    dns-server 10.10.2.1
    lease 86400
    start 10.10.2.100 {
    stop 10.10.2.199
    }
    }
    [edit]
    ```

    That's it!