Configuring VyOS DHCP to PXEboot hosts using MAC addresses (static IP)


#1

Hi there…

Doing a little experiment on using VyOS DHCP for PXEboot hosts based on MAC addresses (static IP)…

The tftp server (192.168.1.6) exports the directory structure as follows:

  tftpboot
      |--  Type1
      |       |-- PXE
      |       |    |-- pxelinux.0
      |
      |-- Type2
      |       |-- PXE
      |       |    | -- pxelinux.0
      |

Would like to configure the DHCP to statically provide different PXEboot “types” depending on MAC address - option 66 and 67.

The configuration looks something like:

service {
    dhcp-server {
        disabled false
        shared-network-name ONE_PXEBOOT {
            authoritative disable
            subnet 192.168.1.152/30 {
                bootfile-name Type1/PXE/pxelinux.0
                bootfile-server 192.168.1.6
                lease 86400
                static-mapping Type1Host {
                    ip-address 192.168.1.152
                    mac-address 00:0c:29:9a:75:ca
                }
            }
        }
        shared-network-name TWO_PXEBOOT {
            authoritative disable
            subnet 192.168.1.150/30 {
                bootfile-name Type2/PXE/pxelinux.0
                bootfile-server 192.168.1.6
                lease 86400
                static-mapping Type2Host {
                    ip-address 192.168.1.150
                    mac-address 00:0c:29:9a:70:ca
                }
            }
        }
    }
}

Question(s):

  1. Is there a better way to do what I am doing in VyOS?
    I actually only want one host to match each PXEBoot “type”, but I couldn’t find anything smaller than /30.
  2. Can I really specify bootfile-name Type2/PXE/pxelinux.0 ?

Thank you…